Skip to content

Instantly share code, notes, and snippets.

@m-allanson
Last active December 21, 2015 14:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m-allanson/6317903 to your computer and use it in GitHub Desktop.
Save m-allanson/6317903 to your computer and use it in GitHub Desktop.
Paste into the console of a modern web browser.
var content = '@-webkit-keyframes rotate { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(359deg); } } @keyframes rotate { from { -webkit-transform: rotate(0deg); -moz-transform: rotate(0deg); -ms-transform: rotate(0deg); -o-transform: rotate(0deg); transform: rotate(0deg); } to { -webkit-transform: rotate(359deg); -moz-transform: rotate(359deg); -ms-transform: rotate(359deg); -o-transform: rotate(359deg); transform: rotate(359deg); } } .dizzy { -webkit-animation-name: rotate; -moz-animation-name: rotate; -ms-animation-name: rotate; -o-animation-name: rotate; animation-name: rotate; -webkit-animation-duration: 0.8s; -moz-animation-duration: 0.8s; -ms-animation-duration: 0.8s; -o-animation-duration: 0.8s; animation-duration: 0.8s; -webkit-animation-iteration-count: infinite; -moz-animation-iteration-count: infinite; -ms-animation-iteration-count: infinite; -o-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-animation-timing-function: linear; -moz-animation-timing-function: linear; -ms-animation-timing-function: linear; -o-animation-timing-function: linear; animation-timing-function: linear; }';
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = content;
document.getElementsByTagName('head')[0].appendChild(style);
matches = document.querySelectorAll('p, ul, li, img, h1, h2, h3, h4, h5, input, pre');
Array.prototype.forEach.call(matches, function(el){el.classList.add('dizzy');});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment