Switch to version 11: modified src/pages/HomePage/sections/Hero.tsx

This commit is contained in:
2026-07-02 01:31:26 +00:00
parent a321d734f1
commit f603b3df2f

View File

@@ -1,120 +1,21 @@
/* eslint-disable */
// @ts-nocheck — generated by catalog-eject; runtime-correct but TS strict-mode false-positives on inlined catalog body
import { useRef } from "react";
import { motion, useScroll, useTransform } from "motion/react";
import { cls } from "@/lib/utils";
import Button from "@/components/ui/Button";
import HeroBackgroundSlot from "@/components/ui/HeroBackgroundSlot";
import TextAnimation from "@/components/ui/TextAnimation";
import ImageOrVideo from "@/components/ui/ImageOrVideo";
import AutoFillText from "@/components/ui/AutoFillText";
import ScrollReveal from "@/components/ui/ScrollReveal";
// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this
// file as the canonical source for the "hero" section.
const primaryButton = {
href: "#book",
text: "Book a Court"
};
const secondaryButton = {
text: "Join the Club",
href: "#membership"
};
const floatingCards = [
{
name: "Courts",
imageSrc: "https://storage.googleapis.com/webild/users/user_3AniccObAoDJgCkSlT6RJk7a8NL/uploaded-1782952650576-fsoubb3r.jpg"
},
{
name: "Grass Courts",
imageSrc: "https://storage.googleapis.com/webild/users/user_3AniccObAoDJgCkSlT6RJk7a8NL/uploaded-1782952546030-f2ubckey.jpg?_wi=2"
}
];
type FloatingCard = {
name: string;
} & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never });
const CARD_CONFIG = [
{ position: "left", bottom: "30%", aspect: "aspect-3/4", movement: "-100%" },
{ position: "right", bottom: "14%", aspect: "aspect-square", movement: "-75%" },
] as const;
type HeroBillboardBrandFloatingCardsProps = {
brand: string;
description: string;
primaryButton: { text: string; href: string };
secondaryButton: { text: string; href: string };
floatingCards: [FloatingCard, FloatingCard];
textAnimation: "slide-up" | "fade-blur" | "fade";
} & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never });
const HeroInline = () => {
const heroRef = useRef<HTMLDivElement>(null);
const { scrollYProgress } = useScroll({
target: heroRef,
offset: ["start start", "end start"],
});
const leftCardY = useTransform(scrollYProgress, [0, 1], ["0%", CARD_CONFIG[0].movement]);
const rightCardY = useTransform(scrollYProgress, [0, 1], ["0%", CARD_CONFIG[1].movement]);
const cardYTransforms = [leftCardY, rightCardY];
import React from 'react';
import HeroBillboardBrandFloatingCards from "@/components/sections/hero/HeroBillboardBrandFloatingCards";
export default function HeroSection(): React.JSX.Element {
return (
<section ref={heroRef} aria-label="Hero section" className="relative pt-25 pb-20 md:pt-30">
<HeroBackgroundSlot />
{floatingCards.map((card, i) => (
<motion.div
key={i}
style={{ y: cardYTransforms[i], bottom: CARD_CONFIG[i].bottom }}
className={cls(
"absolute z-10 w-28 xl:w-48 2xl:w-52 p-1 xl:p-2 2xl:p-3 card rounded overflow-hidden shadow-xl",
CARD_CONFIG[i].position === "left"
? "left-[calc((100vw-var(--width-content-width))/2)] translate-x-1/4 lg:-translate-x-1/2"
: "right-[calc((100vw-var(--width-content-width))/2)] -translate-x-1/4 lg:translate-x-1/2"
)}
>
<div className="relative">
<ImageOrVideo
imageSrc={card.imageSrc}
videoSrc={card.videoSrc}
className={cls("w-full object-cover rounded", CARD_CONFIG[i].aspect)}
/>
<div className="absolute bottom-1 xl:bottom-2 2xl:bottom-3 inset-x-1 xl:inset-x-2 2xl:inset-x-3 card rounded p-1 xl:p-2 2xl:p-3">
<h3 className="text-2xl md:text-3xl text-center truncate">{card.name}</h3>
<div id="hero" data-section="hero">
<HeroBillboardBrandFloatingCards
textAnimation="fade-blur"
brand="Grand Slam Club"
description="Experience world-class tennis facilities, professional coaching, and a vibrant community. Whether you're a beginner or a seasoned pro, our courts are ready for you."
primaryButton={{"href":"#book","text":"Book a Court"}}
secondaryButton={{"text":"Join the Club","href":"#membership"}}
imageSrc="https://storage.googleapis.com/webild/users/user_3AniccObAoDJgCkSlT6RJk7a8NL/uploaded-1782951363730-2xq7048r.jpg"
floatingCards={[{"name":"Courts","imageSrc":"https://storage.googleapis.com/webild/users/user_3AniccObAoDJgCkSlT6RJk7a8NL/uploaded-1782951920218-dn9n7n03.png"},{"name":"Grass Courts","imageSrc":"https://storage.googleapis.com/webild/users/user_3AniccObAoDJgCkSlT6RJk7a8NL/uploaded-1782952546030-f2ubckey.jpg"}]}
/>
</div>
</div>
</motion.div>
))}
<div className="flex flex-col gap-10 md:gap-12 w-content-width mx-auto">
<div className="flex flex-col items-end gap-5">
<AutoFillText className="w-full font-semibold" paddingY="">{"Grand Slam Club"}</AutoFillText>
<TextAnimation
text={"Experience world-class tennis facilities, professional coaching, and a vibrant community. Whether you're a beginner or a seasoned pro, our courts are ready for you."}
variant={"fade-blur"}
gradientText={false}
tag="p"
className="w-full md:w-1/2 text-lg md:text-2xl leading-snug text-balance text-right"
/>
<div className="flex flex-wrap justify-end gap-3 mt-1 md:mt-2">
<Button text={primaryButton.text} href={primaryButton.href} variant="primary"/>
<Button text={secondaryButton.text} href={secondaryButton.href} variant="secondary" animationDelay={0.1} />
</div>
</div>
<ScrollReveal variant="slide-up" delay={0.2} className="w-full p-2 xl:p-3 2xl:p-4 card rounded overflow-hidden">
<ImageOrVideo imageSrc={"https://storage.googleapis.com/webild/users/user_3AniccObAoDJgCkSlT6RJk7a8NL/uploaded-1782951363730-2xq7048r.jpg"} className="aspect-4/5 md:aspect-video" />
</ScrollReveal>
</div>
</section>
);
};
export default function HeroSection() {
return (
<div data-webild-section="hero" id="hero">
<HeroInline />
</div>
);
}