Skip to content

Instantly share code, notes, and snippets.

@patrykgruszka
Last active August 22, 2016 12:22
Show Gist options
  • Save patrykgruszka/5da2bf49ade833f062a3343a2938d845 to your computer and use it in GitHub Desktop.
Save patrykgruszka/5da2bf49ade833f062a3343a2938d845 to your computer and use it in GitHub Desktop.
HTML / SCSS Mouse wheel animation icon - https://jsfiddle.net/pgruszka/1ndzyhst/
.mousewheel-icon {
display: inline-block;
height: 38px;
width: 22px;
z-index: 10;
border: 1px solid #333;
border-radius: 16px;
.wheel {
position: relative;
border-radius: 50%;
background: #333;
width: 3px;
height: 6px;
top: 3px;
margin-left: auto;
margin-right: auto;
animation-name: mousewheel;
animation-duration: 1.3s;
animation-timing-function: linear;
animation-delay: 0s;
animation-iteration-count: infinite;
animation-play-state: running;
}
&.white {
border-color: #fff;
.wheel {
background: #fff;
}
}
}
@keyframes mousewheel {
0% {
top: 4px;
opacity: 0;
}
30% {
top: 10px;
opacity: 1;
}
70% {
top: 15px;
opacity: 0;
}
100% {
opacity: 0;
}
}
<div class="mousewheel-icon">
<div class="wheel"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment