Skip to content

Instantly share code, notes, and snippets.

View lindsaymasten's full-sized avatar
💃
tracking issues + hunting bugs

Lindsay Masten lindsaymasten

💃
tracking issues + hunting bugs
View GitHub Profile
@3mw-support
3mw-support / Smooth Auto-Scroll Webpage for Screen Capture Videos & Gifs
Created December 20, 2018 18:47
Use this gist if you want to record smooth-scrolling screen capture videos and/or gifs.
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}());