Fix iframe recursion and remove all localStorage/cookies site-wide

- Add target="_top" to all ← SPACE / back-to-root links so navigating
  back to index.html breaks out of the content iframe instead of loading
  it recursively inside itself (Images, Music, Watchlists hubs)
- Remove all localStorage usage: visited-star tracking in index.html
  (resets each visit, no persistence without storage), and lightbox
  "show once" guards in all section pages (lightboxes now show on every
  load — Videos, Watchlists, Music). build.py templates updated so
  future generated pages stay clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-28 16:03:17 +02:00
parent 1e776bee83
commit c1a7098ebe
17 changed files with 17 additions and 59 deletions

View File

@@ -203,7 +203,7 @@
<body>
<header>
<h1>Images</h1>
<a href="../index.html" class="nav-back">← Back to Space</a>
<a href="../index.html" class="nav-back" target="_top">← Back to Space</a>
</header>
<main>

View File

@@ -99,10 +99,7 @@ def build_lightbox_html(text: str, slug: str) -> tuple[str, str]:
js = f"""
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('music-{slug}-seen')) {{
lightbox.style.display = 'flex';
localStorage.setItem('music-{slug}-seen', '1');
}}
lightbox.style.display = 'flex';
const closeLightbox = () => {{ lightbox.style.display = 'none'; }};
lightbox.addEventListener('click', (e) => {{
if (e.target === lightbox) closeLightbox();

View File

@@ -143,7 +143,7 @@
</head>
<body>
<header>
<a href="../index.html" class="back-link">← SPACE</a>
<a href="../index.html" class="back-link" target="_top">← SPACE</a>
<h1>MUSIC</h1>
<!-- SUBTITLE-START --><span class="subtitle">1 COLLECTION · PERSONAL ARCHIVE · 14 TRACKS</span><!-- SUBTITLE-END -->
</header>

View File

@@ -535,10 +535,7 @@
document.addEventListener('DOMContentLoaded', () => {
// --- Lightbox ---
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('music-oldmusicandmvs-seen')) {
lightbox.style.display = 'flex';
localStorage.setItem('music-oldmusicandmvs-seen', '1');
}
lightbox.style.display = 'flex';
const closeLightbox = () => { lightbox.style.display = 'none'; };

View File

@@ -555,10 +555,7 @@
document.addEventListener('DOMContentLoaded', () => {
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('music-oldmusicandmvs-seen')) {
lightbox.style.display = 'flex';
localStorage.setItem('music-oldmusicandmvs-seen', '1');
}
lightbox.style.display = 'flex';
const closeLightbox = () => { lightbox.style.display = 'none'; };
lightbox.addEventListener('click', (e) => {
if (e.target === lightbox) closeLightbox();

View File

@@ -342,13 +342,10 @@
function closeGate() {
const gate = document.getElementById('welcome-gate');
gate.classList.remove('active');
localStorage.setItem('cringe_pit_visited', 'true');
}
document.addEventListener('DOMContentLoaded', () => {
if (!localStorage.getItem('cringe_pit_visited')) {
document.getElementById('welcome-gate').classList.add('active');
}
document.getElementById('welcome-gate').classList.add('active');
});
</script>
</body>

View File

@@ -403,13 +403,10 @@
function closeGate() {
const gate = document.getElementById('welcome-gate');
gate.classList.remove('active');
localStorage.setItem('nomad_visited', 'true');
}
document.addEventListener('DOMContentLoaded', () => {
if (!localStorage.getItem('nomad_visited')) {
document.getElementById('welcome-gate').classList.add('active');
}
document.getElementById('welcome-gate').classList.add('active');
});
</script>
</body>

View File

@@ -397,13 +397,10 @@
function closeGate() {
const gate = document.getElementById('welcome-gate');
gate.classList.remove('active');
localStorage.setItem('renegade_visited', 'true');
}
document.addEventListener('DOMContentLoaded', () => {
if (!localStorage.getItem('renegade_visited')) {
document.getElementById('welcome-gate').classList.add('active');
}
document.getElementById('welcome-gate').classList.add('active');
});
</script>
</body>

View File

@@ -420,10 +420,7 @@
// Lightbox: show on first load
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('watchlist-analogfrontier-seen')) {
lightbox.style.display = 'flex';
localStorage.setItem('watchlist-analogfrontier-seen', '1');
}
lightbox.style.display = 'flex';
function closeLightbox() { lightbox.style.display = 'none'; }

View File

@@ -84,12 +84,8 @@ def build_lightbox_html(text: str, slug: str) -> tuple[str, str]:
</div>"""
js = f"""
// Lightbox: show on first load
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('watchlist-{slug}-seen')) {{
lightbox.style.display = 'flex';
localStorage.setItem('watchlist-{slug}-seen', '1');
}}
lightbox.style.display = 'flex';
function closeLightbox() {{ lightbox.style.display = 'none'; }}

View File

@@ -438,10 +438,7 @@
// Lightbox: show on first load
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('watchlist-contentaddictionarchive-seen')) {
lightbox.style.display = 'flex';
localStorage.setItem('watchlist-contentaddictionarchive-seen', '1');
}
lightbox.style.display = 'flex';
function closeLightbox() { lightbox.style.display = 'none'; }

View File

@@ -420,10 +420,7 @@
// Lightbox: show on first load
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('watchlist-culturaldecay-seen')) {
lightbox.style.display = 'flex';
localStorage.setItem('watchlist-culturaldecay-seen', '1');
}
lightbox.style.display = 'flex';
function closeLightbox() { lightbox.style.display = 'none'; }

View File

@@ -402,10 +402,7 @@
// Lightbox: show on first load
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('watchlist-lastcinema-seen')) {
lightbox.style.display = 'flex';
localStorage.setItem('watchlist-lastcinema-seen', '1');
}
lightbox.style.display = 'flex';
function closeLightbox() { lightbox.style.display = 'none'; }

View File

@@ -438,10 +438,7 @@
// Lightbox: show on first load
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('watchlist-soundscapeanomalies-seen')) {
lightbox.style.display = 'flex';
localStorage.setItem('watchlist-soundscapeanomalies-seen', '1');
}
lightbox.style.display = 'flex';
function closeLightbox() { lightbox.style.display = 'none'; }

View File

@@ -447,10 +447,7 @@
// Lightbox: show on first load
const lightbox = document.getElementById('lightbox');
if (!localStorage.getItem('watchlist-caa-seen')) {
lightbox.style.display = 'flex';
localStorage.setItem('watchlist-caa-seen', '1');
}
lightbox.style.display = 'flex';
function closeLightbox() {
lightbox.style.display = 'none';

View File

@@ -192,7 +192,7 @@
<body>
<header>
<a href="../index.html" class="back-link">← SPACE</a>
<a href="../index.html" class="back-link" target="_top">← SPACE</a>
<h1>WATCHLISTS</h1>
<!-- SUBTITLE-START --><div class="subtitle">5 COLLECTIONS · CURATED VIDEO ARCHIVES · 36 PLAYLISTS</div><!-- SUBTITLE-END -->
</header>

View File

@@ -762,7 +762,7 @@ body::after {
var writingsLightboxShown = false;
var currentWritingIndex = 0;
var writingElements = [];
var visited = JSON.parse(localStorage.getItem('sp-visited') || '{}');
var visited = {};
var starElements = [];
var srAnnounce = document.getElementById('sr-announce');
var backBtn = document.getElementById('back-btn');
@@ -1154,14 +1154,12 @@ body::after {
// Writings star activates the writings sub-map instead of rising a frame
if (star.id === 'writings') {
visited[star.id] = true;
localStorage.setItem('sp-visited', JSON.stringify(visited));
starElements[index].classList.add('visited');
selectWritingsSection();
return;
}
visited[star.id] = true;
localStorage.setItem('sp-visited', JSON.stringify(visited));
starElements[index].classList.add('visited');
starElements.forEach(function (el) { el.classList.remove('current'); });
starElements[index].classList.add('current');