A Pen by MohammadAli Mirhamed Rooy on CodePen.
Created
May 6, 2019 15:40
-
-
Save MohammadaliMirhamed/caf138770b919cff8089850ed3c6f650 to your computer and use it in GitHub Desktop.
css stepper vue
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
<div id="app"> | |
<center> | |
<ul class="stepper"> | |
<a href="#" class="stepper__item" v-on:click="page =1" :class="{'stepper__item current': page === 1}"><li>Step 1 </li></a> | |
<a href="#" class="stepper__item" v-on:click="page =2" :class="{'stepper__item current': page === 2}"><li >Step 2</li></a> | |
<a href="#" class="stepper__item" v-on:click="page =3" :class="{'stepper__item current': page === 3}"><li>Step 3</li></a> | |
<a href="#" class="stepper__item" v-on:click="page =4" :class="{'stepper__item current': page === 4}"><li>Step 4</li></a> | |
</ul> | |
<div id="content" style="width: 50%;"> | |
<div v-if="page==1" id="sec_one"> | |
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum | |
</div> | |
<div v-if="page==2" id="sec_two"> | |
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). | |
</div> | |
<div v-if="page==3" id="sec_three"> | |
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. | |
</div> | |
<div v-if="page==4" id="sec_four"> | |
or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of m | |
</div> | |
</div> | |
<div id="b"> | |
<div id="b_left"> | |
<button class="btn-left" type="submit" v-on:click="page <= 4 && page > 1 ? page -=1 : ''" >Backward </button> | |
</div> | |
<div id="b_right"> | |
<button class="btn-right" type="submit" v-on:click="page >= 1 && page < 4 ? page +=1 : ''" >Forward </button> | |
</div> | |
</div> | |
</center> | |
</div> |
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
const app = new Vue({ | |
el: '#app', | |
data: { | |
page:1, | |
} | |
}); |
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
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> |
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
body { | |
background: #f7f6f6; | |
} | |
.stepper { | |
display: flex; | |
margin: 100px; | |
padding: 0; | |
width: 60rem; | |
list-style: none; | |
position: relative; | |
} | |
.stepper::before { | |
position: absolute; | |
top: 0; | |
left: 0; | |
height: 100%; | |
content: ""; | |
width: calc(100% - 20px); | |
background: #e7e7e7; | |
} | |
.stepper__item { | |
text-decoration: none; | |
/* border: aliceblue; */ | |
/* border-style: solid; */ | |
flex: 100%; | |
border-width: 1px; | |
padding: 20px 20px 20px 40px; | |
background: #d7d7e2; | |
/* background: repeating-linear-gradient(-65deg, #fff, #fff 20px, #fcfcfc 20px, #fcfcfc 40px); */ | |
/* margin: 0 0 0 -19px; */ | |
-webkit-clip-path: polygon(20px 50%, 0% 0%, calc(100% - 20px) 0%, 100% 50%, calc(100% - 20px) 100%, 0% 100%); | |
} | |
.stepper__item.current { | |
/* background: #fff; */ | |
font-weight: bold; | |
background: #fd9c03; | |
color: #fff; | |
} | |
.stepper__item.complete { | |
background: repeating-linear-gradient(-65deg, #fcfcfc, #fcfcfc 20px, #f4faf7 20px, #f4faf7 40px); | |
} | |
.stepper__item:first-child { | |
padding: 20px; | |
-webkit-clip-path: polygon(0% 0%, calc(100% - 20px) 0%, 100% 50%, calc(100% - 20px) 100%, 0% 100%); | |
} | |
.stepper__item:last-child { | |
-webkit-clip-path: polygon(20px 50%, 0% 0%, 100% 0%, 100% 100%, 0% 100%); | |
} | |
#b_left{ | |
float: left; | |
} | |
#b_right{ | |
float: right; | |
} | |
/* The button-maker */ | |
/* How to include it */ | |
.btn-right { | |
background: none; | |
border: 0; | |
font-size: 22px; | |
line-height: 2em; | |
position: relative; | |
width: 8em; | |
height: 2em; | |
} | |
.btn-right a { | |
color: #fff; | |
text-decoration: none; | |
position: relative; | |
z-index: 10; | |
} | |
.btn-right::before, .btn-right::after { | |
background: #29c0d5; | |
border-radius: 2px; | |
content: ''; | |
display: block; | |
position: absolute; | |
left: 0; | |
right: 0; | |
transition: all 1s; | |
height: 1em; | |
} | |
.btn-right::before { | |
box-shadow: -1px 1px 0 #1897c0, -2px 2px 0 #1897c0, -3px 3px 0 #1897c0, -4px 4px 0 #1897c0; | |
-webkit-transform: skew(45deg); | |
transform: skew(45deg); | |
top: 0; | |
} | |
.btn-right::after { | |
box-shadow: 1px 1px 0 #1897c0, 2px 2px 0 #1897c0, 3px 3px 0 #1897c0, 4px 4px 0 #1897c0; | |
-webkit-transform: skew(-45deg); | |
transform: skew(-45deg); | |
bottom: 0; | |
} | |
.btn-right:hover::before, .btn-right:hover::after { | |
background: #68d3e2; | |
} | |
.btn-right:focus { | |
outline: 0; | |
} | |
.btn-right:focus::before, .btn-right:focus::after { | |
background: #68d3e2; | |
} | |
.btn-left { | |
background: none; | |
border: 0; | |
font-size: 22px; | |
line-height: 2em; | |
position: relative; | |
width: 8em; | |
height: 2em; | |
} | |
.btn-left a { | |
color: #fff; | |
text-decoration: none; | |
position: relative; | |
z-index: 10; | |
} | |
.btn-left::before, .btn-left::after { | |
background: #e4135d; | |
border-radius: 2px; | |
content: ''; | |
display: block; | |
position: absolute; | |
left: 0; | |
right: 0; | |
transition: all 1s; | |
height: 1em; | |
} | |
.btn-left::before { | |
box-shadow: -1px 1px 0 #c81163, -2px 2px 0 #c81163, -3px 3px 0 #c81163, -4px 4px 0 #c81163; | |
-webkit-transform: skew(45deg); | |
transform: skew(45deg); | |
bottom: 0; | |
z-index: 1; | |
} | |
.btn-left::after { | |
box-shadow: 1px 1px 0 #c81163, 2px 2px 0 #c81163, 3px 3px 0 #c81163, 4px 4px 0 #c81163; | |
-webkit-transform: skew(-45deg); | |
transform: skew(-45deg); | |
top: 0; | |
} | |
.btn-left:hover::before, .btn-left:hover::after { | |
background: #f1538b; | |
} | |
.btn-left:focus { | |
outline: 0; | |
} | |
.btn-left:focus::before, .btn-left:focus::after { | |
background: #f1538b; | |
} | |
.btn-up { | |
background: none; | |
border: 0; | |
font-size: 22px; | |
line-height: 3em; | |
position: relative; | |
width: 4em; | |
height: 3em; | |
-webkit-transform: rotate(-90deg); | |
transform: rotate(-90deg); | |
} | |
.btn-up a { | |
color: #fff; | |
text-decoration: none; | |
position: relative; | |
z-index: 10; | |
} | |
.btn-up::before, .btn-up::after { | |
background: #e4135d; | |
border-radius: 2px; | |
content: ''; | |
display: block; | |
position: absolute; | |
left: 0; | |
right: 0; | |
transition: all 1s; | |
height: 1.5em; | |
} | |
.btn-up::before { | |
box-shadow: -1px 1px 0 #c81163, -2px 2px 0 #c81163, -3px 3px 0 #c81163, -4px 4px 0 #c81163; | |
-webkit-transform: skew(45deg); | |
transform: skew(45deg); | |
top: 0; | |
} | |
.btn-up::after { | |
box-shadow: 1px 1px 0 #c81163, 2px 2px 0 #c81163, 3px 3px 0 #c81163, 4px 4px 0 #c81163; | |
-webkit-transform: skew(-45deg); | |
transform: skew(-45deg); | |
bottom: 0; | |
} | |
.btn-up:hover::before, .btn-up:hover::after { | |
background: #f1538b; | |
} | |
.btn-up:focus { | |
outline: 0; | |
} | |
.btn-up:focus::before, .btn-up:focus::after { | |
background: #f1538b; | |
} | |
.btn-down { | |
background: none; | |
border: 0; | |
font-size: 22px; | |
line-height: 4em; | |
position: relative; | |
width: 6em; | |
height: 4em; | |
-webkit-transform: rotate(90deg); | |
transform: rotate(90deg); | |
margin-top: 3em; | |
} | |
.btn-down a { | |
color: #fff; | |
text-decoration: none; | |
position: relative; | |
z-index: 10; | |
} | |
.btn-down::before, .btn-down::after { | |
background: #29c0d5; | |
border-radius: 2px; | |
content: ''; | |
display: block; | |
position: absolute; | |
left: 0; | |
right: 0; | |
transition: all 1s; | |
height: 2em; | |
} | |
.btn-down::before { | |
box-shadow: -1px 1px 0 #1897c0, -2px 2px 0 #1897c0, -3px 3px 0 #1897c0, -4px 4px 0 #1897c0; | |
-webkit-transform: skew(45deg); | |
transform: skew(45deg); | |
top: 0; | |
} | |
.btn-down::after { | |
box-shadow: 1px 1px 0 #1897c0, 2px 2px 0 #1897c0, 3px 3px 0 #1897c0, 4px 4px 0 #1897c0; | |
-webkit-transform: skew(-45deg); | |
transform: skew(-45deg); | |
bottom: 0; | |
} | |
.btn-down:hover::before, .btn-down:hover::after { | |
background: #68d3e2; | |
} | |
.btn-down:focus { | |
outline: 0; | |
} | |
.btn-down:focus::before, .btn-down:focus::after { | |
background: #68d3e2; | |
} | |
@-webkit-keyframes zoom { | |
25% { | |
-webkit-transform: scale3d(1.5, 1.5, 0); | |
transform: scale3d(1.5, 1.5, 0); | |
} | |
50% { | |
-webkit-transform: scale3d(1, 1, 0); | |
transform: scale3d(1, 1, 0); | |
} | |
75% { | |
-webkit-transform: scale3d(1.25, 1.25, 0); | |
transform: scale3d(1.25, 1.25, 0); | |
} | |
} | |
@keyframes zoom { | |
25% { | |
-webkit-transform: scale3d(1.5, 1.5, 0); | |
transform: scale3d(1.5, 1.5, 0); | |
} | |
50% { | |
-webkit-transform: scale3d(1, 1, 0); | |
transform: scale3d(1, 1, 0); | |
} | |
75% { | |
-webkit-transform: scale3d(1.25, 1.25, 0); | |
transform: scale3d(1.25, 1.25, 0); | |
} | |
} | |
@-webkit-keyframes spin { | |
100% { | |
-webkit-transform: rotate(360deg); | |
transform: rotate(360deg); | |
} | |
} | |
@keyframes spin { | |
100% { | |
-webkit-transform: rotate(360deg); | |
transform: rotate(360deg); | |
} | |
} | |
/* Page styling */ | |
body { | |
background: #fefefe; | |
font-family: "Noto sans", sans-serif; | |
text-align: center; | |
margin: 3em 0; | |
} | |
h1 { | |
color: #0b1421; | |
font-weight: 400; | |
} | |
button a { | |
top: -2px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment