From 24bff5f4b5ad23813e6da5fa8cbc6df592513b1b Mon Sep 17 00:00:00 2001 From: Nebulae Date: Sat, 28 Mar 2026 17:59:56 +0100 Subject: [PATCH] feat(wip parallax test on homepage) --- .../js/components/common/PawsDecoration.tsx | 13 +++++++ .../components/features/home/HeroSection.tsx | 9 ++++- .../features/home/ServicesSection.tsx | 9 ++++- resources/js/hooks/use-parallax.ts | 34 +++++++++++++++++++ resources/js/img/utils/penguin-paws.svg | 10 ++++++ 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 resources/js/components/common/PawsDecoration.tsx create mode 100644 resources/js/hooks/use-parallax.ts create mode 100644 resources/js/img/utils/penguin-paws.svg diff --git a/resources/js/components/common/PawsDecoration.tsx b/resources/js/components/common/PawsDecoration.tsx new file mode 100644 index 0000000..1a87b72 --- /dev/null +++ b/resources/js/components/common/PawsDecoration.tsx @@ -0,0 +1,13 @@ +import {SVGAttributes} from "react"; + +export default function PawsDecoration(props: SVGAttributes) { + return ( + + + + + + ); +} + + diff --git a/resources/js/components/features/home/HeroSection.tsx b/resources/js/components/features/home/HeroSection.tsx index a10897b..4844b66 100644 --- a/resources/js/components/features/home/HeroSection.tsx +++ b/resources/js/components/features/home/HeroSection.tsx @@ -4,9 +4,12 @@ import { Button } from '@/components/ui/button'; import { dashboard, membership } from '@/routes'; import { type SharedData } from '@/types'; import illustrationImage from '@/img/utils/lrl-illustration.png'; +import PawsDecoration from '@/components/common/PawsDecoration'; +import { useParallax } from '@/hooks/use-parallax'; export function HeroSection() { const { auth } = usePage().props; + const pawsRef = useParallax(0.12); const scrollToFirstSection = () => { document.getElementById('first-section')?.scrollIntoView({ behavior: 'smooth' }); @@ -15,7 +18,7 @@ export function HeroSection() { return (
{/* Contenu principal */}
@@ -43,6 +46,10 @@ export function HeroSection() {
+
+ +
+ {/* Flèche vers la première section */}