Created
August 15, 2018 10:44
-
-
Save junaid1460/c6960780b1f509caa508bb9f88828bfc to your computer and use it in GitHub Desktop.
Simple slider with no javascript and animation
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
<html> | |
<style> | |
.begin { | |
background: #f1f1f1; | |
width : 100%; | |
} | |
.anim { | |
background: red; | |
width: 0%; | |
} | |
div.slider { | |
border-radius: 10px; | |
height: 10px; | |
min-width: 10px; | |
display: flex; | |
background: #8BC34A; | |
align-items: center; | |
justify-content: flex-end; | |
transition: 3s all ease-in-out; | |
} | |
.slider:focus { | |
background: #FF5722; | |
width: 3%; | |
} | |
.begin { | |
width: 100%; | |
transition: 5s all ease-in-out; | |
outline: none; | |
display: flex; | |
border-radius: 20px; | |
} | |
.point { | |
min-width: 20px; | |
min-height: 20px; | |
border-radius: 20px; | |
background: white; | |
box-shadow: 0 0 10px #c1c1c1; | |
} | |
</style> | |
<body> | |
<div class="begin"> | |
<div class="slider begin" tabindex="0" > | |
<div class="point"></div> | |
</div> | |
</div> | |
</body> | |
</html> |
add your own behavior
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
animates on focus