diff options
| author | seth <[email protected]> | 2023-12-20 20:27:18 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-21 02:34:37 +0000 |
| commit | 5aa2e6c0c6e4c73d93307e9f70803237006afb28 (patch) | |
| tree | f26a67452e2d4a4ed30506e533ac17cc95184fac /src/public/js | |
| parent | 2a6f22fc1f1939b102fb8925bf04914a4b553e17 (diff) | |
go back to lume
Diffstat (limited to 'src/public/js')
| -rw-r--r-- | src/public/js/chrisApp.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/public/js/chrisApp.js b/src/public/js/chrisApp.js new file mode 100644 index 0000000..eb78cfa --- /dev/null +++ b/src/public/js/chrisApp.js @@ -0,0 +1,30 @@ +const chrisURL = "/imgs/chris/"; + +function randomChris() { + const files = [ + "chis_very_fried.jpg", + "chris_medium_fried.jpg", + "chris_moshed.jpg", + "fried_publisher.jpg", + "help_me.png", + "nice_chris.png", + "nice_publisher.png", + "bkender_bauob.jpg", + "blurry_chris.jpg", + ]; + + // this chooses a random file from the array + const url = chrisURL + files[Math.floor(Math.random() * files.length)]; + + window.location.href = url; +} + +function findChris() { + const chris = document.getElementById("chris_gif"); + chris + ? chris.addEventListener("click", randomChris) + : console.warn("Couldn't load chris app!"); +} + +// avoiding a race condition here +setTimeout(findChris, 1000); |
