because tractor beams are cool.
gives a generic way to animate any numeric css val on an element. uses twain for animation
$ component install threepointone/beam
var el = document.getElementById('box'),
beam = require('beam');
document.body.addEventListener('mousemove', function(e){
beam(el,{
top: e.clientY + 'px',
left: e.clientX + 'px'
});
});
- makes the box follow the mouse. it sounds silly, I know. The demo's trippier.
MIT