'use client'; import { useScroll, useTransform, motion } from 'framer-motion'; import { ReactNode, useEffect, useState } 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(); // Dynamically load personas from the pricing API so any admin-added attire shows here const [attireItems, setAttireItems] = useState<{ label: string; id: string }[]>([ { label: 'Kandura', id: 'emarati-kandura' }, { label: 'Vest', id: 'industrial-vest' }, { label: 'Suit', id: 'business-suit' }, ]); useEffect(() => { fetch('/api/admin/pricing/') .then((r) => r.json()) .then((data) => { const excluded = new Set(['base', 'custom-color', 'emarati-kandura', 'industrial-vest', 'business-suit']); const extras: { label: string; id: string }[] = (data.items ?? []) .filter((item: { id: string; label: string; modelPath?: string | null }) => !excluded.has(item.id) && item.modelPath ) .map((item: { id: string; label: string }) => ({ label: item.label, id: item.id })); setAttireItems([ { label: 'Kandura', id: 'emarati-kandura' }, { label: 'Vest', id: 'industrial-vest' }, { label: 'Suit', id: 'business-suit' }, ...extras, ]); }) .catch(() => {}); }, []); 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.

{attireItems.map((item) => (
{ import('@/store/useConfigStore').then(({ configStore }) => { configStore.getState().setPersonaAttire(item.id); }); }} onMouseEnter={() => { import('@/store/useConfigStore').then(({ configStore }) => { configStore.getState().setPersonaAttire(item.id); }); }} style={{ padding: '0.6rem 1.25rem', borderRadius: '2rem', background: 'rgba(255, 255, 255, 0.5)', border: '1px solid rgba(39, 63, 148, 0.3)', fontSize: '0.75rem', color: '#0a0a0c', letterSpacing: '0.1em', fontWeight: 600, cursor: 'pointer', transition: 'all 0.3s ease', boxShadow: '0 4px 12px rgba(0,0,0,0.05)', pointerEvents: 'auto', userSelect: 'none', WebkitTapHighlightColor: 'transparent', }} onMouseOver={(e) => { e.currentTarget.style.background = 'var(--color-gold)'; e.currentTarget.style.color = '#ffffff'; e.currentTarget.style.transform = 'translateY(-2px)'; e.currentTarget.style.boxShadow = '0 6px 16px rgba(39, 63, 148, 0.3)'; }} onMouseOut={(e) => { e.currentTarget.style.background = 'rgba(255, 255, 255, 0.5)'; e.currentTarget.style.color = '#0a0a0c'; e.currentTarget.style.transform = 'translateY(0)'; e.currentTarget.style.boxShadow = '0 4px 12px rgba(0,0,0,0.05)'; }} > {item.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
{/* Scroll indicator mapped to vanish rapidly when scrolled */} Scroll to Explore
); }