HOME
>
未分類
>
未分類
Hello world!
2026年6月4日
WordPress へようこそ。こちらは最初の投稿です。編集または削除し、コンテンツ作成を始めてください。
-
未分類
document.addEventListener('DOMContentLoaded', function() { // 読み込み時にページ最上部へ強制移動させ、重なりバグを完全リセット window.scrollTo(0, 0); const fvContent = document.getElementById('sanboFvContent'); if (!fvContent) return; let hasScrolled = false; // 初期化:readyクラスを付与してフワッと登場させる setTimeout(() => { fvContent.classList.add('sanbo-fv-ready'); }, 100); // スクロールおよびスワイプイベントの監視 window.addEventListener('wheel', triggerSlashAnimation, { passive: false }); window.addEventListener('touchmove', triggerSlashAnimation, { passive: false }); function triggerSlashAnimation(e) { // 下方向へのスクロール移動を検知した場合 if (!hasScrolled && (e.deltaY > 0 || (e.touches && e.touches[0]))) { // 演出完了まで通常のスクロールを一時停止 if (e.cancelable) e.preventDefault(); hasScrolled = true; // 1. スクロール開始状態(文字分割&一瞬のライン) fvContent.classList.remove('sanbo-fv-ready'); fvContent.classList.add('is-fv-scrolled'); // 2. 0.3秒後、文字が分断されたまま、FV全体が上にスライドして消える(.is-fv-opened) setTimeout(() => { fvContent.classList.add('is-fv-opened'); }, 300); // 3. 0.8秒後、固定ページの先頭セクション(.sanbo-about)へスムーズにスクロール setTimeout(() => { const nextSection = document.querySelector('.sanbo-about'); if (nextSection) { nextSection.scrollIntoView({ behavior: 'smooth' }); } else { // もしクラスがまだ無い場合は、通常のH2ブロックまでスクロール const h2Section = document.querySelector('.entry-content h2'); if (h2Section) h2Section.scrollIntoView({ behavior: 'smooth' }); } // 演出完了後、イベントを完全解放して通常のスクロールに戻す window.removeEventListener('wheel', triggerSlashAnimation); window.removeEventListener('touchmove', triggerSlashAnimation); }, 800); } } });