From 615757963cf5dec8e7f2362c69a6807b3e9a9085 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Mon, 26 Jan 2026 22:04:49 +0100 Subject: [PATCH] hero entrance --- components/home/Hero.tsx | 183 +++++++++++++++++++++++++++++++-------- 1 file changed, 147 insertions(+), 36 deletions(-) diff --git a/components/home/Hero.tsx b/components/home/Hero.tsx index f79d96ef..204bed13 100644 --- a/components/home/Hero.tsx +++ b/components/home/Hero.tsx @@ -1,6 +1,7 @@ 'use client'; -import React, { useState, useEffect } from 'react'; +import React from 'react'; +import { motion } from 'framer-motion'; import { useTranslations } from 'next-intl'; import { Container, Button, Section, Heading } from '@/components/ui'; import Scribble from '@/components/Scribble'; @@ -9,50 +10,160 @@ import HeroIllustration from './HeroIllustration'; export default function Hero() { const t = useTranslations('Home.hero'); - const [mounted, setMounted] = useState(false); - - useEffect(() => { - setMounted(true); - }, []); - return (
-
+ -
+ -
- - {t.rich('title', { - green: (chunks) => ( - - {chunks} - - ) - })} - -

- {t('subtitle')} -

-
- - -
-
+ + + + {t.rich('title', { + green: (chunks) => ( + + + {chunks} + + + + + + ) + })} + + + +

+ {t('subtitle')} +

+
+ + + + + + + + +
-
); } + +const containerVariants = { + hidden: { opacity: 1 }, + visible: { + opacity: 1, + transition: { + staggerChildren: 0.12, + delayChildren: 0.4 + } + } +} as const; + +const headingVariants = { + hidden: { opacity: 0, y: 60, scale: 0.85 }, + visible: { + opacity: 1, + y: 0, + scale: 1, + transition: { duration: 1.2, ease: [0.25, 0.46, 0.45, 0.94] } + } +} as const; + +const accentVariants = { + hidden: { opacity: 0, scale: 0.9, rotate: -5 }, + visible: { + opacity: 1, + scale: 1, + rotate: 0, + transition: { duration: 0.8, ease: [0.25, 0.46, 0.45, 0.94] } + } +} as const; + +const scribbleVariants = { + hidden: { opacity: 0, scale: 0, rotate: 180 }, + visible: { + opacity: 1, + scale: 1, + rotate: 0, + transition: { duration: 1, type: "spring", stiffness: 300, damping: 20 } + } +} as const; + +const subtitleVariants = { + hidden: { opacity: 0, y: 40, scale: 0.95 }, + visible: { + opacity: 1, + y: 0, + scale: 1, + transition: { duration: 1, ease: [0.25, 0.46, 0.45, 0.94] } + } +} as const; + +const buttonContainerVariants = { + hidden: { opacity: 0 }, + visible: { + opacity: 1, + transition: { + staggerChildren: 0.15, + delayChildren: 0.4 + } + } +} as const; + +const buttonVariants = { + hidden: { opacity: 0, y: 30, scale: 0.9 }, + visible: { + opacity: 1, + y: 0, + scale: 1, + transition: { type: "spring", stiffness: 400, damping: 20 } + } +} as const;