diff --git a/index.html b/index.html index 5657e32..9993364 100644 --- a/index.html +++ b/index.html @@ -14,6 +14,9 @@ +
diff --git a/js/tabs.js b/js/tabs.js index 5f0c682..632bcbd 100644 --- a/js/tabs.js +++ b/js/tabs.js @@ -1,12 +1,12 @@ document.addEventListener('DOMContentLoaded', () => { const tabs = document.querySelectorAll('.tab-content'); + const mainVideo = document.getElementById('background-video'); + const calVideo = document.getElementById('calendar-background-video'); // ── Map URL path → tab id ────────────────────────────── function pathToTab(path) { - // strip leading/trailing slashes, default to "about" const slug = path.replace(/^\/+|\/+$/g, '') || 'about'; - // known slugs — everything else falls back to about const valid = ['about', 'gallery', 'ahmet', 'yuukabot', 'calendar']; return valid.includes(slug) ? slug : 'about'; } @@ -15,11 +15,30 @@ document.addEventListener('DOMContentLoaded', () => { return '/' + (tabId === 'about' ? '' : tabId); } + // ── Swap background videos ───────────────────────────── + function setBgForTab(tabId) { + if (!calVideo || !mainVideo) return; + if (tabId === 'calendar') { + // Switch to calendar background + mainVideo.style.display = 'none'; + mainVideo.pause(); + calVideo.style.display = 'block'; + calVideo.play().catch(() => {}); // ignore autoplay blocks + } else { + // Switch back to main background + calVideo.style.display = 'none'; + calVideo.pause(); + mainVideo.style.display = 'block'; + if (mainVideo.paused) mainVideo.play().catch(() => {}); + } + } + // ── Show a specific tab ──────────────────────────────── function showTab(tabId) { tabs.forEach(t => t.style.display = 'none'); const target = document.getElementById(tabId); if (target) target.style.display = 'block'; + setBgForTab(tabId); } // ── Navigate to a tab (updates URL + shows it) ──────── diff --git a/style/styles.css b/style/styles.css index 85b3c48..64b7c40 100644 --- a/style/styles.css +++ b/style/styles.css @@ -16,7 +16,8 @@ html, body { height: 100%; overflow-x: hidden; } -#background-video { +#background-video, +#calendar-background-video { position: fixed; right: 0%; left: 0%; diff --git a/textures/calendar_background.mp4 b/textures/calendar_background.mp4 new file mode 100644 index 0000000..ea353f6 Binary files /dev/null and b/textures/calendar_background.mp4 differ