Skip to content

Instantly share code, notes, and snippets.

View MikeMcChillin's full-sized avatar

Michael McMillan MikeMcChillin

View GitHub Profile
@MikeMcChillin
MikeMcChillin / requestAnimFrame.js
Last active December 21, 2015 23:39 — forked from joelambert/README
Drop in replace functions for setTimeout() & setInterval() that make use of requestAnimationFrame() for performance where available
// requestAnimationFrame() shim by Paul Irish
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
window.requestAnimFrame = (function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function */ callback, /* DOMElement */ element){
window.setTimeout(callback, 1000 / 60);
// --------------------------------------------------------
// arrows
// --------------------------------------------------------
// $direction: top, left, right, bottom, top-left, top-right, bottom-left, bottom-right
// $color: hex, rgb or rbga
// $size: px or em
// @example
// .element{
// @include arrow(top, #000, 50px);
// }