Experimental motion detection in JS