Skip to content

Instantly share code, notes, and snippets.

@rileyjshaw
Created October 29, 2013 13:59
Show Gist options
  • Save rileyjshaw/7215200 to your computer and use it in GitHub Desktop.
Save rileyjshaw/7215200 to your computer and use it in GitHub Desktop.
A Pen by Riley Shaw.
#vcent
h1 Shadows!
h1 = $('h1')
cx = cy = 0
setOffsets = () ->
cx = h1.offset().left + h1.width() / 2
cy = h1.offset().top + h1.height() / 2
$(window).on
'mousemove': (e) ->
mx = e.clientX
my = e.clientY
dx = cx - mx
dy = cy - my
console.log mx, my, cx, cy
h1.css 'text-shadow', "#{dx/50}px #{dy/50}px #16a085"
'load': setOffsets
'resize': setOffsets
@import "compass"
body, html, #vcent
height: 100%
body, html
width: 100%
body
text-align: center
background-color: #1abc9c
#vcent, h1
display: inline-block
vertical-align: middle
h1
font: bold 80px sans-serif
text-transform: uppercase
color: #ecf0f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment