this post was submitted on 04 Oct 2024
472 points (99.0% liked)

196

16396 readers
2001 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS
472
compruleter (lemmy.ml)
submitted 3 weeks ago* (last edited 3 weeks ago) by [email protected] to c/[email protected]
 

Keep it silly though

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 3 weeks ago

Console cheat codes

Intermittent You're Wrong

let k = 1;setInterval(() => { var h = document.getElementsByTagName("h" + k)[0];k = k == 1 ? 6 : 1;let nh = document.createElement("h" + k);nh.textContent = h.textContent;h.replaceWith(nh) }, 500);

DVD You're Wrong

let b = document.getElementsByTagName("body")[0];b.style.background = "#000";b.style.height = "100vh";let t = document.getElementsByClassName("col")[0]; let xa = 1; let ya = 1;let x = 0, y = 0;t.classList.remove("col");t.style.position = "absolute";setInterval(() => { var bp = b.getBoundingClientRect();var w = bp.width;var h = bp.height;if (x > w || x < 0) xa = x > w ? -1 : 1; if (y > h || y < 0) ya = y > h ? -1 : 1;x += xa;y += ya;t.style.top = y + "px";t.style.left = x + "px"; }, 5);t.style.transition = "color 1s";let fc = () => { return parseInt(Math.random() * 155) + 101; };let c = () => { return "rgb(" + fc() + "," + fc() + "," + fc() + ")"; };setInterval(() => { t.style.color = c() }, 1000);

I gotta say that I loved the DVD result