Skip to content

Instantly share code, notes, and snippets.

View cedmax's full-sized avatar
😅
oh no! I need another witty status

Marco Cedaro cedmax

😅
oh no! I need another witty status
View GitHub Profile
@nielsdoorn
nielsdoorn / animationPolyfill.js
Last active December 28, 2020 01:06
Eyes that follow your mouse cursor. Using HTML5 canvas.
// Paul Irish animation loop polyfill
// https://gist.github.com/paulirish/1579671
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];