diff --git a/src/components/sections/CinematicHorizontalScrollSection.tsx b/src/components/sections/CinematicHorizontalScrollSection.tsx index 22326ee..32111c4 100644 --- a/src/components/sections/CinematicHorizontalScrollSection.tsx +++ b/src/components/sections/CinematicHorizontalScrollSection.tsx @@ -2,7 +2,7 @@ import React, { useRef, useState, useEffect } from 'react'; import Link from 'next/link'; -import { Sparkles, ArrowRight, Smartphone, Zap, Shield, Layers } from 'lucide-react'; +import { Sparkles, ArrowRight, Smartphone } from 'lucide-react'; import { Cinematic3DComparison } from '@/components/ui/Cinematic3DComparison'; interface ShowcaseCard { @@ -76,57 +76,76 @@ const showcaseCards: ShowcaseCard[] = [ export function CinematicHorizontalScrollSection() { const containerRef = useRef(null); const trackRef = useRef(null); - const [scrollProgress, setScrollProgress] = useState(0); + const bgTextRef = useRef(null); + const progressBarRef = useRef(null); + const progressTextRef = useRef(null); useEffect(() => { let rafId: number; + let targetX = 0; + let currentX = 0; + let isTracking = true; - const handleScroll = () => { - if (!containerRef.current || !trackRef.current) return; - const rect = containerRef.current.getBoundingClientRect(); - const totalScrollable = containerRef.current.offsetHeight - window.innerHeight; + // High-precision lerp animation loop (eliminates CSS transition conflicts for butter-smooth 120 FPS glide) + const updateMotion = () => { + if (!isTracking) return; - if (totalScrollable <= 0) return; + if (containerRef.current && trackRef.current) { + const rect = containerRef.current.getBoundingClientRect(); + const totalScrollable = containerRef.current.offsetHeight - window.innerHeight; - // Calculate progress 0 to 1 - const progress = Math.min(Math.max(-rect.top / totalScrollable, 0), 1); - setScrollProgress(progress); + if (totalScrollable > 0) { + const rawProgress = Math.min(Math.max(-rect.top / totalScrollable, 0), 1); + const maxTranslate = trackRef.current.scrollWidth - window.innerWidth; - // Translate track horizontally - const maxTranslate = trackRef.current.scrollWidth - window.innerWidth; - if (maxTranslate > 0) { - trackRef.current.style.transform = `translate3d(-${progress * maxTranslate}px, 0, 0)`; + if (maxTranslate > 0) { + targetX = rawProgress * maxTranslate; + } + + // Smooth exponential damping (lerp factor 0.085) + currentX += (targetX - currentX) * 0.085; + + // Apply 100% GPU compositor transform without CSS transition lag + trackRef.current.style.transform = `translate3d(-${currentX.toFixed(2)}px, 0, 0)`; + + // Parallax 3D background typography ribbon drifting in opposite perspective + if (bgTextRef.current) { + bgTextRef.current.style.transform = `translate3d(-${(currentX * 0.4).toFixed(2)}px, 0, 0) rotateX(10deg)`; + } + + // Update Progress Indicator directly in DOM (zero React re-renders) + const liveProgress = Math.min(Math.max(currentX / (maxTranslate || 1), 0), 1); + if (progressBarRef.current) { + progressBarRef.current.style.width = `${Math.max(liveProgress * 100, 4).toFixed(1)}%`; + } + if (progressTextRef.current) { + progressTextRef.current.textContent = `PROGRESS ${Math.round(liveProgress * 100)}%`; + } + + // 3D Perspective rotational offset on individual cards + const cards = trackRef.current.children; + const screenCenter = window.innerWidth / 2; + + for (let i = 0; i < cards.length; i++) { + const card = cards[i] as HTMLElement; + const cardRect = card.getBoundingClientRect(); + const cardCenter = cardRect.left + cardRect.width / 2; + const dist = (cardCenter - screenCenter) / (window.innerWidth * 0.6); + const rotY = Math.max(Math.min(dist * -8, 14), -14); + const scale = Math.max(1 - Math.abs(dist) * 0.04, 0.94); + + card.style.transform = `perspective(1200px) rotateY(${rotY.toFixed(2)}deg) scale3d(${scale.toFixed(3)}, ${scale.toFixed(3)}, 1)`; + } + } } + + rafId = requestAnimationFrame(updateMotion); }; - const onScroll = () => { - cancelAnimationFrame(rafId); - rafId = requestAnimationFrame(handleScroll); - }; - - window.addEventListener('scroll', onScroll, { passive: true }); - window.addEventListener('touchmove', onScroll, { passive: true }); - window.addEventListener('resize', onScroll, { passive: true }); - handleScroll(); - - let boundLenis: any = null; - const bindLenisInterval = setInterval(() => { - const lenis = (window as any).lenis; - if (lenis && typeof lenis.on === 'function') { - boundLenis = lenis; - lenis.on('scroll', onScroll); - clearInterval(bindLenisInterval); - } - }, 50); + rafId = requestAnimationFrame(updateMotion); return () => { - clearInterval(bindLenisInterval); - window.removeEventListener('scroll', onScroll); - window.removeEventListener('touchmove', onScroll); - window.removeEventListener('resize', onScroll); - if (boundLenis && typeof boundLenis.off === 'function') { - boundLenis.off('scroll', onScroll); - } + isTracking = false; cancelAnimationFrame(rafId); }; }, []); @@ -135,18 +154,29 @@ export function CinematicHorizontalScrollSection() {
{/* Sticky Fullscreen Camera Viewport */} -
- {/* Background Subtle Ambient Gradients */} -
-
+
+ {/* Massive 3D Kinetic Background Typography Ribbon (Parallax Drift) */} + - {/* Section Top Header & Navigation Telemetry */} + {/* Ambient Subtle Gradients */} +
+
+ + {/* Section Top Header & Navigation Telemetry with 3D Depth */}
-
-
+
+
HORIZONTAL 3D CINEMATIC ARCHIVE
@@ -156,32 +186,32 @@ export function CinematicHorizontalScrollSection() {
- + SCROLL DOWN TO PAN HORIZONTALLY -
+
- PROGRESS {Math.round(scrollProgress * 100)}% + PROGRESS 0%
- {/* Horizontal Sliding Filmstrip Track */} + {/* Horizontal Sliding Filmstrip Track (Zero CSS transition conflicts, 100% hardware GPU translation) */}
- {showcaseCards.map((card, idx) => ( + {showcaseCards.map((card) => (
- {/* Card Top Metadata Bar */} -
+ {/* Card Top Metadata Bar (translateZ 30px) */} +
{card.index} @@ -209,17 +239,29 @@ export function CinematicHorizontalScrollSection() { />
- {/* Card Editorial Info */} -
-

+ {/* Card 3D Stereoscopic Typography Stack */} +
+ {/* Headline at translateZ 45px */} +

{card.title}

-

+ + {/* Description at translateZ 25px */} +

{card.description}

- {/* Specs Chips */} -
+ {/* Specs Chips at translateZ 35px */} +
{card.specs.map((spec, i) => ( - {/* Actions */} -
+ {/* Actions at translateZ 50px */} +
diff --git a/src/components/sections/HeroSection.tsx b/src/components/sections/HeroSection.tsx index 32c6f05..f0aaa8d 100644 --- a/src/components/sections/HeroSection.tsx +++ b/src/components/sections/HeroSection.tsx @@ -7,6 +7,7 @@ import { resolveLocalised, ToolItem, AppItem, VariantSpec } from '@/types'; import { TryItWidget } from './TryItWidget'; import { TiltCard } from '@/components/ui/TiltCard'; import { Hero3DCanvas } from '@/components/3d/Hero3DCanvas'; +import { Kinetic3DText } from '@/components/ui/Kinetic3DText'; interface HeroSectionProps { title?: any; @@ -43,6 +44,17 @@ export function HeroSection({
+ {/* Subtle Massive 3D Background Typographic Watermark (Enigma Style) */} + + {/* 3D Ambient Kinetic Prism Floating Behind Header */}
@@ -61,23 +73,17 @@ export function HeroSection({ {resolvedBadge}
)} -
+
VOL. 26 // NEURAL STUDIO
- {/* Main Headline with Editorial Kerning and Fluid Scale */} -

- Transform Photos with
- - Next-Gen Neural AI - -

- - {/* Subtitle with Refined Editorial Measure */} -

- {resolvedSubtitle} -

+ {/* 3D Kinetic Interactive Typography */} +
{/* Embedded Interactive Free Try-It Widget wrapped with 3D Tilt Card */} diff --git a/src/components/ui/Kinetic3DText.tsx b/src/components/ui/Kinetic3DText.tsx new file mode 100644 index 0000000..d902945 --- /dev/null +++ b/src/components/ui/Kinetic3DText.tsx @@ -0,0 +1,108 @@ +'use client'; + +import React, { useState, useRef, useEffect } from 'react'; + +interface Kinetic3DTextProps { + primaryText: string; + highlightText?: string; + subtitle?: string; + className?: string; +} + +export function Kinetic3DText({ + primaryText, + highlightText, + subtitle, + className = '', +}: Kinetic3DTextProps) { + const [tilt, setTilt] = useState({ rx: 0, ry: 0, active: false }); + const containerRef = useRef(null); + + useEffect(() => { + let rafId: number; + let targetRx = 0; + let targetRy = 0; + let currentRx = 0; + let currentRy = 0; + + const handleMouseMove = (e: MouseEvent) => { + if (!containerRef.current) return; + const rect = containerRef.current.getBoundingClientRect(); + const centerX = rect.left + rect.width / 2; + const centerY = rect.top + rect.height / 2; + + // Normalized coordinates -1 to +1 + const nx = (e.clientX - centerX) / (window.innerWidth * 0.5); + const ny = (e.clientY - centerY) / (window.innerHeight * 0.5); + + targetRy = Math.max(Math.min(nx * 10, 12), -12); + targetRx = Math.max(Math.min(-ny * 8, 10), -10); + }; + + const updateLoop = () => { + // Smooth inertial lerp + currentRx += (targetRx - currentRx) * 0.1; + currentRy += (targetRy - currentRy) * 0.1; + + if (containerRef.current) { + containerRef.current.style.transform = `rotateX(${currentRx.toFixed(2)}deg) rotateY(${currentRy.toFixed(2)}deg)`; + } + + rafId = requestAnimationFrame(updateLoop); + }; + + window.addEventListener('mousemove', handleMouseMove, { passive: true }); + rafId = requestAnimationFrame(updateLoop); + + return () => { + window.removeEventListener('mousemove', handleMouseMove); + cancelAnimationFrame(rafId); + }; + }, []); + + return ( +
+ {/* 3D Stereoscopic Kinetic Text Stage */} +
+ {/* Layer 1: Ambient 3D Text Holographic Depth Shadow */} + + + {/* Layer 2: Main Floating 3D Headline */} +

+ {primaryText}
+ {highlightText && ( + + + {highlightText} + + + )} +

+ + {/* Layer 3: Elevated Subtitle */} + {subtitle && ( +

+ {subtitle} +

+ )} +
+
+ ); +}