Skip to content

Instantly share code, notes, and snippets.

@chyngyz
Last active February 16, 2016 13:36
Show Gist options
  • Save chyngyz/cef75aed65432b714960 to your computer and use it in GitHub Desktop.
Save chyngyz/cef75aed65432b714960 to your computer and use it in GitHub Desktop.
Mouse Scroll Icon
@-webkit-keyframes mouse-wheel {
0% {
-webkit-transform: scaleY(.4)translateY();
transform: scaleY(.4)translateY();
}
20% {
-webkit-transform: scaleY(1)translateY();
transform: scaleY(1)translateY();
}
60% {
-webkit-transform: scaleY(.4)translateY(12px);
transform: scaleY(.4)translateY(12px);
}
100% {
-webkit-transform: scaleY(.4)translateY();
transform: scaleY(.4)translateY();
}
}
@keyframes mouse-wheel {
0% {
-webkit-transform: scaleY(.4)translateY();
transform: scaleY(.4)translateY();
}
20% {
-webkit-transform: scaleY(1)translateY();
transform: scaleY(1)translateY();
}
60% {
-webkit-transform: scaleY(.4)translateY(12px);
transform: scaleY(.4)translateY(12px);
}
100% {
-webkit-transform: scaleY(.4)translateY();
transform: scaleY(.4)translateY();
}
}
.mouse {
position: absolute;
box-sizing: border-box;
left: 50%;
bottom: 35px;
width: 30px;
margin-left: -15px;
height: 48px;
border-radius: 15px;
border: 2px solid #000;
-webkit-transform: translateZ();
transform: translateZ();
}
@media (max-width:767px) {
.mouse { display: none }
}
.m-touch .mouse { display: none }
.mouse__wheel {
position: absolute;
left: 50%;
top: 8px;
margin-left: -2px;
width: 4px;
height: 9px;
background: #000;
border-radius: 2px;
-webkit-animation: mouse-wheel 1.25s infinite linear;
animation: mouse-wheel 1.25s infinite linear;
-webkit-transform-origin: 50% 0%;
-ms-transform-origin: 50% 0%;
transform-origin: 50% 0%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment