"use client" import { Nav } from "@/components/nav"; import { Translations } from "@/i18n/translations"; import { cn } from "@/lib/utils"; import { ReactElement, useEffect, useRef } from "react"; import { useTheme } from "./providers"; function Section({ id, title, paragraphs }: { id: string title: string; paragraphs: ReactElement; }) { return (

{title}

{paragraphs}
) } function getSource({ src, type }: { src: string; type: 'mp4' | 'webm' | 'ogv' }) { const sourceType = `video/${type}` return [ , , , , , , ]; } function Video({ sourceBase, hidden }: { sourceBase: string; hidden: boolean; }) { const videoRef = useRef(null); useEffect(() => { const handleScroll = () => { if (!videoRef.current || hidden) return; videoRef.current.play(); const scrolled = window.scrollY; videoRef.current.style.willChange = "transform"; videoRef.current.style.transform = `translateY(${scrolled * 0.5}px)`; videoRef.current.style.willChange = "unset"; }; const throttledHandleScroll = () => { requestAnimationFrame(handleScroll); }; window.addEventListener("scroll", throttledHandleScroll); handleScroll(); return () => window.removeEventListener("scroll", throttledHandleScroll); }, [hidden]); const sources = [...getSource({ src: sourceBase, type: 'mp4' }), ...getSource({ src: sourceBase, type: 'ogv' }), ...getSource({ src: sourceBase, type: 'webm' })] return ( ); } export default function LandingPage( { t }: { t: Translations } ) { const { theme } = useTheme() return (
) }