Last active
April 13, 2016 15:43
-
-
Save bmwalters/3695d12eac2061f6e29930d7c4fb91ff to your computer and use it in GitHub Desktop.
shift+p to activate
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
// ==UserScript== | |
// @name Rotato Potato | |
// @namespace zerf | |
// @description Yep | |
// @include * | |
// @version 1.3 | |
// @downloadURL https://gist.github.com/zerfgog/3695d12eac2061f6e29930d7c4fb91ff/raw/master/rotatopotato.user.js | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js | |
// ==/UserScript== | |
var scriptString = "\ | |
<style>\ | |
html {\ | |
-webit-animation: rotatopotato 4s alternate infinite;\ | |
animation: rotatopotato 4s alternate infinite;\ | |
}\ | |
\ | |
@keyframes rotatopotato {\ | |
from { transform: rotate(-45deg); }\ | |
to { transform: rotate(45deg); }\ | |
}\ | |
\ | |
@-webkit-keyframes rotatopotato {\ | |
from { transform: rotate(-45deg); }\ | |
to { transform: rotate(45deg); }\ | |
}\ | |
</style>\ | |
" | |
var $script | |
$(document).keypress(function(e) { | |
if (e.shiftKey && e.which == 80) { | |
if ($script && $script.length) { | |
$script.remove(); | |
$script = null | |
} else { | |
$script = $(scriptString).appendTo("head"); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment