From 3037eda83708862f8a628afd827101f77856c5c7 Mon Sep 17 00:00:00 2001 From: kudinDmitriyUp Date: Tue, 16 Jun 2026 13:23:27 +0000 Subject: [PATCH] Bob AI: Add 3D scroll effect to the layout wrapper --- src/components/Layout.tsx | 14 +- src/pages/HomePage.tsx | 179 +++---------------- src/pages/HomePage/sections/About.tsx | 22 +++ src/pages/HomePage/sections/Contact.tsx | 27 +++ src/pages/HomePage/sections/Faq.tsx | 34 ++++ src/pages/HomePage/sections/Hero.tsx | 28 +++ src/pages/HomePage/sections/Metrics.tsx | 28 +++ src/pages/HomePage/sections/Services.tsx | 43 +++++ src/pages/HomePage/sections/Testimonials.tsx | 42 +++++ 9 files changed, 258 insertions(+), 159 deletions(-) create mode 100644 src/pages/HomePage/sections/About.tsx create mode 100644 src/pages/HomePage/sections/Contact.tsx create mode 100644 src/pages/HomePage/sections/Faq.tsx create mode 100644 src/pages/HomePage/sections/Hero.tsx create mode 100644 src/pages/HomePage/sections/Metrics.tsx create mode 100644 src/pages/HomePage/sections/Services.tsx create mode 100644 src/pages/HomePage/sections/Testimonials.tsx diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 1e5000a..3d9ff4a 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -4,8 +4,16 @@ 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 { motion, useScroll, useTransform, useSpring, useVelocity } from "motion/react"; export default function Layout() { + const { scrollY } = useScroll(); + const scrollVelocity = useVelocity(scrollY); + const smoothVelocity = useSpring(scrollVelocity, { damping: 50, stiffness: 400 }); + + const rotateX = useTransform(smoothVelocity, [-2000, 2000], [-5, 5]); + const skewY = useTransform(smoothVelocity, [-2000, 2000], [-1, 1]); + const scale = useTransform(smoothVelocity, [-2000, 0, 2000], [0.98, 1, 0.98]); const navItems = [ { "name": "Про нас", @@ -49,8 +57,10 @@ export default function Layout() { }} navItems={navItems} /> -
- +
+ + +
/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 AboutSection from './HomePage/sections/About'; +import ServicesSection from './HomePage/sections/Services'; +import MetricsSection from './HomePage/sections/Metrics'; +import TestimonialsSection from './HomePage/sections/Testimonials'; +import FaqSection from './HomePage/sections/Faq'; +import ContactSection from './HomePage/sections/Contact'; + +export default function HomePage(): React.JSX.Element { return ( - <> -
- - - -
+<> + -
- - - -
+ -
- - - -
+ -
- - - -
+ -
- - - -
+ -
- - - -
+ -
- - - -
+ ); } diff --git a/src/pages/HomePage/sections/About.tsx b/src/pages/HomePage/sections/About.tsx new file mode 100644 index 0000000..4874ade --- /dev/null +++ b/src/pages/HomePage/sections/About.tsx @@ -0,0 +1,22 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "about" section. + +import React from 'react'; +import AboutTextSplit from '@/components/sections/about/AboutTextSplit'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function AboutSection(): 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..358bebe --- /dev/null +++ b/src/pages/HomePage/sections/Contact.tsx @@ -0,0 +1,27 @@ +// 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 ContactCta from '@/components/sections/contact/ContactCta'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function ContactSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Faq.tsx b/src/pages/HomePage/sections/Faq.tsx new file mode 100644 index 0000000..9f983b8 --- /dev/null +++ b/src/pages/HomePage/sections/Faq.tsx @@ -0,0 +1,34 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "faq" section. + +import React from 'react'; +import FaqTwoColumn from '@/components/sections/faq/FaqTwoColumn'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function FaqSection(): 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..7c7b9db --- /dev/null +++ b/src/pages/HomePage/sections/Hero.tsx @@ -0,0 +1,28 @@ +// 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 HeroBillboardBrand from '@/components/sections/hero/HeroBillboardBrand'; +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..e4a889d --- /dev/null +++ b/src/pages/HomePage/sections/Metrics.tsx @@ -0,0 +1,28 @@ +// 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/Services.tsx b/src/pages/HomePage/sections/Services.tsx new file mode 100644 index 0000000..482e589 --- /dev/null +++ b/src/pages/HomePage/sections/Services.tsx @@ -0,0 +1,43 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "services" section. + +import React from 'react'; +import FeaturesBorderGlow from '@/components/sections/features/FeaturesBorderGlow'; +import { Code2, Globe, Search, Settings } from "lucide-react"; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function ServicesSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Testimonials.tsx b/src/pages/HomePage/sections/Testimonials.tsx new file mode 100644 index 0000000..a0f820b --- /dev/null +++ b/src/pages/HomePage/sections/Testimonials.tsx @@ -0,0 +1,42 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "testimonials" section. + +import React from 'react'; +import TestimonialTrustCard from '@/components/sections/testimonial/TestimonialTrustCard'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function TestimonialsSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +}