diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index a1b4a71..dd51c97 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -4,74 +4,71 @@ import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; import SiteBackgroundSlot from "@/components/ui/SiteBackgroundSlot"; import { Outlet } from 'react-router-dom'; import { StyleProvider } from "@/components/ui/StyleProvider"; +import { useEffect, useState } from 'react'; export default function Layout() { - const navItems = [ - { - "name": "الرئيسية", "href": "/" - }, - { - "name": "خدماتنا", "href": "#services" - }, - { - "name": "فريقنا", "href": "#team" - }, - { - "name": "تواصل معنا", "href": "#contact" - }, - { - "name": "Hero", "href": "#hero" - }, - { - "name": "Features", "href": "#features" - }, - { - "name": "Metrics", "href": "#metrics" - } -]; + const [locale, setLocale] = useState('en'); + + useEffect(() => { + const savedLocale = localStorage.getItem('locale') || 'en'; + setLocale(savedLocale); + document.documentElement.dir = savedLocale === 'ar' ? 'rtl' : 'ltr'; + document.documentElement.lang = savedLocale; + }, []); + + useEffect(() => { + const handleLangToggle = (e: MouseEvent) => { + const target = e.target as HTMLElement; + const link = target.closest('a'); + if (link && link.getAttribute('href') === '#toggle-lang') { + e.preventDefault(); + const newLocale = locale === 'en' ? 'ar' : 'en'; + localStorage.setItem('locale', newLocale); + setLocale(newLocale); + document.documentElement.dir = newLocale === 'ar' ? 'rtl' : 'ltr'; + document.documentElement.lang = newLocale; + window.dispatchEvent(new Event('storage')); + } + }; + document.addEventListener('click', handleLangToggle); + return () => document.removeEventListener('click', handleLangToggle); + }, [locale]); + + const navItems = locale === 'en' ? [ + { "name": "Home", "href": "/" }, + { "name": "Services", "href": "#services" }, + { "name": "Team", "href": "#team" }, + { "name": "Contact", "href": "#contact" } + ] : [ + { "name": "الرئيسية", "href": "/" }, + { "name": "خدماتنا", "href": "#services" }, + { "name": "فريقنا", "href": "#team" }, + { "name": "تواصل معنا", "href": "#contact" } + ]; return ( + logo={locale === 'en' ? "Innovation Makers" : "صُنّاع الابتكار"} + ctaButton={{ + text: locale === 'en' ? "ع" : "EN", + href: "#toggle-lang" + }} + navItems={navItems} + />
+ brand={locale === 'en' ? "Innovation Makers" : "صُنّاع الابتكار"} + copyright={locale === 'en' ? "© 2026 Innovation Makers. All rights reserved." : "© 2026 صُنّاع الابتكار. جميع الحقوق محفوظة."} + columns={[]} + links={[]} + />
); diff --git a/src/components/ui/NavbarCentered.tsx b/src/components/ui/NavbarCentered.tsx index e962956..2ea980c 100644 --- a/src/components/ui/NavbarCentered.tsx +++ b/src/components/ui/NavbarCentered.tsx @@ -7,7 +7,7 @@ import Button from "@/components/ui/Button"; interface NavbarCenteredProps { logo: string; navItems: { name: string; href: string }[]; - ctaButton: { text: string; href: string }; + ctaButton: { text: string; href: string; onClick?: (e: any) => void }; } const handleNavClick = (e: React.MouseEvent, href: string, onClose?: () => void) => { diff --git a/src/index.css b/src/index.css index 432a689..cee288d 100644 --- a/src/index.css +++ b/src/index.css @@ -5,15 +5,15 @@ :root { /* @colorThemes/lightTheme/grayNavyBlue */ - --background: #0a0a0a; - --card: #1a1a1a; - --foreground: #f8f5ffe6; - --primary-cta: #c89bff; - --primary-cta-text: #0a0a0a; - --secondary-cta: #1a1a1a; - --secondary-cta-text: #f8f5ffe6; - --accent: #737373; - --background-accent: #737373; + --background: #ffffff; + --card: #f5f5f5; + --foreground: #0a0a0a; + --primary-cta: #F7BA33; + --primary-cta-text: #ffffff; + --secondary-cta: #CD1C58; + --secondary-cta-text: #ffffff; + --accent: #7A3C94; + --background-accent: #7A3C94; /* @layout/border-radius/rounded */ --radius: 0.5rem; diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index 2f46402..d0ae821 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -1,239 +1,27 @@ -import ContactSplitForm from '@/components/sections/contact/ContactSplitForm'; -import FeaturesArrowCards from '@/components/sections/features/FeaturesArrowCards'; -import HeroSplitVerticalMarquee from '@/components/sections/hero/HeroSplitVerticalMarquee'; -import MetricsMediaCards from '@/components/sections/metrics/MetricsMediaCards'; -import TeamStackedCards from '@/components/sections/team/TeamStackedCards'; -import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; +// AUTO-GENERATED shell by per-section-migrate. +// Section bodies live in .//sections/.tsx. Edit the section +// files directly. Non-block content (wrappers, non-inlinable sections) is +// preserved inline; extracted section blocks become refs. -export default function HomePage() { +import React from 'react'; +import HeroSection from './HomePage/sections/Hero'; +import FeaturesSection from './HomePage/sections/Features'; +import TeamSection from './HomePage/sections/Team'; +import MetricsSection from './HomePage/sections/Metrics'; +import ContactSection from './HomePage/sections/Contact'; + +export default function HomePage(): React.JSX.Element { return ( - <> -
- - - -
+<> + -
- - - -
+ -
- - - -
+ -
- - - -
+ -
- - - -
+ ); } diff --git a/src/pages/HomePage/sections/Contact.tsx b/src/pages/HomePage/sections/Contact.tsx new file mode 100644 index 0000000..1e7c973 --- /dev/null +++ b/src/pages/HomePage/sections/Contact.tsx @@ -0,0 +1,48 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "contact" section. + +import React from 'react'; +import ContactSplitForm from '@/components/sections/contact/ContactSplitForm'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function ContactSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Features.tsx b/src/pages/HomePage/sections/Features.tsx new file mode 100644 index 0000000..e50b810 --- /dev/null +++ b/src/pages/HomePage/sections/Features.tsx @@ -0,0 +1,62 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "features" section. + +import React from 'react'; +import FeaturesArrowCards from '@/components/sections/features/FeaturesArrowCards'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function FeaturesSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Hero.tsx b/src/pages/HomePage/sections/Hero.tsx new file mode 100644 index 0000000..4e0c996 --- /dev/null +++ b/src/pages/HomePage/sections/Hero.tsx @@ -0,0 +1,68 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "hero" section. + +import React from 'react'; +import HeroSplitVerticalMarquee from '@/components/sections/hero/HeroSplitVerticalMarquee'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function HeroSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Metrics.tsx b/src/pages/HomePage/sections/Metrics.tsx new file mode 100644 index 0000000..4af9f12 --- /dev/null +++ b/src/pages/HomePage/sections/Metrics.tsx @@ -0,0 +1,52 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "metrics" section. + +import React from 'react'; +import MetricsMediaCards from '@/components/sections/metrics/MetricsMediaCards'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function MetricsSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Team.tsx b/src/pages/HomePage/sections/Team.tsx new file mode 100644 index 0000000..e0a5ccd --- /dev/null +++ b/src/pages/HomePage/sections/Team.tsx @@ -0,0 +1,47 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "team" section. + +import React from 'react'; +import TeamStackedCards from '@/components/sections/team/TeamStackedCards'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function TeamSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +}