tweaked UI, added landing page

This commit is contained in:
2026-10-09 15:21:44 -07:00
parent 11b56b21b6
commit f5a9457622
9 changed files with 2350 additions and 2055 deletions

View File

@@ -18,14 +18,8 @@ var SITE_TREE = [
{
id: "vyla",
title: "Vyla",
path: "/",
path: "/start-here/introduction",
groups: [
{
title: "Welcome",
items: [
{ title: "Who Are We", file: "/start-here/who-are-we.md", path: "/start-here/who-are-we" }
]
},
{
title: "Start here",
items: [
@@ -794,6 +788,48 @@ function navigateTo(path) {
}
function loadPage() {
var path = window.location.pathname.replace(/\/+$/, "") || "/";
var isHome = path === "/";
document.body.classList.toggle("is-home", isHome);
var contentEl = document.getElementById("main-content");
if (isHome) {
document.title = "Vyla Entertainment — Vyla";
renderNavTabs(SITE_TREE[0]);
if (contentEl) {
contentEl.classList.remove("content-animate", "caught-up");
fetch("/home.txt")
.then(function (res) {
if (!res.ok) throw new Error();
return res.text();
})
.then(function (html) {
contentEl.innerHTML = html;
window.scrollTo(0, 0);
})
.catch(function () {
contentEl.innerHTML = "<h1>Home</h1><p>Create /home.txt to customize this page.</p>";
});
}
var tocList = document.getElementById("toc-list");
if (tocList) tocList.innerHTML = "";
var prevBtn = document.getElementById("footer-prev");
var nextBtn = document.getElementById("footer-next");
if (prevBtn) prevBtn.classList.add("hidden");
if (nextBtn) nextBtn.classList.add("hidden");
var sidebar = document.getElementById("sidebar");
if (sidebar && sidebar.classList.contains("open")) {
sidebar.classList.remove("open");
document.body.classList.remove("nav-open");
}
return;
}
var route = resolveRoute(window.location.pathname);
renderNavTabs(route.tab);
renderSidebar(route.tab, route.item);