Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

Landing Prime (#258)

Ernesto Resende9430da7e1854
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 77400865..2f47630d 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,7 +1,7 @@
import Head from 'next/head';
-import Community from '~/components/landing/community';
-import Features from '~/components/landing/features';
import Hero from '~/components/landing/hero';
+import Features from '~/components/landing/features';
+import Community from '~/components/landing/community';
import { Footsies } from '~/components/ui/footsies';
export default async function Index() {
diff --git a/src/components/landing/fake-challeng-card.tsx b/src/components/landing/fake-challeng-card.tsx
deleted file mode 100644
index 17bfa28b..00000000
--- a/src/components/landing/fake-challeng-card.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-const FakeChallengeCard = () => (
- <>
- <div className="flex flex-col rounded-3xl absolute top-0 right-0 bg-background dark:bg-zinc-900 p-8 border dark:border-zinc-600 border-neutral-300 h-3/4 w-96 shadow-[0_0_1rem_#8884,1rem_-1rem_3rem_-0.5rem_#0004]"
- >
- <h2 className="text-xl font-bold">Implement a JSON parser type</h2>
- <div className="flex gap-3">
- <div className="bg-zinc-700 font-bold px-3 py-1 rounded-full">@you</div>
- </div>
- <div className="rounded-xl -mx-2 bg-neutral-200 dark:bg-zinc-800 flex-grow mt-28"></div>
- </div>
- <div className="flex flex-col rounded-3xl absolute top-36 right-12 bg-background dark:bg-zinc-900 p-8 border dark:border-zinc-600 border-neutral-300 h-4/5 w-96
- shadow-[0_0_1rem_#8884,1rem_-1rem_3rem_-0.5rem_#0004]"
- >
- <h2 className="text-xl font-bold">Implement a generic type</h2>
- <div className="rounded-xl -mx-2 bg-neutral-200 dark:bg-zinc-800 flex-grow mt-28"></div>
- </div>
- </>
-)
-export default FakeChallengeCard
\ No newline at end of file
diff --git a/src/components/landing/fake-challenge-card.tsx b/src/components/landing/fake-challenge-card.tsx
new file mode 100644
index 00000000..b4f1a70e
--- /dev/null
+++ b/src/components/landing/fake-challenge-card.tsx
@@ -0,0 +1,50 @@
+import { clsx } from 'clsx';
+
+export type FakeChallengeCardProps = {
+ title: string;
+ className?: string;
+};
+
+export const FakeChallengeCard = ({ title, className }: FakeChallengeCardProps) => {
+ return (
+ <div
+ className={clsx(className, {
+ 'flex w-[320px] flex-col gap-3 rounded-2xl border border-neutral-300 bg-zinc-100 p-7 drop-shadow-[0_0_15px_rgba(49,49,49,0.2)] backdrop-blur-md dark:border-neutral-800 dark:bg-zinc-900/80 dark:drop-shadow-[0_0_15px_rgba(49,49,49,0.35)]':
+ true,
+ })}
+ >
+ <p className="translate-x-1 text-lg font-medium">{title}</p>
+ <div className="flex gap-3">
+ <div className="inline-flex w-fit translate-x-1 items-center rounded-full border border-transparent bg-red-600 px-2.5 py-0.5 text-xs font-semibold text-primary-foreground dark:bg-red-300">
+ HARD
+ </div>
+ <div className="x-3 -ml-[0.33rem] flex h-auto w-fit items-center justify-center rounded-full bg-transparent py-1 pl-[0.33rem] pr-2 text-xs font-bold text-neutral-700 dark:text-white">
+ @you
+ </div>
+ </div>
+ <div className="translate-x-1 text-xs">
+ Implement the built-in <code>Pick</code> type.
+ </div>
+ <div className="h-56 flex-grow rounded-xl bg-zinc-300/70 p-4 dark:bg-zinc-800/70">
+ <svg
+ width="256"
+ height="193"
+ viewBox="0 0 256 193"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <rect width="234" height="9" rx="4.5" fill="#2B2B32" />
+ <rect y="109" width="234" height="9" rx="4.5" fill="#2B2B32" />
+ <rect y="90" width="234" height="9" rx="4.5" fill="#2B2B32" />
+ <rect y="19" width="123" height="9" rx="4.5" fill="#544048" />
+ <rect y="38" width="142" height="9" rx="4.5" fill="#544048" />
+ <rect y="128" width="130" height="9" rx="4.5" fill="#544048" />
+ <rect y="147" width="189" height="9" rx="4.5" fill="#544048" />
+ <rect y="57" width="142" height="9" rx="4.5" fill="#404F54" />
+ <rect y="166" width="142" height="9" rx="4.5" fill="#404F54" />
+ <rect y="184" width="142" height="9" rx="4.5" fill="#404F54" />
+ </svg>
+ </div>
+ </div>
+ );
+};
diff --git a/src/components/landing/hero.tsx b/src/components/landing/hero.tsx
index 077cce9b..1e1a8e11 100644
--- a/src/components/landing/hero.tsx
+++ b/src/components/landing/hero.tsx
@@ -1,81 +1,89 @@
import { Github } from "lucide-react"
-import FakeChallengeCards from "./fake-challeng-card"
+import { Button } from '~/components/ui/button';
+import { FakeChallengeCard } from '~/components/landing/fake-challenge-card';
+import Link from 'next/link';
+
+
+const TypeHeroLogo = () => {
+ return (
+ <svg
+ fill="none"
+ viewBox="0 0 164 164"
+ className="h-28 sm:h-44 w-28 sm:w-44 rounded-3xl sm:rounded-[2rem]"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M0 29.8182C0 13.3501 13.3501 0 29.8182 0H134.182C150.65 0 164 13.3501 164 29.8182V134.182C164 150.65 150.65 164 134.182 164H29.8182C13.3501 164 0 150.65 0 134.182V29.8182Z"
+ fill="#3178C6"
+ />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M71.4351 80.307H91.9394V67.0909H34.7879V80.307H55.1919V139.152H71.4351V80.307Z"
+ fill="white"
+ />
+ <path
+ d="M91.9394 139.152V67.0909H106.946V96.9549H129.078V67.0909H144.121V139.152H129.078V109.182H106.946V139.152H91.9394Z"
+ fill="white"
+ />
+ </svg>
+ );
+};
const Hero = () => (
+<section className="overflow-x-hidden">
+ <svg className="pointer-events-none mix-blend-soft-light opacity-50 z-10 absolute left-0 top-0 h-full w-full" id="grain">
+ <filter id="noise">
+ <feTurbulence type="fractalNoise" baseFrequency="1" numOctaves="5" stitchTiles="stitch"></feTurbulence>
+ </filter>
+ <rect width="100%" height="100%" filter="url(#noise)"></rect>
+ </svg>
<div className="mb-[56px] container items-center justify-center grid lg:grid-cols-2 min-h-[calc(100lvh_-_112px)]">
- {/* background film grain noise effect */}
- {/* <svg className="pointer-events-none mix-blend-soft-light opacity-50 z-10 fixed left-0 top-0 h-full w-full" id="grain">
- <filter id="noise">
- <feTurbulence type="fractalNoise" baseFrequency="1" numOctaves="5" stitchTiles="stitch"></feTurbulence>
- </filter>
- <rect width="100%" height="100%" filter="url(#noise)"></rect>
- </svg> */}
- <div className="flex h-full flex-col justify-center items-center lg:items-start gap-10 overflow-visible text-white">
- <div className="relative lg:mr-auto flex items-center gap-5">
- <div className="absolute left-1/2 top-1/2 -z-10 hidden h-56 w-56 -translate-x-[15%] -translate-y-1/2 rounded-full bg-white/10 blur-2xl dark:block lg:h-96 lg:w-96 lg:blur-3xl"></div>
- <div className="absolute right-1/2 top-1/2 -z-10 hidden h-56 w-56 -translate-y-1/2 translate-x-[15%] rounded-full bg-[#3178c6]/20 blur-2xl dark:block lg:h-96 lg:w-96 lg:blur-3xl"></div>
- <svg
- className="h-28 sm:h-44 w-28 sm:w-44 rounded-3xl sm:rounded-[2rem] dark:bg-[#3178C6] bg-[#3178C6] p-[2px]"
- viewBox="0 0 512 512"
- xmlns="http://www.w3.org/2000/svg"
+ <div className="flex w-full flex-col justify-center items-center lg:items-start gap-10">
+ <div className="relative flex w-full items-center justify-center lg:justify-start gap-4">
+ <div className="absolute left-1/2 top-1/2 -z-10 hidden h-56 w-56 -translate-x-[15%] -translate-y-[50%] rounded-full bg-slate-400/20 blur-3xl dark:block"></div>
+ <div className="absolute right-1/2 top-1/2 -z-10 hidden h-56 w-56 -translate-y-[40%] rounded-full bg-[#3178c6]/20 blur-3xl dark:block"></div>
+ <TypeHeroLogo />
+ <h1 className="bg-gradient-to-r from-[#3178c6] to-black bg-clip-text text-6xl sm:text-8xl font-extrabold sm:leading-[5.5rem] text-transparent dark:to-white">
+ type
+ <br />
+ hero
+ </h1>
+ </div>
+
+ <p className="max-w-[50ch] bg-transparent leading-9 px-8 lg:px-0 text-center lg:text-left text-black/50 dark:text-white/50">
+ Connect, collaborate, and grow with a community of TypeScript developers. Elevate your
+ skills trough interactive coding challenges, discussions, and knowledge sharing
+ </p>
+ <div className="flex gap-3">
+ <Button className="font-bold rounded-xl py-2 px-4 flex items-center gap-2" asChild>
+ <Link href="/explore">Explore challenges</Link>
+ </Button>
+ <Button
+ className="border-2 rounded-xl py-2 px-4 flex items-center gap-2 dark:text-white"
+ asChild
+ variant="outline"
>
- <g clipPath="url(#clip0_1_2)">
- <path
- d="M462 0H50C22.3858 0 0 22.3858 0 50V462C0 489.614 22.3858 512 50 512H462C489.614 512 512 489.614 512 462V50C512 22.3858 489.614 0 462 0Z"
- className="fill-[#3178C6] dark:fill-[#3178C6]"
- />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M239.78 284.082H304V243H125V284.082H188.906V467H239.78V284.082Z"
- fill="white"
- />
- <path
- d="M303.13 466.986V242.986H349.72V335.818H418.427V242.986H465.13V466.986H418.427V373.827H349.72V466.986H303.13Z"
- fill="white"
- />
- </g>
- <defs>
- <clipPath id="clip0_1_2">
- <rect width="512" height="512" fill="white" />
- </clipPath>
- </defs>
- </svg>
- <h1 className="bg-gradient-to-r from-[#3178c6] dark:from-[#3178c6] from-30% to-black bg-clip-text font-black text-transparent dark:to-white text-6xl sm:text-8xl">
- type
- <br />
- hero
- </h1>
- </div>
- <p className="max-w-[50ch] bg-transparent leading-9 text-center lg:text-left text-black/50 dark:text-white/50">
- Connect, collaborate, and grow with a community of TypeScript developers. Elevate your skills through interactive coding challenges, discussions, and knowledge sharing
- {/* Connect and collaborate with a community of TypeScript developers on Type Hero.
- Engage in discussions, create challenges, and share insights with fellow typescript
- enthusiasts. Type Hero has collaborative coding challenges that foster a supportive and
- inspiring environment, where you can learn from others and showcase your expertise. */}
- </p>
- <div className="flex gap-5">
- <button className="dark:bg-white bg-black text-background py-2 px-4 rounded-xl">Explore Challenges</button>
- <button className="border-2 py-2 px-4 rounded-xl flex items-center gap-2">
- <Github className="h-4 w-4" />
- Github
- </button>
+ <a className="inline-flex gap-1" href="https://github.com/">
+ <Github className="h-4 w-4" />
+ GitHub
+ </a>
+ </Button>
+ </div>
</div>
- </div>
-
- <div className="relative lg:block overflow-visible hidden rounded-full w-full h-3/4">
- <div
- className="movingbackground absolute -z-30 -inset-40 top-1/2 -translate-y-1/2 rounded-full aspect-square shadow-[inset_0_0_5rem_5rem] shadow-background"
- style={{
- backgroundSize: '3.5rem 3.5rem',
- backgroundImage: 'linear-gradient(to right, #8888 1px, transparent 1px), linear-gradient(to bottom, #8888 1px, transparent 1px)',
- }}
- >
-
+ <div className="relative h-[800px] lg:block overflow-visible hidden w-full">
+ <div className="background absolute -z-30 aspect-square h-[750px] w-[650px] translate-x-[-30px] shadow-[inset_0_0_5rem_3rem] shadow-background"></div>
+ <FakeChallengeCard
+ className="absolute z-10 translate-x-[77px] translate-y-[258px]"
+ title="Implement a generic type"
+ />
+ <FakeChallengeCard
+ className="absolute translate-x-[190px] translate-y-[116px]"
+ title="Implement a JSON parser type"
+ />
</div>
- <FakeChallengeCards />
</div>
- </div>
+ </section>
)
-export default Hero
\ No newline at end of file
+export default Hero
diff --git a/src/styles/globals.css b/src/styles/globals.css
index 9e6c3e11..777af14e 100644
--- a/src/styles/globals.css
+++ b/src/styles/globals.css
@@ -153,6 +153,12 @@ main {
@apply bg-neutral-300 dark:bg-zinc-600;
}
+.background {
+ background-size: 2.4rem 2.4rem;
+ background-image: linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
+ linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
+}
+
.movingbackground {
animation: movingbackground 60s linear infinite !important;
}
@@ -164,4 +170,4 @@ main {
100% {
background-position: 100% 0;
}
-}
\ No newline at end of file
+}