Last active
February 4, 2021 04:57
-
-
Save w3collective/3e8eb372a918d9503e1568455d388c0d to your computer and use it in GitHub Desktop.
Animated scrolling mouse icon with CSS
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Animated mouse scroll icon with CSS</title> | |
<style> | |
html { | |
height: 100%; | |
} | |
body { | |
background: #fff; | |
font-family: sans-serif; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100%; | |
} | |
.icon-scroll { | |
width: 20px; | |
height: 30px; | |
background: #ccc; | |
border: 2px solid #bbb; | |
border-radius: 10px; | |
display: flex; | |
justify-content: center; | |
margin: auto; | |
position: relative; | |
box-shadow: 3px 3px 5px -5px #000; | |
} | |
.icon-scroll::before { | |
content: ""; | |
width: 4px; | |
height: 10px; | |
background: #eee; | |
border-radius: 2px; | |
margin-top: 5px; | |
} | |
.icon-scroll::after { | |
content: ""; | |
width: 4px; | |
height: 3px; | |
background-color: #bbb; | |
position: absolute; | |
display: block; | |
animation: scroll ease 1s infinite; | |
} | |
@keyframes scroll { | |
from { | |
top: 5px; | |
} | |
to { | |
top: 18px; | |
} | |
100% { | |
opacity: 0; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="icon-scroll"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source => https://w3collective.com/animated-scrolling-mouse-icon/