summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorseth <[email protected]>2023-05-16 03:53:24 -0400
committerseth <[email protected]>2023-05-16 04:08:37 -0400
commit681cd8c1cc2904c562f9a58db3cbb657d58fb552 (patch)
tree9255f71e577fc82f079c16ff493f432ca5557284 /public/js
parentbf4df962be338c08ae41bed94b1d60b2930fca9f (diff)
feat: rewrite with astro
Diffstat (limited to 'public/js')
-rw-r--r--public/js/chrisApp.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/public/js/chrisApp.js b/public/js/chrisApp.js
new file mode 100644
index 0000000..d4d7059
--- /dev/null
+++ b/public/js/chrisApp.js
@@ -0,0 +1,24 @@
+/* eslint no-undef: "off" */
+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;
+}
+
+const chris = document.getElementById("chris_gif");
+chris.addEventListener("click", randomChris);