Last active
April 7, 2017 06:37
-
-
Save jandahl/2bc405e5a1d8d7d6f8a7226723ae1ddd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
javascript: (function(n, t) { | |
t['true'] = n; | |
var i = function(n, t, i) { | |
var r = n.style; | |
r.webkitTransition = r.transition = i + 's'; | |
r.webkitTransitionTimingFunction = r.TransitionTimingFunction = 'ease-in-out'; | |
r.webkitTransform = r.Transform = 'translate3d(0, ' + -t + 'px, 0)' | |
}; | |
var r = function() { | |
var n = [].slice.call(arguments); | |
var t = n.shift(), | |
i = n.shift(), | |
r = n; | |
setTimeout(function() { i.apply(null, r) }, t * 1e3) | |
}; | |
var e = function(n, t, i, e) { r(t, o, i, e) }; | |
var a = document.getElementsByTagName('body')[0]; | |
var o = i.bind(null, a); | |
var s = e.bind(null, a); | |
var l = function(n) { | |
var t = 'Enter delay (in seconds), distance to scroll (in pixels) and the scroll duration (in seconds).\n\nRun the script a second time with options 0 0 0 to reset the page.\n\nExample:\n\n1 800 5'; | |
if (n) { t = n + '\n\n' + t } | |
var i = prompt(t); | |
if (i === null) { | |
return } | |
if (/\d{1,} \d{1,} \d{1,}/.test(i)) { | |
return i.split(' ') } | |
return l('Woops. Input invalid: ' + i) | |
}; | |
var u = function() { | |
var n = l(); | |
if (n) { s.apply(null, n) } | |
}; | |
u() | |
})({}, function() { | |
return this }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment