aboutsummaryrefslogtreecommitdiff
path: root/static/src
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-08-24 13:03:50 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-08-24 13:03:56 -0700
commit5dc264e08253c3a97ea41d1fde5fbf3f33dd6591 (patch)
tree0db325e5e280176702263d28817c371abce050db /static/src
parent6f374aac7f4d553c484eecc77c9599be79f2d834 (diff)
downloadkennel.hatecomputers.club-5dc264e08253c3a97ea41d1fde5fbf3f33dd6591.tar.gz
kennel.hatecomputers.club-5dc264e08253c3a97ea41d1fde5fbf3f33dd6591.zip
bring in jQuery, build with Vite
Diffstat (limited to 'static/src')
-rw-r--r--static/src/main.ts18
-rw-r--r--static/src/style.css3
-rw-r--r--static/src/vite-env.d.ts1
3 files changed, 22 insertions, 0 deletions
diff --git a/static/src/main.ts b/static/src/main.ts
new file mode 100644
index 0000000..8d12587
--- /dev/null
+++ b/static/src/main.ts
@@ -0,0 +1,18 @@
+import $ from "jquery";
+
+$(document).ready(async () => {
+ await fetch("/assign", {
+ credentials: "include",
+ });
+
+ const ws = new WebSocket("/ws");
+ ws.onopen = () => {
+ console.log("connected");
+ };
+ ws.onmessage = ({ data }) => {
+ console.log(JSON.parse(data));
+ };
+ ws.onclose = (e) => {
+ console.log("disconnected", e);
+ };
+});
diff --git a/static/src/style.css b/static/src/style.css
new file mode 100644
index 0000000..adc68fa
--- /dev/null
+++ b/static/src/style.css
@@ -0,0 +1,3 @@
+h1 {
+ color: red;
+}
diff --git a/static/src/vite-env.d.ts b/static/src/vite-env.d.ts
new file mode 100644
index 0000000..11f02fe
--- /dev/null
+++ b/static/src/vite-env.d.ts
@@ -0,0 +1 @@
+/// <reference types="vite/client" />