Skip to content

Instantly share code, notes, and snippets.

@bmwalters
Last active April 13, 2016 15:43
Show Gist options
  • Save bmwalters/3695d12eac2061f6e29930d7c4fb91ff to your computer and use it in GitHub Desktop.
Save bmwalters/3695d12eac2061f6e29930d7c4fb91ff to your computer and use it in GitHub Desktop.
shift+p to activate
// ==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