Last active
February 4, 2024 13:12
-
-
Save ninjakuro/8a81de0d1248dc9020e822b8b4075fb3 to your computer and use it in GitHub Desktop.
css loader
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
.loader { | |
--loader-color: #197AFF; | |
--loader-size: 160px; | |
width: var(--loader-size); | |
height: var(--loader-size); | |
position: relative; | |
clip-path: circle(50%); | |
} | |
.loader::before { | |
content: ''; | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
background: conic-gradient(transparent, var(--loader-color)); | |
mask: radial-gradient(circle, transparent 50%, black 51%); | |
animation: rotation 2s linear infinite; | |
} | |
@keyframes rotation { | |
0% { | |
transform: rotate(0deg); | |
} | |
50% { | |
filter: hue-rotate(60deg); | |
} | |
100% { | |
transform: rotate(360deg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment