From 0adf1cf9a2fc3fb6e270f67166c44a587a477dc5 Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Fri, 17 Mar 2023 20:17:52 +0800 Subject: some refactors --- src/js/chrisApp.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/js/chrisApp.js') diff --git a/src/js/chrisApp.js b/src/js/chrisApp.js index bf51176..4881b7a 100644 --- a/src/js/chrisApp.js +++ b/src/js/chrisApp.js @@ -1,23 +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", - ]; + 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)]; + // this chooses a random file from the array + const url = chrisURL + files[Math.floor(Math.random() * files.length)]; - window.location.href = url; + window.location.href = url; } -var chris = document.getElementById("chris_gif"); +const chris = document.getElementById("chris_gif"); chris.addEventListener("click", randomChris); -- cgit v1.2.3