Created
April 28, 2015 19:19
-
-
Save pairing/c545f26ad79a3e4a50db to your computer and use it in GitHub Desktop.
Shatter
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
$('div').each(function() { | |
var scale = Math.floor((Math.random() * 50) + 1); | |
$(this).css('transition', 'all 0.' + scale + 's'); | |
}); | |
$(document).on('keyup', function(e) { | |
$('div').each(function() { | |
var scale = Math.floor((Math.random() * 50) + 1); | |
$(this).css('transform', 'rotate(' + scale + 'deg)'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment