diff options
| author | Ryan Cao <[email protected]> | 2023-03-17 20:17:52 +0800 |
|---|---|---|
| committer | Ryan Cao <[email protected]> | 2023-03-17 20:17:52 +0800 |
| commit | 0adf1cf9a2fc3fb6e270f67166c44a587a477dc5 (patch) | |
| tree | fa930fe2cfa93719aee0989e86e048522dc32535 /src/js | |
| parent | d8288926ca67105487529fd4156e0879936d371e (diff) | |
some refactors
Diffstat (limited to 'src/js')
| -rw-r--r-- | src/js/chrisApp.js | 30 |
1 files changed, 15 insertions, 15 deletions
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); |
