Added Release Page

This commit is contained in:
Glitch (t404null-unstable)
2025-07-02 23:31:56 +00:00
parent 5dd9fde4f4
commit dac3f16141
2 changed files with 92 additions and 23 deletions

View File

@@ -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 = "";
/*
<div class="release-track" style="
background-image: url(https://cdn.glitch.global/f594d6b7-e72e-477c-b5cb-d71abbd39f44/oblitus-requiem.png);
background-size: cover;
background-position: center;
">
<div class="text-box">
<h1 class="title">
<strong>Insert Title here</strong>
</h1>
(Raw Context here)
</div>
</div>
*/
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
@@ -131,11 +193,12 @@ function pg_ctrl() {
button.textContent = "•"; //&bull; not &middot;
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();
});
}
}

View File

@@ -1,15 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>t404:null | Home</title>
<meta name="description" content="Hello there! I'm t404:null (a.k.a t404owo).
I write/make/produce EDM music(DTM), and for every releases I'll post my music on this website. If you have any requests or questions, feel free contact me." />
<link rel="icon" type="image/x-icon" href="https://cdn.glitch.global/2d9e31c1-a947-46cd-9fd2-8c92be70abe2/t404_null%20Icon.png" />
<title>t404:null</title>
<meta
name="description"
content="Hello there! I'm t404:null (a.k.a t404owo).
I write/make/produce EDM music(DTM), and for every releases I'll post my music on this website. If you have any requests or questions, feel free contact me."
/>
<link
rel="icon"
type="image/x-icon"
href="https://cdn.glitch.global/2d9e31c1-a947-46cd-9fd2-8c92be70abe2/t404_null%20Icon.png"
/>
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="/assets/css/main.css" />
<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
<script>
eruda.init();
</script>
</head>
<body>
<nav>
@@ -197,8 +205,7 @@ I write/make/produce EDM music(DTM), and for every releases I'll post my music o
<div class="container">
<div class="carousel">
<div class="slider-bg"></div>
<div class="slider" id="pages">
</div>
<div class="slider" id="pages"></div>
<div class="control">
<span class="prev">&lt;</span>
<span class="next">&gt;</span>
@@ -212,16 +219,15 @@ I write/make/produce EDM music(DTM), and for every releases I'll post my music o
<h1 class="topic">
<a href="/release">Releases (Click for more)</a>
</h1>
<div class="album-cards">
</div>
<div class="album-cards"></div>
<hr />
<h1 class="topic">
<a href="/activity">Activities</a>
</h1>
<div class="half-image-cards">
</div>
<div class="half-image-cards"></div>
</main>
<script src="/assets/js/index.js" type="module"></script>
<div class="footer">&copy; t404:null 2021-2024 - All Rights Reserved</div>
</body>
<script src="/assets/js/index.js" type="module"></script>
</html>