Skip to content

Instantly share code, notes, and snippets.

@lennylamwork
Created November 12, 2020 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lennylamwork/d8e58805e398887fba24cfcd77a8ba52 to your computer and use it in GitHub Desktop.
Save lennylamwork/d8e58805e398887fba24cfcd77a8ba52 to your computer and use it in GitHub Desktop.
B R E A T H
- let i = 20
while i--
.x
// change values to get different effects
hue = 20
spin-multiplier = 36
round-mode = true
roundness-multiplier = 0.2
breath-amount = 0.6
size = 4vmin
delay = 80ms
// --------------------
.x
grid-row 1/-1
grid-column 1/-1
border-radius 12px
animation ease 2s alternate infinite
for i in 1..20
name = "x-%s" % i
&:nth-of-type({i})
box-shadow 0 0 (i*0.5)vmin rgba(0,0,0,0.1)
if round-mode
border-radius (1 + i*roundness-multiplier)vmin
width size*i
height size*i
background hsl(hue - 2*i, 100 - i*2, 100 - i*5)
animation-name name
animation-delay i*delay
transform perspective((500 - 10*i)px) rotate((spin-multiplier*i)deg)
z-index 100 - i
@keyframes name
to
transform rotate(( spin-multiplier*i )deg) scale(breath-amount)
body
min-height 100vh
overflow hidden
display grid
place-items center
background black
perspective 500px
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment