'use client'; import { useScroll, useTransform, motion } from 'framer-motion'; import { ReactNode } from 'react'; import Link from 'next/link'; interface SectionProps { children: ReactNode; progress: any; startAt: number; peakAt: number; endAt: number; align: 'center' | 'left' | 'right'; verticalAlign?: 'top' | 'center' | 'bottom'; offsetY?: number; className?: string; } function OverlaySection({ children, progress, startAt, peakAt, endAt, align, verticalAlign = 'center', offsetY = 50, className = '', }: SectionProps) { // Define a wide "plateau" zone where the text is fully readable and static. // We use 30% of the travel distance for fading in, 30% for fading out. const diffIn = peakAt - startAt; const diffOut = endAt - peakAt; const inStart = startAt; const inEnd = startAt + diffIn * 0.4; // Fades in quickly const outStart = endAt - diffOut * 0.6; // Holds for a long time const outEnd = endAt; // Smooth fade in and out mapping over a lengthy plateau const opacity = useTransform( progress, [inStart, inEnd, outStart, outEnd], [0, 1, 1, 0] ); // Translate Y to slide in, pause entirely while reading, slide out const y = useTransform( progress, [inStart, inEnd, outStart, outEnd], [offsetY, 0, 0, -offsetY] ); // Scale stays at 1.0 during reading mode const scale = useTransform( progress, [inStart, inEnd, outStart, outEnd], [0.95, 1, 1, 1.05] ); const alignStyle: React.CSSProperties = align === 'left' ? { alignItems: 'flex-start' } : align === 'right' ? { alignItems: 'flex-end' } : { left: '50%', transform: 'translateX(-50%)', alignItems: 'center' }; const alignClass = align === 'left' ? 'overlay-section-left' : align === 'right' ? 'overlay-section-right' : 'overlay-section-center'; const verticalStyle: React.CSSProperties = verticalAlign === 'top' ? { top: '15vh' } : verticalAlign === 'bottom' ? { bottom: '15vh', top: 'auto' } : { top: '50%' }; // Glass panel appearance for side text to not clash with the robot const isCenter = align === 'center'; const panelStyle: React.CSSProperties = isCenter ? { textAlign: 'center' } : { background: 'rgba(255, 255, 255, 0.92)', backdropFilter: 'blur(20px)', WebkitBackdropFilter: 'blur(20px)', boxShadow: '0 8px 32px rgba(0, 0, 0, 0.08)', border: '1px solid rgba(255, 255, 255, 0.6)', textAlign: align === 'left' ? 'left' : 'right', }; return ( {children} ); } // Section timing definitions to match ScrollScene camera moves const SECTION_CONFIGS = [ { id: 'brand', startAt: 0, peakAt: 0.05, endAt: 0.15, align: 'center' as const, verticalAlign: 'top' as const }, { id: 'hero', startAt: 0.10, peakAt: 0.22, endAt: 0.35, align: 'left' as const, verticalAlign: 'center' as const }, { id: 'headReveal', startAt: 0.35, peakAt: 0.46, endAt: 0.53, align: 'right' as const, verticalAlign: 'center' as const }, { id: 'customization', startAt: 0.55, peakAt: 0.66, endAt: 0.77, align: 'left' as const, verticalAlign: 'center' as const }, { id: 'mobility', startAt: 0.75, peakAt: 0.82, endAt: 0.90, align: 'right' as const, verticalAlign: 'center' as const }, ]; export function ScrollOverlays() { const { scrollYProgress } = useScroll(); return (
{/* 1. Brand Intro */}
YS Lootah Robotics

Pioneering Humanoid Robotics in the UAE

{/* 2. Hero */} The Future of Robotics

Meet the G1 Humanoid Robot. Fully customizable, enterprise-ready, designed for the world of tomorrow.

{/* 3. Head Reveal */}
Intelligent by Design

Vision That
Understands

Advanced computer vision and neural processing. The G1 sees, interprets, and responds to the world in real-time.

360°
Field of View
{'<'}50ms
Response Time
{/* 4. Customization */}
Your Identity

Dress for Any
Mission

From traditional Emarati Kandura to industrial safety gear and professional business attire. Configure every detail to match your brand.

{['Kandura', 'Vest', 'Suit'].map((label) => (
{label}
))}
{/* 5. Mobility */}
Advanced Mobility

23 Degrees of
Freedom

State-of-the-art locomotion enabling natural human-like movement, balance, and agility across any terrain.

2m/s
Max Speed
127kg
Payload
{/* Configure CTA — appears at the very end of scroll */}
Configure Your G1 Build & Order Your Robot
{/* Scroll indicator mapped to vanish rapidly when scrolled */} Scroll to Explore
); }