diff --git a/404.html b/404.html index 7a739fb..bb522f7 100644 --- a/404.html +++ b/404.html @@ -31,7 +31,7 @@ -
  • Lebensweg
  • + @@ -39,6 +39,12 @@ + + +
  • Lebensweg
  • + + +
  • Rollen
  • @@ -106,13 +112,7 @@ -
  • - - - merge - - -
  • + @@ -126,6 +126,18 @@ + + +
  • + + + merge + + +
  • + + +
  • @@ -138,30 +150,33 @@ - - - + + document.querySelectorAll("button").forEach(button => { + const href = button.getAttribute("data-href"); + if (!href) return; + button.addEventListener("click", () => { + window.location.href = button.getAttribute("data-href"); + }); + }); + diff --git a/assets/js/service-worker.js b/assets/js/service-worker.js index 78c197a..1cf14d4 100644 --- a/assets/js/service-worker.js +++ b/assets/js/service-worker.js @@ -1,6 +1,7 @@ const CACHE_NAME = "cyberpunk-cache-v1"; const OFFLINE_URL = "/offline.html"; // Diese Seite wird angezeigt, wenn offline const BASE_PATH = "/cpred/"; +const SITEMAP_URL = BASE_PATH + "sitemap.json"; const urlsToCache = [ BASE_PATH, @@ -30,7 +31,9 @@ const urlsToCache = [ BASE_PATH + "/assets/game-data/characters/carver.json", ]; -// Installations-Event: Dateien werden in den Cache geladen +/** + * Install-Event: Cache Standarddateien + */ self.addEventListener("install", (event) => { event.waitUntil( caches.open(CACHE_NAME).then((cache) => { @@ -39,18 +42,45 @@ self.addEventListener("install", (event) => { ); }); -// Fetch-Event: Prüft, ob eine Datei im Cache ist, bevor sie aus dem Netz geladen wird +/** + * Fetch-Event: Cache-First Strategie mit Offline-Fallback + */ self.addEventListener("fetch", (event) => { event.respondWith( caches.match(event.request).then((response) => { return response || fetch(event.request).catch(() => { - return caches.match(OFFLINE_URL); // Falls offline, lade offline.html + return caches.match(OFFLINE_URL); }); }) ); }); -// Aktivierungs-Event: Löscht alten Cache, wenn sich Dateien geändert haben +/** + * Wenn die Startseite geladen wird, lade automatisch alle Seiten aus der Sitemap in den Cache + */ +self.addEventListener("sync", (event) => { + if (event.tag === "cache-all-pages") { + event.waitUntil( + fetch(SITEMAP_URL) + .then((response) => response.json()) + .then((data) => { + return caches.open(CACHE_NAME).then((cache) => { + return Promise.all( + data.pages.map((page) => { + return fetch(page.url) + .then((response) => cache.put(page.url, response)) + .catch((err) => console.error("Fehler beim Cachen:", err)); + }) + ); + }); + }) + ); + } +}); + +/** + * Aktivierungs-Event: Löscht alten Cache + */ self.addEventListener("activate", (event) => { event.waitUntil( caches.keys().then((cacheNames) => { diff --git a/characters/chase.html b/characters/chase.html new file mode 100644 index 0000000..bb314de --- /dev/null +++ b/characters/chase.html @@ -0,0 +1,222 @@ + + + + + +Chase Révolte - ThePhoenixDivision + + + + + + + + + + + + + + +
    + + + +
    + +
    +

    Chase Révolte

    +
    + +
    + +
    + +
    +

    + Straßenname: + +

    +

    + Alter: + +

    +

    + Rolle: + +

    +

    + Rollenfähigkeit: + +

    +

    + Unterkunft: + +

    +

    + Lebensstil: + +

    +

    + Lebenskosten: + +

    +
    +
    +

    Test

    + + + + + +
    + + + + + + + diff --git a/characters/index.html b/characters/index.html index 38f85e5..7b79af5 100644 --- a/characters/index.html +++ b/characters/index.html @@ -31,7 +31,7 @@ -
  • Lebensweg
  • + @@ -39,6 +39,12 @@ + + +
  • Lebensweg
  • + + +
  • Rollen
  • @@ -109,13 +115,7 @@ -
  • - - - merge - - -
  • + @@ -129,6 +129,18 @@ + + +
  • + + + merge + + +
  • + + +
  • @@ -141,30 +153,33 @@ - - - + + document.querySelectorAll("button").forEach(button => { + const href = button.getAttribute("data-href"); + if (!href) return; + button.addEventListener("click", () => { + window.location.href = button.getAttribute("data-href"); + }); + }); + diff --git a/feed.xml b/feed.xml index 5ad8990..a38b3d2 100644 --- a/feed.xml +++ b/feed.xml @@ -1 +1 @@ -Jekyll2025-03-20T08:35:12+00:00https://phoenixdivision.morlana.space/cpred/feed.xmlThePhoenixDivisionWe will share our adventures in Cyberpunk Red here. \ No newline at end of file +Jekyll2025-03-20T10:46:33+00:00https://phoenixdivision.morlana.space/cpred/feed.xmlThePhoenixDivisionWe will share our adventures in Cyberpunk Red here. \ No newline at end of file diff --git a/index.html b/index.html index df66566..4f437f2 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@ -
  • Lebensweg
  • + @@ -39,6 +39,12 @@ + + +
  • Lebensweg
  • + + +
  • Rollen
  • @@ -80,13 +86,7 @@ -
  • - - - merge - - -
  • + @@ -100,6 +100,18 @@ + + +
  • + + + merge + + +
  • + + +
  • @@ -112,30 +124,33 @@ - - - + + document.querySelectorAll("button").forEach(button => { + const href = button.getAttribute("data-href"); + if (!href) return; + button.addEventListener("click", () => { + window.location.href = button.getAttribute("data-href"); + }); + }); + diff --git a/lifepaths/index.html b/lifepaths/index.html index d719785..d300c50 100644 --- a/lifepaths/index.html +++ b/lifepaths/index.html @@ -31,7 +31,7 @@ -
  • Lebensweg
  • + @@ -39,6 +39,12 @@ + + +
  • Lebensweg
  • + + +
  • Rollen
  • @@ -68,7 +74,7 @@

    Lebensweg

    - - - - + + document.querySelectorAll("button").forEach(button => { + const href = button.getAttribute("data-href"); + if (!href) return; + button.addEventListener("click", () => { + window.location.href = button.getAttribute("data-href"); + }); + }); + diff --git a/players-guide/index.html b/players-guide/index.html index a15c0c6..9eee3fd 100644 --- a/players-guide/index.html +++ b/players-guide/index.html @@ -31,7 +31,7 @@ -
  • Lebensweg
  • + @@ -39,6 +39,12 @@ + + +
  • Lebensweg
  • + + +
  • Rollen
  • @@ -87,13 +93,7 @@ -
  • - - - merge - - -
  • + @@ -107,6 +107,18 @@ + + +
  • + + + merge + + +
  • + + +
  • @@ -119,30 +131,33 @@ - - - + + document.querySelectorAll("button").forEach(button => { + const href = button.getAttribute("data-href"); + if (!href) return; + button.addEventListener("click", () => { + window.location.href = button.getAttribute("data-href"); + }); + }); + diff --git a/players-guide/netrunner.html b/players-guide/netrunner.html new file mode 100644 index 0000000..96c4ad6 --- /dev/null +++ b/players-guide/netrunner.html @@ -0,0 +1,172 @@ + + + + + +Netrunner Guide - ThePhoenixDivision + + + + + + + + + + + + + + +
    + + + +
    + +
    +

    Netrunner Guide

    +

    TBD

    + + +
    + + + + + + + diff --git a/players-guide/tech.html b/players-guide/tech.html new file mode 100644 index 0000000..df20f9a --- /dev/null +++ b/players-guide/tech.html @@ -0,0 +1,172 @@ + + + + + +Tech Guide - ThePhoenixDivision + + + + + + + + + + + + + + +
    + + + +
    + +
    +

    Tech Guide

    +

    TBD

    + + +
    + + + + + + + diff --git a/roles/index.html b/roles/index.html index 461bc87..297af76 100644 --- a/roles/index.html +++ b/roles/index.html @@ -31,7 +31,7 @@ -
  • Lebensweg
  • + @@ -39,6 +39,12 @@ + + +
  • Lebensweg
  • + + +
  • Rollen
  • @@ -87,13 +93,7 @@ -
  • - - - merge - - -
  • + @@ -107,6 +107,18 @@ + + +
  • + + + merge + + +
  • + + +
  • @@ -119,30 +131,33 @@ - - - + + document.querySelectorAll("button").forEach(button => { + const href = button.getAttribute("data-href"); + if (!href) return; + button.addEventListener("click", () => { + window.location.href = button.getAttribute("data-href"); + }); + }); + diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..52ee3a9 --- /dev/null +++ b/sitemap.json @@ -0,0 +1,19 @@ +{ + "pages": [ + + { "url": "/cpred/characters/" }, + + { "url": "/cpred/characters/chase" }, + + { "url": "/cpred/lifepaths/" }, + + { "url": "/cpred/players-guide/netrunner" }, + + { "url": "/cpred/players-guide/" }, + + { "url": "/cpred/roles/" }, + + { "url": "/cpred/players-guide/tech" } + + ] +}