Skip to content

Commit

Permalink
Merge pull request #48 from unmonk/v0.2
Browse files Browse the repository at this point in the history
chunking matchups
  • Loading branch information
unmonk authored Feb 17, 2025
2 parents 2a9b21f + e5016fd commit f9e9507
Show file tree
Hide file tree
Showing 14 changed files with 1,010 additions and 404 deletions.
494 changes: 494 additions & 0 deletions .cursor/rules/anthropic_convex_rules.mdc

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export default function Home() {
return (
<main className="">
<Hero />
<LandingLeagues />
<HowItWorks />
<FAQ />
</main>
Expand Down
66 changes: 49 additions & 17 deletions components/landing/faq.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"use client";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import { DiscordLogoIcon } from "@radix-ui/react-icons";
import { motion } from "framer-motion";

const LinksFAQ = () => {
return (
Expand Down Expand Up @@ -158,27 +160,57 @@ const FAQList: FAQProps[] = [
},
];

const containerVariants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: {
staggerChildren: 0.1,
when: "beforeChildren",
},
},
};

const itemVariants = {
hidden: { opacity: 0, y: 20 },
visible: {
opacity: 1,
y: 0,
transition: {
duration: 0.5,
},
},
};

export const FAQ = () => {
return (
<section id="faq" className="container py-24 sm:py-32">
<h2 className="text-3xl md:text-4xl font-bold mb-4">
Frequently Asked{" "}
<span className="bg-gradient-to-b from-primary/60 to-primary text-transparent bg-clip-text">
Questions
</span>
</h2>

<Accordion type="single" collapsible className="w-full AccordionRoot">
{FAQList.map(({ question, answer, value }: FAQProps) => (
<AccordionItem key={value} value={value}>
<AccordionTrigger className="text-left">
{question}
</AccordionTrigger>
<motion.div
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
variants={containerVariants}
>
<h2 className="text-3xl md:text-4xl font-bold mb-4">
Frequently Asked{" "}
<span className="bg-gradient-to-b from-primary/60 to-primary text-transparent bg-clip-text">
Questions
</span>
</h2>

<AccordionContent>{answer}</AccordionContent>
</AccordionItem>
))}
</Accordion>
<Accordion type="single" collapsible className="w-full AccordionRoot">
{FAQList.map(({ question, answer, value }: FAQProps) => (
<motion.div key={value} variants={itemVariants}>
<AccordionItem value={value}>
<AccordionTrigger className="text-left">
{question}
</AccordionTrigger>
<AccordionContent>{answer}</AccordionContent>
</AccordionItem>
</motion.div>
))}
</Accordion>
</motion.div>

<h3 className="font-medium mt-4">
Still have questions?{" "}
Expand Down
137 changes: 95 additions & 42 deletions components/landing/hero.tsx
Original file line number Diff line number Diff line change
@@ -1,54 +1,107 @@
"use client";
import { Button } from "@/components/ui/button";
import { buttonVariants } from "@/components/ui/button";
import { HeroCards } from "./hero-cards";
import { DiscordLogoIcon } from "@radix-ui/react-icons";
import { useRouter } from "next/navigation";
import { Badge } from "../ui/badge";
import { useEffect, useState } from "react";
import { ArrowRight } from "lucide-react";
import { LandingLeagues } from "./landing-leagues";
import Link from "next/link";
import { motion } from "framer-motion";
import GetStartedButton from "@/components/ui/get-started-button";

export const Hero = () => {
const [currentVideo, setCurrentVideo] = useState(1);

useEffect(() => {
const interval = setInterval(() => {
setCurrentVideo((prev) => (prev >= 4 ? 1 : prev + 1));
}, 4000); // Change video every 4 seconds

return () => clearInterval(interval);
}, []);

const scrollToNextSection = () => {
const nextSection = document.getElementById("howItWorks");
nextSection?.scrollIntoView({ behavior: "smooth" });
};

return (
<section className="container grid lg:grid-cols-2 place-items-center pt-16 md:pt-24">
<div className="text-center lg:text-start space-y-6">
<main className="text-5xl md:text-6xl font-bold">
<h1 className="inline">
<span className="inline bg-gradient-to-r from-black to-green-400 dark:from-white dark:to-green-700 text-transparent bg-clip-text">
ChainLink
</span>
</h1>
</main>

<p className="text-xl text-muted-foreground md:w-10/12 mx-auto lg:mx-0">
Pick the winner on matchups drawn from different sports and events
from around the world, including NFL, MLB, NBA, Soccer, UFL, Lacrosse,
College Football, and College Basketball
</p>

<div className="space-y-4 md:space-y-0 md:space-x-4">
<Link href="/dashboard" passHref>
<Button className="w-full md:w-1/3">Play Now</Button>
</Link>
<section className="relative min-h-screen overflow-hidden">
<video
key={currentVideo}
autoPlay
loop
muted
playsInline
className="absolute inset-0 h-full w-full object-cover"
aria-hidden="true"
>
<source src={`/videos/clip${currentVideo}.mp4`} type="video/mp4" />
Your browser does not support the video tag.
</video>
<div className="absolute inset-0 bg-black/60" />{" "}
{/* Overlay to ensure text readability */}
<div className="container relative mx-auto flex min-h-screen flex-col items-center justify-center px-4 py-24 text-center sm:px-6 lg:px-8 ">
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
>
<Badge className="mb-4 bg-emerald-500/10 text-emerald-500 animate-pulse">
CHAINBUILDER
</Badge>
</motion.div>

<a
href={process.env.NEXT_PUBLIC_DISCORD_URL}
target="_blank"
className={`w-full md:w-1/3 ${buttonVariants({
variant: "outline",
})}`}
<motion.h1
className="mb-6 text-5xl font-bold tracking-tight text-white sm:text-7xl lg:text-8xl"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: 0.2 }}
>
Predict. Win.{" "}
<span className="bg-gradient-to-r from-emerald-400 to-emerald-500 bg-clip-text text-transparent">
Build Your Chain.
</span>
</motion.h1>

<motion.p
className="mb-8 max-w-2xl text-xl text-gray-300"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: 0.4 }}
>
Join sports fans building their chains across NFL, NBA, MLB, NHL, MLS,
College Basketball, College Football, and more. Build your chain
today.
</motion.p>

<motion.div
className="flex flex-row gap-4 w-full mx-auto max-w-2xl"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: 0.6 }}
>
<Link href="/dashboard" passHref className="w-full">
<GetStartedButton text="Play Now" />
</Link>
<Button
size="lg"
variant="outline"
className="border-gray-400 text-lg text-white hover:bg-white/10 w-full"
onClick={scrollToNextSection}
>
Discord
<DiscordLogoIcon className="ml-2 w-5 h-5" />
</a>
</div>
</div>
Learn More
</Button>
</motion.div>

{/* Hero cards sections */}
<div className="z-10 mr-20">
{" "}
<HeroCards />
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: 0.8 }}
className="w-full"
>
<LandingLeagues />
</motion.div>
</div>

{/* Shadow effect */}
<div className="shadow"></div>
</section>
);
};
53 changes: 38 additions & 15 deletions components/landing/how-it-works.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Gift, Map, Medal, Plane } from "lucide-react";
import { Gift, Medal } from "lucide-react";
import { motion } from "framer-motion";

interface FeatureProps {
icon: JSX.Element;
Expand Down Expand Up @@ -37,28 +39,49 @@ const features: FeatureProps[] = [
export const HowItWorks = () => {
return (
<section id="howItWorks" className="container text-center py-8 sm:py-16">
<h2 className="text-3xl md:text-4xl font-bold ">
<motion.h2
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: "-100px" }}
className="text-3xl md:text-4xl font-bold"
>
How to{" "}
<span className="bg-gradient-to-b from-primary/60 to-primary text-transparent bg-clip-text">
Play{" "}
</span>
Step-by-Step Guide
</h2>
<p className="md:w-3/4 mx-auto mt-4 mb-8 text-xl text-muted-foreground">
</motion.h2>

<motion.p
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: "-100px" }}
transition={{ delay: 0.2 }}
className="md:w-3/4 mx-auto mt-4 mb-8 text-xl text-muted-foreground"
>
Correctly pick matchups to build your chain.
</p>
</motion.p>

<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
{features.map(({ icon, title, description }: FeatureProps) => (
<Card key={title} className="bg-muted/50">
<CardHeader>
<CardTitle className="grid gap-4 place-items-center">
{icon}
{title}
</CardTitle>
</CardHeader>
<CardContent>{description}</CardContent>
</Card>
{features.map(({ icon, title, description }: FeatureProps, index) => (
<motion.div
key={title}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: "-100px" }}
transition={{ delay: 0.2 + index * 0.1 }}
className="hover:scale-105 transition-transform duration-300 h-full"
>
<Card className="bg-muted/50 h-full">
<CardHeader>
<CardTitle className="grid gap-4 place-items-center">
{icon}
{title}
</CardTitle>
</CardHeader>
<CardContent>{description}</CardContent>
</Card>
</motion.div>
))}
</div>
</section>
Expand Down
29 changes: 1 addition & 28 deletions components/landing/landing-leagues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,10 @@ import { Timeline } from "react-twitter-widgets";

export const LandingLeagues = () => {
return (
<section id="leagues">
{/* <div className="relative flex h-[450px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-transparent md:shadow-xl">
<span className="pointer-events-none whitespace-pre-wrap bg-gradient-to-b from-black to-green-300 bg-clip-text text-center text-5xl leading-none text-transparent font-light dark:from-green-500 dark:to-black">
Our Leagues
</span>
{ACTIVE_LEAGUES.map((league) => (
<OrbitingCircles
key={league}
className="size-[30px] border-none bg-transparent"
duration={randomInt(10, 30)}
delay={randomInt(0, 30)}
radius={randomInt(50, 250)}
reverse={randomTrueFalse()}
>
<Image
src={leagueLogos[league]}
width={45}
height={45}
alt={league}
/>
<p className="text-xs">{leagueNames[league]}</p>
</OrbitingCircles>
))}
</div> */}
<section id="leagues" className="container w-full">
<div className="flex flex-col md:flex-row">
<LeagueBeam />
</div>
</section>
);
};

const randomTrueFalse = () => Math.random() < 0.5;
const randomInt = (min: number, max: number) =>
Math.floor(Math.random() * (max - min + 1) + min);
38 changes: 38 additions & 0 deletions components/ui/get-started-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { ArrowRight } from "lucide-react";
import { cn } from "@/lib/utils";
import { Button } from "./button";

interface IGetStartedButtonProps {
text: string;
className?: string;
}

export default function GetStartedButton({
text = "Get started",
className,
}: IGetStartedButtonProps) {
return (
<Button
size="lg"
variant="outline"
className={cn(
"group flex items-center justify-center gap-3 rounded-lg bg-gradient-to-br from-green-900 via-green-600 to-green-300 p-2 font-bold w-full h-full",
className
)}
>
<span className="text-white group-hover:text-green-100">{text}</span>
<div className="relative flex h-7 w-7 items-center justify-center overflow-hidden rounded-full bg-white/10">
<div className="absolute left-0 flex h-7 w-14 -translate-x-1/2 items-center justify-center transition-all duration-200 ease-in-out group-hover:translate-x-0 group-hover:bg-green-800">
<ArrowRight
size={16}
className="size-7 transform p-1 text-green-100 opacity-0 group-hover:opacity-100"
/>
<ArrowRight
size={16}
className="size-7 transform p-1 text-green-800 opacity-100 transition-transform duration-300 ease-in-out group-hover:opacity-0"
/>
</div>
</div>
</Button>
);
}
Loading

0 comments on commit f9e9507

Please sign in to comment.