diff --git a/src/components/SponsorRewards.tsx b/src/components/SponsorRewards.tsx index 67d236c..a88a281 100644 --- a/src/components/SponsorRewards.tsx +++ b/src/components/SponsorRewards.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { motion } from 'framer-motion'; interface SponsorReward { @@ -9,6 +9,12 @@ interface SponsorReward { } const SponsorRewards: React.FC = () => { + const [flippedCards, setFlippedCards] = useState>({}); + + const toggleFlip = (index: number) => { + setFlippedCards(prev => ({ ...prev, [index]: !prev[index] })); + }; + const sponsorRewards: SponsorReward[] = [ { name: "n8n", @@ -27,27 +33,73 @@ const SponsorRewards: React.FC = () => { logo: "/logos/codecraft.svg", rewardValue: "$3,780", description: "VIP Membership for Codecrafters" + }, + { + name: "Render", + logo: "/logos/render.png", + rewardValue: "$950", + description: "$50 credits for all attendees • Best Use of Render: 1st $500 · 2nd $300 · 3rd $100 • Valid for 1 year" } ]; return (
@@ -276,59 +442,61 @@ const SponsorRewards: React.FC = () => { /> {/* Sponsor Rewards Title */} -
- {/* Decorative top line */} - - - - SPONSOR REWARD - -
+
+ {/* Decorative top line */} + + + + SPONSOR REWARD + +
{/* Grid Layout */}
{sponsorRewards.map((sponsor, index) => { - // Directional entrance per card position const entranceVariants = [ - // Left card: slides in from left { initial: { opacity: 0, x: -60, scale: 0.95 }, mobileInitial: { opacity: 0, x: -35, scale: 0.95 }, delay: 0, }, - // Center card: rises from below { initial: { opacity: 0, y: 40, scale: 0.95 }, mobileInitial: { opacity: 0, y: 30, scale: 0.95 }, delay: 0.25, }, - // Right card: slides in from right { initial: { opacity: 0, x: 60, scale: 0.95 }, mobileInitial: { opacity: 0, x: 35, scale: 0.95 }, delay: 0.5, }, + { + initial: { opacity: 0, x: 80, scale: 0.95 }, + mobileInitial: { opacity: 0, x: 40, scale: 0.95 }, + delay: 0.65, + }, ]; const variant = entranceVariants[index] || entranceVariants[1]; const isMobileView = typeof window !== 'undefined' && window.innerWidth < 768; const initialState = isMobileView ? variant.mobileInitial : variant.initial; + const isFlipped = flippedCards[index] || false; return ( { ease: [0.25, 0.46, 0.45, 0.94], delay: variant.delay, }} - className="flex justify-center" + className="flex justify-center flip-perspective" > -
-
- {/* ── Photo Area: logo + reward amount, vertically centered ── */} -
-
- {sponsor.name} -
- {sponsor.rewardValue} +
toggleFlip(index)} + > + {/* ═══════ FRONT FACE ═══════ */} +
+
+
+
+ {sponsor.name} +
+ {sponsor.rewardValue} +
+ + {/* Caption: sponsor name + flip hint */} +
+ {sponsor.name} + + Tap to flip + +
+
- {/* ── Caption Area: description text ── */} -
-

+ {/* ═══════ BACK FACE ═══════ */} +

+
+ {sponsor.name} + Reward Details +

{sponsor.description}

+
+ {sponsor.rewardValue} +