import React, { useState, useEffect, useRef } from 'react'; import Hero from './components/Hero'; import Infrastructure from './components/Infrastructure'; import Science from './components/Science'; import Social from './components/Social'; import Leadership from './components/Leadership'; import Metrics from './components/Metrics'; import Scaling from './components/Scaling'; import Team from './components/Team'; import Timeline from './components/Timeline'; import BootAnimation from './components/BootAnimation'; import Modal from './components/Modal'; import { ModalData } from './types'; // import TechVisualizer from './components/TechVisualizer'; // Disabled per user request import { ArrowUp } from 'lucide-react'; import { motion, AnimatePresence } from 'framer-motion'; const App: React.FC = () => { const [isBooting, setIsBooting] = useState(true); const [showScrollTop, setShowScrollTop] = useState(false); const [modalData, setModalData] = useState(null); const scrollContainerRef = useRef(null); // Theme and Scroll Logic useEffect(() => { const container = scrollContainerRef.current; if (!container) return; const handleScroll = () => { const scrollY = container.scrollTop; const windowHeight = window.innerHeight; const leadershipSection = document.getElementById('leadership'); // Block 4 const teamSection = document.getElementById('team'); // --- Theme Logic: Light mode starting from Leadership (Block 4) --- if (leadershipSection && teamSection) { // We use offsetTop relative to the container usually, but since sections are stacked // and container scrolls, standard offsetTop works if container is relative/static. const leadershipTrigger = leadershipSection.offsetTop - windowHeight * 0.6; const teamTrigger = teamSection.offsetTop - windowHeight * 0.8; // Active Light Mode for Leadership, Metrics, Scaling. Back to Dark for Team. if (scrollY >= leadershipTrigger && scrollY < teamTrigger) { document.body.classList.add('theme-light'); } else { document.body.classList.remove('theme-light'); } } if (scrollY > 300) setShowScrollTop(true); else setShowScrollTop(false); }; container.addEventListener('scroll', handleScroll); handleScroll(); // Trigger once on load return () => { container.removeEventListener('scroll', handleScroll); document.body.classList.remove('theme-light'); }; }, [isBooting]); const scrollToTop = () => { if (scrollContainerRef.current) { scrollContainerRef.current.scrollTo({ top: 0, behavior: 'smooth' }); } }; const handleOpenModal = (data: ModalData) => { setModalData(data); }; const handleCloseModal = () => { setModalData(null); }; const handleContactClick = () => { handleOpenModal({ title: 'Связь с разработчиком', type: 'form', theme: 'dark', // Keep header interaction dark themed typically content: { text: 'Оставьте свои контакты, и мы свяжемся с вами для обсуждения интеграции.' } }); }; return (
{isBooting && setIsBooting(false)} />} {!isBooting && (
{/* Grid Pattern Background */}
{/* Header */} {/* Scroll Container */}
{/* Global Modal */} {modalData && }
)} {showScrollTop && !isBooting && !modalData && ( )}
); }; export default App;