From f9712ef7519928ba6400dcb6d90c28b15dd4e8ba Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Tue, 20 May 2025 10:48:44 +0530 Subject: [PATCH] update landing page just messing around, if you know any good design please send a pr :( --- apps/web/package.json | 1 + .../app/(home)/_components/FeatureCard.tsx | 84 +++++++++ .../app/(home)/_components/code-container.tsx | 176 +----------------- .../(home)/_components/sponsors-section.tsx | 35 ++-- .../app/(home)/_components/stack-builder.tsx | 139 +------------- apps/web/src/app/(home)/page.tsx | 144 +++++++------- apps/web/src/app/global.css | 2 +- apps/web/src/components/ui/button.tsx | 59 ++++++ bun.lock | 1 + 9 files changed, 233 insertions(+), 408 deletions(-) create mode 100644 apps/web/src/app/(home)/_components/FeatureCard.tsx create mode 100644 apps/web/src/components/ui/button.tsx diff --git a/apps/web/package.json b/apps/web/package.json index 0bda863..8b0c94a 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -12,6 +12,7 @@ "dependencies": { "@radix-ui/react-dialog": "^1.1.13", "@radix-ui/react-scroll-area": "^1.2.8", + "@radix-ui/react-slot": "^1.2.2", "@radix-ui/react-switch": "^1.2.4", "@radix-ui/react-tooltip": "^1.2.6", "babel-plugin-react-compiler": "^19.1.0-rc.1", diff --git a/apps/web/src/app/(home)/_components/FeatureCard.tsx b/apps/web/src/app/(home)/_components/FeatureCard.tsx new file mode 100644 index 0000000..f6daf37 --- /dev/null +++ b/apps/web/src/app/(home)/_components/FeatureCard.tsx @@ -0,0 +1,84 @@ +"use client"; + +import { ScrollArea } from "@/components/ui/scroll-area"; +import { cn } from "@/lib/utils"; +import { AnimatePresence, motion } from "framer-motion"; +import Image from "next/image"; +import { useState } from "react"; + +interface TechOption { + id: string; + name: string; + icon: string; +} + +interface FeatureCardProps { + title: string; + description?: string; + options: TechOption[]; + className?: string; +} + +const FeatureCard: React.FC = ({ + title, + options, + className, +}) => { + const [isHovered, setIsHovered] = useState(false); + + return ( + setIsHovered(true)} + onHoverEnd={() => setIsHovered(false)} + layout + > +
+

+ {title} +

+
+ + + {isHovered && ( + + +
    + {options.map((option) => ( +
  • + {option.icon.startsWith("/") ? ( + {option.name} + ) : ( + {option.icon} + )} +
  • + ))} +
+
+
+ )} +
+
+ ); +}; + +export default FeatureCard; diff --git a/apps/web/src/app/(home)/_components/code-container.tsx b/apps/web/src/app/(home)/_components/code-container.tsx index 1c9f98d..ef26ff2 100644 --- a/apps/web/src/app/(home)/_components/code-container.tsx +++ b/apps/web/src/app/(home)/_components/code-container.tsx @@ -2,34 +2,12 @@ import { cn } from "@/lib/utils"; import { Check, ClipboardCopy } from "lucide-react"; import { AnimatePresence, motion } from "motion/react"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import PackageIcon from "./icons"; const CodeContainer = () => { const [selectedPM, setSelectedPM] = useState<"npm" | "pnpm" | "bun">("bun"); const [copied, setCopied] = useState(false); - const [, setShowCursor] = useState(true); - const [step, setStep] = useState(0); - - useEffect(() => { - const interval = setInterval(() => setShowCursor((p) => !p), 500); - return () => clearInterval(interval); - }, []); - - // biome-ignore lint/correctness/useExhaustiveDependencies: - useEffect(() => { - setStep(0); - const initialTimer = setTimeout(() => setStep(1), 1000); - - return () => clearTimeout(initialTimer); - }, [selectedPM]); - - useEffect(() => { - if (step > 0 && step < 5) { - const timer = setTimeout(() => setStep((s) => s + 1), 400); - return () => clearTimeout(timer); - } - }, [step]); const commands = { npm: "npx create-better-t-stack@latest", @@ -37,12 +15,6 @@ const CodeContainer = () => { bun: "bun create better-t-stack@latest", }; - const runCommands = { - npm: "npm run dev", - pnpm: "pnpm dev", - bun: "bun dev", - }; - const copyToClipboard = async () => { if (copied) return; await navigator.clipboard.writeText(commands[selectedPM]); @@ -85,21 +57,6 @@ const CodeContainer = () => { {commands[selectedPM]} - {step === 0 && ( -