summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/Nav.astro10
-rw-r--r--src/pages/index.astro2
-rw-r--r--src/scripts/chrisApp.ts24
3 files changed, 34 insertions, 2 deletions
diff --git a/src/components/Nav.astro b/src/components/Nav.astro
index b3baf19..70f07ea 100644
--- a/src/components/Nav.astro
+++ b/src/components/Nav.astro
@@ -1,5 +1,13 @@
---
-const links = {
+interface Links {
+ home: string,
+ blog: string,
+ forgejo: string,
+ grafana: string,
+ github: string,
+};
+
+const links: Links = {
home: "/",
blog: "/blog",
forgejo: "https://git.mydadleft.me",
diff --git a/src/pages/index.astro b/src/pages/index.astro
index c127916..cbf7d69 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -6,7 +6,7 @@ const description = title;
---
<Index title={title} description={description}>
- <script type="module" src="/js/chrisApp.js"></script>
+ <script src="../scripts/chrisApp.ts"></script>
<h1 class="bg-base w-fit h-fit mx-auto rounded p-5 text-text">
<b>getchoo's website 🚀</b>
</h1>
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) : {};