diff options
| author | seth <[email protected]> | 2023-05-20 02:33:17 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-05-20 02:33:58 -0400 |
| commit | d0ad2e5d16f62c9a45dafc3eacc814a3b9013d08 (patch) | |
| tree | 9f28500ce0407126597e987db44c681cabe7abe9 /src/scripts/chrisApp.ts | |
| parent | 63c4f174c849a41eb0c2b5fc7470151dd1f0277c (diff) | |
rewrite everything in typescript
Diffstat (limited to 'src/scripts/chrisApp.ts')
| -rw-r--r-- | src/scripts/chrisApp.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/scripts/chrisApp.ts b/src/scripts/chrisApp.ts new file mode 100644 index 0000000..9a9dc0c --- /dev/null +++ b/src/scripts/chrisApp.ts @@ -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 ? chris.addEventListener("click", randomChris) : {}; |
