Skip to content

Instantly share code, notes, and snippets.

@spite
Last active December 30, 2016 09:20
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spite/90e3dbf8e117660f6788a5748ae06cad to your computer and use it in GitHub Desktop.
Save spite/90e3dbf8e117660f6788a5748ae06cad to your computer and use it in GitHub Desktop.
Go to https://lines.chromeexperiments.com/drag/, start the experience and run this code in the console
document.getElementById( 'loading' ).style.display = 'none';
var speed = .001; // changes the rate of rotation
var distance = 4; // changes the distance the point travels
function _update() {
bAmDrawing = true;
lastMouseX = 0; lastMouseY = 0;
var a = speed * performance.now();
var x = distance * Math.cos( a );
var y = distance * Math.sin( a );
stage.mousemove( { data: { global : { x: x, y: y } } } )
}
function _animate() {
_update();
setTimeout( _animate, 1000 );
}
_animate();
@felipesabino
Copy link

But before executing, select the execution context to draw-container as the actual script needs to run inside the correct iframe

@spite
Copy link
Author

spite commented Dec 16, 2016

Right, when starting from the main page.
The instructions say "go to https://lines.chromeexperiments.com/drag/", to skip the embed altogether.

@felipesabino
Copy link

Oh, I had it open already and haven't noticed that the URL was different, my bad! Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment