Skip to content

Commit 9296372

Browse files
committed
adjust
1 parent 7819cb1 commit 9296372

File tree

4 files changed

+118
-1
lines changed

4 files changed

+118
-1
lines changed

_btns/btn-3d.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import Vue from 'vue'
2+
import "./btn-3d.less"
3+
4+
5+
// https://codepen.io/mudontire/pen/aeJQqB
6+
const App = {
7+
template: `
8+
9+
<button class="button-3d-1">3D Button 1</button>
10+
`,
11+
data() {
12+
return {
13+
count: 0,
14+
}
15+
},
16+
computed: {
17+
plusOne: function () {
18+
return this.count + 1
19+
},
20+
},
21+
methods: {
22+
increment() {
23+
this.count++
24+
},
25+
},
26+
}
27+
28+
Vue.config.productionTip = false
29+
30+
new Vue({
31+
el: '#app',
32+
render: h => h(App)
33+
})

_btns/btn-3d.less

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
button{
2+
display: block;
3+
margin: 100px auto;
4+
}
5+
6+
button:hover {
7+
cursor: pointer;
8+
}
9+
10+
.button-3d-1 {
11+
position: relative;
12+
background: orangered;
13+
border: none;
14+
color: white;
15+
padding: 15px 24px;
16+
font-size: 1.4rem;
17+
/* hsl(hue, saturation, lightness) */
18+
box-shadow: -6px 6px 0 hsl(16, 100%, 30%);
19+
outline: none;
20+
}
21+
22+
.button-3d-1:hover {
23+
background: hsl(16, 100%, 45%);
24+
}
25+
26+
.button-3d-1:active {
27+
background: hsl(16, 100%, 40%);
28+
top: 3px;
29+
left: -3px;
30+
box-shadow: -3px 3px 0 hsl(16, 100%, 30%);
31+
}
32+
33+
.button-3d-1::before {
34+
position: absolute;
35+
display: block;
36+
content: "";
37+
height: 0;
38+
width: 0;
39+
40+
border: 6px solid transparent;
41+
border-right: 6px solid hsl(16, 100%, 30%);
42+
border-left-width: 0px;
43+
top: 0;
44+
left: -6px;
45+
}
46+
47+
.button-3d-1::after {
48+
position: absolute;
49+
display: block;
50+
content: "";
51+
height: 0;
52+
width: 0;
53+
54+
border: 6px solid transparent;
55+
border-top: 6px solid hsl(16, 100%, 30%);
56+
border-bottom-width: 0px;
57+
bottom: -6px;
58+
right: 0;
59+
}
60+
61+
.button-3d-1:active::before {
62+
border: 3px solid transparent;
63+
border-right: 3px solid hsl(16, 100%, 30%);
64+
border-left-width: 0px;
65+
left: -3px;
66+
}
67+
68+
.button-3d-1:active::after {
69+
border: 3px solid transparent;
70+
border-top: 3px solid hsl(16, 100%, 30%);
71+
border-bottom-width: 0px;
72+
bottom: -3px;
73+
}

config/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ module.exports = {
1313
showNav: true,
1414

1515
// entry: './__demo/**/*.js',
16-
entry: './_hooks/**/*.js',
16+
// entry: './_hooks/**/*.js',
17+
entry: './_btns/**/*.js',
1718
}

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9259,6 +9259,11 @@ vue-loader@^15.7.0:
92599259
vue-hot-reload-api "^2.3.0"
92609260
vue-style-loader "^4.1.0"
92619261

9262+
vue-router@^3.0.3:
9263+
version "3.4.8"
9264+
resolved "https://registry.npm.taobao.org/vue-router/download/vue-router-3.4.8.tgz#2c06261d35d8075893470352d42d70b6287b8194"
9265+
integrity sha1-LAYmHTXYB1iTRwNS1C1wtih7gZQ=
9266+
92629267
vue-style-loader@^4.1.0:
92639268
version "4.1.2"
92649269
resolved "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8"
@@ -9285,6 +9290,11 @@ vue@^2.6.12:
92859290
resolved "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123"
92869291
integrity sha1-9evU+mvShpQD4pqJau1JBEVskSM=
92879292

9293+
vuex@^3.1.2:
9294+
version "3.5.1"
9295+
resolved "https://registry.npm.taobao.org/vuex/download/vuex-3.5.1.tgz?cache=0&sync_timestamp=1604065489763&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvuex%2Fdownload%2Fvuex-3.5.1.tgz#f1b8dcea649bc25254cf4f4358081dbf5da18b3d"
9296+
integrity sha1-8bjc6mSbwlJUz09DWAgdv12hiz0=
9297+
92889298
watchpack@^1.6.0:
92899299
version "1.6.0"
92909300
resolved "https://registry.npm.taobao.org/watchpack/download/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00"

0 commit comments

Comments
 (0)