From 07fa59c8e7697017fb36acc55ec30f101181520c Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 28 May 2025 16:40:54 -0400 Subject: [PATCH] Basic API kind of worked out and solved a bunch of things with alpine.js --- public/alpine_test.html | 1 + public/api/game/1/index.json | 3 ++ public/api/game/index.json | 6 ++++ public/api/live/index.json | 18 +++++++++++ public/api/stream/1/index.json | 29 +++++++++++++----- public/api/stream/index.json | 40 +++++++++++++++++++++++++ public/game/1/turings-tarpit/index.html | 12 +++++--- public/game/index.html | 22 ++++++-------- public/js/code.js | 15 ++++++++++ public/live/index.html | 19 +++++++----- public/stream/1/index.html | 31 ++++++++----------- public/stream/index.html | 14 ++------- 12 files changed, 149 insertions(+), 61 deletions(-) create mode 100644 public/api/game/1/index.json create mode 100644 public/api/game/index.json create mode 100644 public/api/live/index.json create mode 100644 public/js/code.js diff --git a/public/alpine_test.html b/public/alpine_test.html index 8a096c6..a6a81d8 100644 --- a/public/alpine_test.html +++ b/public/alpine_test.html @@ -1,6 +1,7 @@ +

diff --git a/public/api/game/1/index.json b/public/api/game/1/index.json new file mode 100644 index 0000000..dc2e6ce --- /dev/null +++ b/public/api/game/1/index.json @@ -0,0 +1,3 @@ +{"title": "Turing's Tarpit", + "description": "The description.", + "url": "/game/1/turings-tarpit/"} diff --git a/public/api/game/index.json b/public/api/game/index.json new file mode 100644 index 0000000..995f549 --- /dev/null +++ b/public/api/game/index.json @@ -0,0 +1,6 @@ +[ + {"title": "Turing's Tarpit", "url": "/game/1/turings-tarpit/"}, + {"title": "Roguish", "url": "/game/1/turings-tarpit/"}, + {"title": "Raycaster", "url": "/game/1/turings-tarpit/"}, + {"title": "Clicker Loves You", "url": "/game/1/turings-tarpit/"} +] diff --git a/public/api/live/index.json b/public/api/live/index.json new file mode 100644 index 0000000..0c440bc --- /dev/null +++ b/public/api/live/index.json @@ -0,0 +1,18 @@ +{ + "title": "Stream #34: C++ Game Dev|Retro Raycaster|No Brainrot Stream", + "description": "Some kind of stream.", + "links": [ + {"description": "A funky website", + "url": "https://test.com" + }, + {"description": "A funky website", + "url": "https://test.com" + }, + {"description": "A funky website", + "url": "https://test.com" + }, + {"description": "A funky website", + "url": "https://test.com" + } + ] +} diff --git a/public/api/stream/1/index.json b/public/api/stream/1/index.json index bbc7846..eb8d405 100644 --- a/public/api/stream/1/index.json +++ b/public/api/stream/1/index.json @@ -1,7 +1,22 @@ -[ - { - "title": "Sample Stream", - "streamed_on": "10/10/2025", - "description": "Some kind of stream." - } -] +{ + "title": "Stream #34: C++ Game Dev|Retro Raycaster|No Brainrot Stream", + "streamed_on": "10/10/2025", + "description": "Some kind of stream.", + "links": [ + {"description": "A funky website", + "url": "https://test.com" + }, + {"description": "A funky website", + "url": "https://test.com" + }, + {"description": "A funky website", + "url": "https://test.com" + }, + {"description": "A funky website", + "url": "https://test.com" + }, + {"description": "A funky website", + "url": "https://test.com" + } + ] +} diff --git a/public/api/stream/index.json b/public/api/stream/index.json index 8fcce68..3e1b286 100644 --- a/public/api/stream/index.json +++ b/public/api/stream/index.json @@ -1,4 +1,44 @@ [ + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, + { "date": "12/10/2025", + "description": "A great stream.", + "url": "/stream/1/" + }, { "date": "12/10/2025", "description": "A great stream.", "url": "/stream/1/" diff --git a/public/game/1/turings-tarpit/index.html b/public/game/1/turings-tarpit/index.html index d27ab57..8c978be 100644 --- a/public/game/1/turings-tarpit/index.html +++ b/public/game/1/turings-tarpit/index.html @@ -6,10 +6,14 @@ ZedShaw's Game Thing + + + - - +
🏡 Zed's Game Dev Website Yay
@@ -18,12 +22,12 @@ Gameplay Demo Video -

Turing's Tarpit

+

Title

Some Image -

Polaroid retro pork belly yes plz bitters, viral chicharrones typewriter chartreuse vice Brooklyn. Adaptogen pour-over vibecession viral. Tote bag tonx DIY microdosing. Pickled selvage bespoke small batch, blue bottle twee tacos jean shorts before they sold out chicharrones solarpunk. Hoodie taiyaki poutine jianbing chambray.

+

Description

diff --git a/public/game/index.html b/public/game/index.html index 2fbf6c4..fbd073b 100644 --- a/public/game/index.html +++ b/public/game/index.html @@ -6,6 +6,11 @@ ZedShaw's Game Thing + + + @@ -22,19 +27,10 @@
- - Game B - Game A - Game B - Game A - Game B - Game A - Game B - Game A - Game B - Game A - Game B - Game B + + diff --git a/public/js/code.js b/public/js/code.js new file mode 100644 index 0000000..89710df --- /dev/null +++ b/public/js/code.js @@ -0,0 +1,15 @@ + +class GetJson { + constructor(url) { + this.url = url; + this.items = []; + } + + async theData() { + const resp = await fetch(this.url); + console.assert(resp.status == 200, "failed to get it"); + this.items = await resp.json(); + return this.items; + } +} + diff --git a/public/live/index.html b/public/live/index.html index 07ac093..5416c83 100644 --- a/public/live/index.html +++ b/public/live/index.html @@ -6,10 +6,14 @@ ZedShaw's Game Thing + + + - - +
🏡 Zed's Game Dev Website Yay
@@ -22,12 +26,11 @@

Links Found in Chat

-
-
https://somelink.com
-
A funky website
-
https://somelink.com
-
A funky website
-
+
    + +
diff --git a/public/stream/1/index.html b/public/stream/1/index.html index bd7d093..45a4409 100644 --- a/public/stream/1/index.html +++ b/public/stream/1/index.html @@ -6,10 +6,14 @@ ZedShaw's Game Thing + + + - - +
🏡 Zed's Game Dev Website Yay
@@ -17,10 +21,10 @@ -

Stream #34: C++ Game Dev|Retro Raycaster|No Brainrot Stream

+

-

Summary Qui animated corpse, cricket bat max brucks terribilem incessu zomby. The voodoo sacerdos flesh eater, suscitat mortuos comedere carnem virus. Zonbi tattered for solum oculi eorum defunctis go lum cerebro. Nescio brains an Undead zombies. Sicut malus putrid voodoo horror.

+

@@ -31,20 +35,11 @@

Links Posted

-
-
https://somelink.com
-
A funky website
-
https://somelink.com
-
A funky website
-
https://somelink.com
-
A funky website
-
https://somelink.com
-
A funky website
-
https://somelink.com
-
A funky website
-
https://somelink.com
-
A funky website
-
+
    + +
diff --git a/public/stream/index.html b/public/stream/index.html index 06a0e0d..a469777 100644 --- a/public/stream/index.html +++ b/public/stream/index.html @@ -7,17 +7,9 @@ ZedShaw's Game Thing - + @@ -34,7 +26,7 @@ -