Created
September 9, 2018 23:24
-
-
Save offalynne/9950d95f14a4c130036414f1c536e342 to your computer and use it in GitHub Desktop.
Bookmarklet for keyboard-navigable gallery view of `Canvas Cycle` by Mark Ferrari and Joseph Huckaby @ effectgames.com/demos/canvascycle
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(){ | |
CC.setBlendShift(!1); | |
CC.setZoom(!1); | |
function q(e) { return document.querySelector(e).style }; | |
if (q("#d_options").display != "none") | |
CC.toggleOptions(); | |
["header", "footer", "options"].forEach(function(e) { | |
q("#d_"+e).opacity = 0; | |
}); | |
c = q("#mycanvas"); | |
c.transform = "scale(2)"; | |
c.imageRendering = "pixelated"; | |
c.transformOrigin = "center"; | |
f = function() { CC.jumpScene(1) }; | |
for (var i = Math.floor(Math.random() * 34); i > 0; i -= 1) window.f(); | |
t = window.setInterval(f, 40000); | |
document.body.onkeyup = function(e) { | |
window.clearInterval(t); | |
t = window.setInterval(f, 40000); | |
n = parseInt(c.transform.substr(6)); | |
k = e.keyCode; | |
if (k == 38) c.transform = "scale(" + (n + 1) + ")"; | |
if (k == 40) c.transform = "scale(" + (Math.max(n - 1, 1)) + ")"; | |
if (k == 39) window.f(); | |
if (k == 37) CC.jumpScene(-1); | |
if (k == 27) location.reload() | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment