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
// e.g. scrollToTarget(document.getElementById('foo')); | |
function getOffset(target){ | |
var offset = {}; | |
function getOrdinate(offsetType){ | |
var ord = 0; | |
while (target && target !== document.body){ | |
if (target[offsetType]){ | |
ord += target[offsetType]; |
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
/** | |
* Move in a circle without wrapper elements | |
* Idea by Aryeh Gregor, simplified by Lea Verou | |
*/ | |
@keyframes rot { | |
from { | |
transform: rotate(0deg) | |
translate(-150px) | |
rotate(0deg); |