Last active
January 1, 2016 10:19
-
-
Save SyntaxColoring/8130437 to your computer and use it in GitHub Desktop.
Trace a sine wave with your flag on isitchristmas.com.
This file contains 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
var theta = 0.0; | |
window.setInterval(function() { | |
theta += Math.PI/10; | |
if (theta >= Math.PI*4) theta = 0.0; | |
var event = {clientX: theta*100, clientY: (Math.sin(theta)+1.5)*100, button: 2}; | |
me.angle = Math.cos(theta)*180/Math.PI; | |
setRotate(me.flag, me.angle); | |
emit('scroll', {id: me.id, angle: me.angle}); | |
document.onmousemove(event); | |
document.onmousedown(event); | |
}, 200); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment