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:
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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'; };
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user