Skip to content

Instantly share code, notes, and snippets.

@alicraigmile
Created May 18, 2020 12:48
Show Gist options
  • Save alicraigmile/c3c96fd3d0ae7dc6e2b5f9c098833d0e to your computer and use it in GitHub Desktop.
Save alicraigmile/c3c96fd3d0ae7dc6e2b5f9c098833d0e to your computer and use it in GitHub Desktop.
We lost the twister spinner thingy so I made one we could cast to the telly instead
var bodyParts = ["Left hand βœ‹","Right hand βœ‹", "Left foot 🦢", "Right foot 🦢"];
var colours = ["Green 🍏", "Red 🍎","Yellow 🌻","Blue 🏴󠁧󠁒󠁳󠁣󠁴󠁿"];
var getRandomInt = function(max) {
return Math.floor(Math.random() * Math.floor(max));
}
var clearScreen = function() {
document.open();
document.close();
}
spin = function() {
clearScreen();
document.write('<style>body {background: no-repeat url("https://ae01.alicdn.com/kf/HTB1sb0laP3z9KJjy0Fmq6xiwXXaG.jpg?size=333855&height=652&width=940&hash=4938fb356d012cd39e26da3c5587adac"); background-size: 100% 100%; font-family: "Comic Sans MS"; position: relative} .c { text-align: center; position: absolute; top: 50%; left: 50%; transform: translateY(-50%) translateX(-50%);;font-size: 500%; margin: auto; width: 50%; border: 10px solid lightgrey; padding: 1em; background-color: rgba(255,255,255,0.7)}</style>');
document.write('<div class="c">');
document.write(bodyParts[getRandomInt(bodyParts.length)])
document.write("<br>");
document.write(colours[getRandomInt(colours.length)]);
document.write('</div>');
document.write('<script>document.body.addEventListener("click", spin)</script>');
}
spin();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment