css-doodle DEMO http://yuanchuan.name/css-doodle
Created
February 22, 2018 14:09
-
-
Save lightmnd/2245664ceffcc3a06f30ab41fa219073 to your computer and use it in GitHub Desktop.
Spinners
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
<!-- | |
css-doodle: | |
http://yuanchuan.name/css-doodle/ | |
--> | |
<css-doodle> | |
:doodle { | |
@grid: 15 / 61.8vmin; | |
@shape: circle; | |
} | |
border-radius: 50%; | |
border: calc(1px + .05vmin) | |
solid transparent; | |
--r: @rand(360deg); | |
--n: calc( | |
@abs(@abs(@row() - 8) | |
+ @abs(@col() - 8) - 15) / 15 | |
); | |
transform: rotate(var(--r)); | |
border-left-color: hsl( | |
calc(var(--n) * 360 + 120), 60%, 60% | |
); | |
animation: | |
spin calc(.6s / var(--n)) linear infinite; | |
@keyframes spin { | |
to { | |
transform: rotate( | |
calc(var(--r) + @pick(1turn, -1turn)) | |
); | |
} | |
} | |
</css-doodle> |
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://s3-us-west-2.amazonaws.com/s.cdpn.io/52982/css-doodle.v0.2.0.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 { | |
margin: 0; | |
width: 100%; | |
height: 100%; | |
background: #0a0c27; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
overflow: hidden; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment