diff --git a/client/src/components/HeroSection.tsx b/client/src/components/HeroSection.tsx index a9a08a9..51fd0ee 100644 --- a/client/src/components/HeroSection.tsx +++ b/client/src/components/HeroSection.tsx @@ -1,10 +1,97 @@ -import { useEffect, useRef, useState } from "react"; -import { ArrowDown, ArrowUpRight, Check } from "lucide-react"; +import { CSSProperties, useEffect, useRef, useState } from "react"; +import { ArrowDown, ArrowUpRight, Check, Cog } from "lucide-react"; import { trackCTAClick } from "@/lib/analytics"; +const backgrounds = ["geometry", "matrix", "gears"] as const; +type Background = (typeof backgrounds)[number]; + +const pickBackground = (): Background => { + const requested = new URLSearchParams(location.search).get("background"); + if (backgrounds.includes(requested as Background)) return requested as Background; + + try { + const previous = sessionStorage.getItem("primebuild-background"); + const choices = backgrounds.filter((item) => item !== previous); + const selected = choices[Math.floor(Math.random() * choices.length)]; + sessionStorage.setItem("primebuild-background", selected); + return selected; + } catch { + return backgrounds[Math.floor(Math.random() * backgrounds.length)]; + } +}; + +const HeroBackground = ({ variant }: { variant: Background }) => { + if (variant === "matrix") { + return ( +