diff --git a/public/custom/auto-player.js b/public/custom/auto-player.js index 9b9df51..aa99b34 100644 --- a/public/custom/auto-player.js +++ b/public/custom/auto-player.js @@ -3,6 +3,7 @@ // Ersetzt die scroll-gesteuerte Variante. Spec: 2026-06-17-tiefenflug-auto-player-design.md (function () { 'use strict'; + if ('scrollRestoration' in history) history.scrollRestoration = 'manual'; if (typeof window === 'undefined' || !window.requestAnimationFrame) return; document.documentElement.classList.remove('kein-js'); @@ -45,6 +46,10 @@ if (['ArrowDown', 'ArrowUp', 'Space', 'PageDown', 'PageUp', 'Home', 'End'].indexOf(e.code) >= 0) e.preventDefault(); } + function mausBewegen(e) { + mausX = (e.clientX / window.innerWidth - 0.5) * 2; // -1..1 + mausY = (e.clientY / window.innerHeight - 0.5) * 2; + } function beenden() { if (beendet) return; beendet = true; @@ -54,6 +59,7 @@ window.removeEventListener('wheel', sperren, false); window.removeEventListener('touchmove', sperren, false); window.removeEventListener('keydown', sperreTasten, false); + window.removeEventListener('mousemove', mausBewegen, false); if (skipBtn) skipBtn.hidden = true; } @@ -121,7 +127,7 @@ window.innerHeight / preisBild.offsetHeight) * 1.02; preisBild.style.transform = 'scale(' + lerp(1.0, sMax, e) + ')'; } - if (verlauf) verlauf.style.opacity = lerp(0, 0.6, e); + if (verlauf) verlauf.style.opacity = clamp01(lerp(0, 0.6, e)); if (preisText) preisText.style.opacity = 1 - e; } // Phase Landung (30.0 – 33.0): Bühne fährt nach unten, Bühne + Vollbild aus. @@ -151,11 +157,9 @@ if (img && img.naturalHeight > img.naturalWidth) f.classList.add('hochformat'); }); if (window.matchMedia('(pointer: fine)').matches) { - window.addEventListener('mousemove', function (e) { - mausX = (e.clientX / window.innerWidth - 0.5) * 2; // -1..1 - mausY = (e.clientY / window.innerHeight - 0.5) * 2; - }); + window.addEventListener('mousemove', mausBewegen); } + if (window.scrollY > 0) window.scrollTo(0, 0); document.body.style.overflow = 'hidden'; window.addEventListener('wheel', sperren, false); window.addEventListener('touchmove', sperren, false); diff --git a/public/custom/transitions.js b/public/custom/transitions.js index ab71205..8a7f882 100644 --- a/public/custom/transitions.js +++ b/public/custom/transitions.js @@ -108,7 +108,7 @@ /* ---------- 4b) Dock einblenden beim Scrollen - ohne Intro (Unterseiten): ab scrollY > 200 sichtbar - mit Intro (Startseite): ausgeblendet, bis html.intro-beendet gesetzt - ist (siehe tiefenflug.js) – dann sofort sichtbar. ---------- */ + ist (siehe auto-player.js) – dann sofort sichtbar. ---------- */ var dock = document.getElementById("dock"); var hatIntro = document.querySelector(".flug-strecke"); if (dock && !hatIntro) {