'use client' import { useEffect, useRef } from 'react' import { gsap } from 'gsap' import { ScrollTrigger } from 'gsap/ScrollTrigger' import { animateSplit } from '@/lib/animateSplit' import ParallaxLayer from './ParallaxLayer' import MagneticButton from './MagneticButton' import Image from 'next/image' if (typeof window !== 'undefined') { gsap.registerPlugin(ScrollTrigger) } export default function ScrollHero() { const heroRef = useRef(null) const titleRef = useRef(null) const subtitleRef = useRef(null) const scrollHintRef = useRef(null) useEffect(() => { const hero = heroRef.current const title = titleRef.current const subtitle = subtitleRef.current const scrollHint = scrollHintRef.current if (!hero || !title || !subtitle || !scrollHint) return // Check for reduced motion const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches const ctx = gsap.context(() => { // Initial setup gsap.set([title, subtitle, scrollHint], { opacity: 0 }) if (prefersReducedMotion) { // Simple fade in for reduced motion const tl = gsap.timeline({ delay: 0.5 }) tl.to(title, { opacity: 1, y: 0, duration: 0.8, ease: 'power2.out' }) .to(subtitle, { opacity: 1, y: 0, duration: 0.6, ease: 'power2.out' }, '-=0.4') .to(scrollHint, { opacity: 1, duration: 0.4 }, '-=0.2') } else { // Full animation const tl = gsap.timeline({ delay: 0.8 }) tl.add(() => { gsap.set(title, { opacity: 1 }) animateSplit(title, { stagger: 0.02, duration: 1 }) }) .to(subtitle, { opacity: 1, y: 0, duration: 0.8, ease: 'power2.out' }, '-=0.5') .to(scrollHint, { opacity: 1, duration: 0.6, ease: 'power2.out' }, '-=0.3') // Scroll hint animation gsap.to(scrollHint, { y: 10, duration: 1.5, ease: 'power2.inOut', yoyo: true, repeat: -1 }) // Hero parallax on scroll gsap.to(hero, { yPercent: -50, ease: 'none', scrollTrigger: { trigger: hero, start: 'top top', end: 'bottom top', scrub: true } }) } }, hero) return () => ctx.revert() }, []) return (
{/* Background layers */}
{/* Noise texture */}
{/* Parallax background elements */}
{/* Hero image */}
Michael Peskov performing magic
{/* Content */}

Magic That
Mesmerizes

Experience the wonder of modern magic with Michael Peskov. From intimate close-up performances to grand stage illusions, every moment is crafted to leave your audience spellbound.

Book a Show Watch Showreel
{/* Scroll hint */}
Scroll to explore
) }