A Pen by Alec Ortega on CodePen.
Created
May 19, 2016 02:30
-
-
Save anonymous/a190d565fde4be49ccfbe5c203705969 to your computer and use it in GitHub Desktop.
Animated Sliders Icon
This file contains hidden or 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
.options-icon | |
.line-container | |
.line | |
.circle | |
.line-container | |
.line | |
.circle | |
.line-container | |
.line | |
.circle |
This file contains hidden or 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://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> |
This file contains hidden or 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, body { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
background-color: #45729A; | |
height: 100%; | |
} | |
.options-icon { | |
cursor: pointer; | |
width: 50px; | |
&:hover { | |
.circle, .line { | |
background-color: #FFF; | |
} | |
.line-container:nth-child(1) .circle { | |
transform: translateX(-30px); | |
} | |
.line-container:nth-child(2) .circle { | |
transform: translateX(30px); | |
} | |
.line-container:nth-child(3) .circle { | |
transform: translateX(-5px); | |
} | |
} | |
} | |
.line-container { | |
margin: 11px 0; | |
position: relative; | |
} | |
.line { | |
height: 4px; | |
background-color: #2F4C65; | |
border-radius: 2px; | |
transition: all 0.25s ease-in-out; | |
} | |
.circle { | |
height: 10px; | |
width: 10px; | |
position: absolute; | |
background-color: #2F4C65; | |
border-radius: 50%; | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
margin: auto; | |
transition: all 0.25s ease-in-out; | |
.line-container:nth-child(1) & { | |
right: 5px; | |
} | |
.line-container:nth-child(2) & { | |
left: 5px; | |
} | |
.line-container:nth-child(3) & { | |
left: 50%; | |
margin-left: -4px; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment