diff options
Diffstat (limited to 'src/js/chrisApp.js')
| -rw-r--r-- | src/js/chrisApp.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/js/chrisApp.js b/src/js/chrisApp.js new file mode 100644 index 0000000..bf51176 --- /dev/null +++ b/src/js/chrisApp.js @@ -0,0 +1,23 @@ +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; +} + +var chris = document.getElementById("chris_gif"); +chris.addEventListener("click", randomChris); |
