From 7ebb51e14a8099976f7bbfe6b6d6c56a28fd2e95 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 12 Jan 2023 22:47:14 -0500 Subject: feat: add chris --- src/js/chrisApp.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/js/chrisApp.js (limited to 'src/js') 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); -- cgit v1.2.3