From dac3f161410b6a67c45e77782e541ef167f6db2b Mon Sep 17 00:00:00 2001 From: "Glitch (t404null-unstable)" Date: Wed, 2 Jul 2025 23:31:56 +0000 Subject: [PATCH] Added Release Page --- assets/js/index.js | 81 ++++++++++++++++++++++++++++++++++++++++------ index.html | 34 +++++++++++-------- 2 files changed, 92 insertions(+), 23 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index 8f79514..649da09 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -49,9 +49,71 @@ let highlights = [], let path_name = window.location.pathname; //Start building the page by calling data -if (path_name === "/") build_event(0); -if (path_name === "/" || path_name === "/release") build_event(1); -if (path_name === "/" || path_name === "/activity") build_event(2); +let params = new URLSearchParams(location.search); +if (!params.get("release")) { + if (path_name === "/") { + document.title = "t404:null | Home"; + build_event(0); + } + if (path_name === "/" || path_name === "/release") build_event(1); + if (path_name === "/" || path_name === "/activity") build_event(2); +} else { + let main = document.querySelector("main"); + main.innerHTML = ""; + /* +
+
+

+ Insert Title here +

+ (Raw Context here) +
+
+ */ + let id = params.get("release").replace(/^\//g, ""); + console.log(id); + supabase + .from("events") + .select("title, context, bg_src") + .eq("event_id", id) + .then((d) => { + let res = d.data; + if (res !== null && res.length > 0) { + let _pg = document.createElement("div"), + _box = document.createElement("div"), + _h1 = document.createElement("h1"), + title = document.createElement("strong"), + data = res[0]; + + _pg.classList.add("release-track"); + _pg.style = + "background-image: url(" + + data.bg_src + + ");" + + "background-size: cover;" + + "background-position: center;"; + + _box.classList.add("text-box"); + title.textContent = data.title; + + + main.appendChild(_pg); + _pg.appendChild(_box); + _box.appendChild(_h1); + _h1.appendChild(title); + _box.innerHTML+=data.context; + + document.title = "t404:null | " + data.title; + } else { + main.innerHTML = "404"; + document.title = "t404:null | Not Found"; + } + }); +} // #region Slider section @@ -130,12 +192,13 @@ function pg_ctrl() { let n = i; button.textContent = "•"; //• not · pgctrl.appendChild(button); - - if (pgctrl) button.addEventListener("click", function () { - reset(); - slider_index = n; - set(); - }) + + if (pgctrl) + button.addEventListener("click", function () { + reset(); + slider_index = n; + set(); + }); } } diff --git a/index.html b/index.html index 8a2aeda..c13d3f5 100644 --- a/index.html +++ b/index.html @@ -1,15 +1,23 @@ - t404:null | Home - - + t404:null + + - - +