Skip to content

Instantly share code, notes, and snippets.

@ee-in
Created July 28, 2015 01:21
Show Gist options
  • Select an option

  • Save ee-in/818f66053d09df7aee57 to your computer and use it in GitHub Desktop.

Select an option

Save ee-in/818f66053d09df7aee57 to your computer and use it in GitHub Desktop.
Neon Hexagons Thing
-x = 30
-vb = '0 0 500 500'
-hex = '181.5,369.9 112.6,250.5 181.5,131.1 319.5,131.1 388.4,250.5 319.5,369.9'
//Hidden
svg
symbol#svg(viewBox=vb)
polygon(points=hex)
defs
filter#neon
feGaussianBlur(stdDeviation='12')
//Use
#stage
while x--
#hex1
svg
use#hex(xlink:href='#svg')
#hex2
svg
use#hex(xlink:href='#svg')
shapes = 60
clr = #FF0099
ez = cubic-bezier(0.6, -0.2, 0.2, 0.6) infinite
//
for num in (1..shapes)
//Glow
#hex1:nth-child({num})
left (num * 10) px
animation play+num 5s (num / 40)s ez
z-index - num
svg
fill spin(clr, num * 5)
//Shape
#hex2:nth-child({num})
left (num * 10) px
animation play+num 5s (num / 40)s ez
z-index - num
stroke rgba(lighten(clr,num * 20),0.8)
stroke-width 2
svg
fill spin(clr, num * 5)
//Animation
@keyframes play{num}
50%
transform rotateZ(num * 25 deg)
transform rotateX(num * 15 deg)
//Container
#stage
width 500px
height 100px
top 50%
left 50%
margin-left -(@width / 1.2)
margin-top -(@height / 1.2)
position absolute
perspective 1000px
#hex1, #hex2
position absolute
#hex1
filter url(#neon)
body
background #111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment