generated from ui-javascript/tpl-mpa-vuecli3-vue2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Vue from 'vue' | ||
import "./btn-3d.less" | ||
|
||
|
||
// https://codepen.io/mudontire/pen/aeJQqB | ||
const App = { | ||
template: ` | ||
<button class="button-3d-1">3D Button 1</button> | ||
`, | ||
data() { | ||
return { | ||
count: 0, | ||
} | ||
}, | ||
computed: { | ||
plusOne: function () { | ||
return this.count + 1 | ||
}, | ||
}, | ||
methods: { | ||
increment() { | ||
this.count++ | ||
}, | ||
}, | ||
} | ||
|
||
Vue.config.productionTip = false | ||
|
||
new Vue({ | ||
el: '#app', | ||
render: h => h(App) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
button{ | ||
display: block; | ||
margin: 100px auto; | ||
} | ||
|
||
button:hover { | ||
cursor: pointer; | ||
} | ||
|
||
.button-3d-1 { | ||
position: relative; | ||
background: orangered; | ||
border: none; | ||
color: white; | ||
padding: 15px 24px; | ||
font-size: 1.4rem; | ||
/* hsl(hue, saturation, lightness) */ | ||
box-shadow: -6px 6px 0 hsl(16, 100%, 30%); | ||
outline: none; | ||
} | ||
|
||
.button-3d-1:hover { | ||
background: hsl(16, 100%, 45%); | ||
} | ||
|
||
.button-3d-1:active { | ||
background: hsl(16, 100%, 40%); | ||
top: 3px; | ||
left: -3px; | ||
box-shadow: -3px 3px 0 hsl(16, 100%, 30%); | ||
} | ||
|
||
.button-3d-1::before { | ||
position: absolute; | ||
display: block; | ||
content: ""; | ||
height: 0; | ||
width: 0; | ||
|
||
border: 6px solid transparent; | ||
border-right: 6px solid hsl(16, 100%, 30%); | ||
border-left-width: 0px; | ||
top: 0; | ||
left: -6px; | ||
} | ||
|
||
.button-3d-1::after { | ||
position: absolute; | ||
display: block; | ||
content: ""; | ||
height: 0; | ||
width: 0; | ||
|
||
border: 6px solid transparent; | ||
border-top: 6px solid hsl(16, 100%, 30%); | ||
border-bottom-width: 0px; | ||
bottom: -6px; | ||
right: 0; | ||
} | ||
|
||
.button-3d-1:active::before { | ||
border: 3px solid transparent; | ||
border-right: 3px solid hsl(16, 100%, 30%); | ||
border-left-width: 0px; | ||
left: -3px; | ||
} | ||
|
||
.button-3d-1:active::after { | ||
border: 3px solid transparent; | ||
border-top: 3px solid hsl(16, 100%, 30%); | ||
border-bottom-width: 0px; | ||
bottom: -3px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters