"use client" import { useState, useEffect, useRef } from "react" import { useRouter } from "next/navigation" import Link from "next/link" import { Button } from "@/components/ui/button" import { WelcomeScreen } from "@/components/welcome-screen" import { useAuth } from "@/contexts/supabase-auth-context" import { Cpu, HardDrive, Monitor, Zap, Users, BookOpen, Star, Wrench, LayoutGrid, MessageSquare, Quote, ArrowRight, CheckCircle2, Search, Sparkles, } from "lucide-react" export default function HomePage() { const { user, isLoading } = useAuth() const router = useRouter() // Redirect logged-in users to dashboard useEffect(() => { if (!isLoading && user) { router.push("/dashboard") } }, [user, isLoading, router]) const [showWelcome, setShowWelcome] = useState(true) const [isFaded, setIsFaded] = useState(false) // Scroll fade: sections fade in when they enter viewport const [scrollInView, setScrollInView] = useState>({ trust: false, how: false, features: false, services: false, footer: false, }) const trustRef = useRef(null) const howRef = useRef(null) const featuresRef = useRef(null) const servicesRef = useRef(null) const footerRef = useRef(null) useEffect(() => { const hasSeenWelcome = typeof window !== 'undefined' && localStorage.getItem('buildmate-welcome-seen') === 'true' if (hasSeenWelcome) { setShowWelcome(false) setIsFaded(true) } }, []) useEffect(() => { if (!isFaded) return const entries = [ { ref: trustRef, id: 'trust' }, { ref: howRef, id: 'how' }, { ref: featuresRef, id: 'features' }, { ref: servicesRef, id: 'services' }, { ref: footerRef, id: 'footer' }, ] const observer = new IntersectionObserver( (obsEntries) => { obsEntries.forEach((entry) => { const id = entries.find(e => e.ref.current === entry.target)?.id if (id && entry.isIntersecting) { setScrollInView(prev => ({ ...prev, [id]: true })) } }) }, { rootMargin: '0px 0px -60px 0px', threshold: 0.08 } ) entries.forEach(({ ref }) => { if (ref.current) observer.observe(ref.current) }) return () => observer.disconnect() }, [isFaded]) const handleWelcomeComplete = () => { if (typeof window !== 'undefined') { localStorage.setItem('buildmate-welcome-seen', 'true') } setShowWelcome(false) setTimeout(() => setIsFaded(true), 100) } const scrollFadeClass = (id: string) => `transition-all duration-700 ease-out ${scrollInView[id] ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8'}` // Don't render landing page if user is logged in (will redirect) if (!isLoading && user) { return null } return ( <> {showWelcome && }
{/* Hero — style: clear hierarchy, balanced layout, generous spacing */}

See why builders use BuildMate

Unlock Your Perfect PC Build With Smart Compatibility & Expert Recommendations

PC Builder & Compatibility Checker — for Gaming, Office & Academic. We check every part, suggest the best options, and guide you step-by-step.

{/* Hero stats — ConvertFlow-style */}

100%

Compatibility checked

Gaming · Office · Academic

Builds for every purpose

Step-by-step

From pick parts to first boot

Compatibility
Components
Recommendations
Your Build
✓ Compatible
Gaming · Office · Academic
{/* Trust strip — solid bar, clear copy */}

Smart Compatibility

Every part checked before you buy

Curated Components

Verified database, real pricing

Step-by-Step Guide

From unboxing to first boot

Gaming · Office · Academic

Builds tailored to your purpose

{/* How it works — ConvertFlow-style */}

How it works

Guide your build from idea to finished PC with focused steps—no guesswork.

Pick your parts

Choose CPU, GPU, RAM, and more from a curated database.

Check compatibility

Algorithms verify every combination so nothing conflicts.

Get recommendations

CSP and graph-based suggestions for your budget and use case.

Build with confidence

Follow the step-by-step guide from unboxing to first boot.

{/* Features — Drive builders from idea to finished PC */}

Drive your build from idea to finished PC

BuildMate helps you plan, check, and build your custom PC—with compatibility guaranteed and recommendations for every use case.

{/* Card: top image block, tag, title, description, full-width button */}
Feature

Smart Compatibility

CSP and graph-based algorithms check component compatibility, preventing costly mistakes before you buy.

Feature

Curated Components

Extensive database of verified PC components with real-time pricing and availability from trusted retailers.

Feature

Community Driven

Share builds, get feedback, and discover popular configurations from our community of PC enthusiasts.

Core feature

Step-by-Step Tutorial

Comprehensive, beginner-friendly guide with videos, diagrams, and steps. Learn to build your PC from start to finish.

Feature

Performance Insights

Get detailed performance predictions and benchmarks for your custom configuration.

Feature

Expert Recommendations

Graph-based matching and CSP algorithms for optimal component suggestions by budget, use case, and performance.

{/* Our Services — floating box */}

Everything you need in one place

Plan, build, and manage your custom PC with our tools and guides.

{/* Floating box — shadow + lift */}
Services

PC Builder

Build & check compatibility

Community Builds

Browse & share builds

Build Guides

Step-by-step tutorials

Support

Help & tickets

{/* Testimonials — social proof */}

What builders say about BuildMate

Join thousands who planned their PC with BuildMate.

{[ { quote: "The compatibility checker saved me from buying the wrong RAM. First build and everything posted on first try.", name: "Alex R.", role: "First-time builder · Gaming", avatar: "A", }, { quote: "Community builds gave me so many ideas. Ended up with a solid office setup within my budget.", name: "Maria S.", role: "Office build · Budget-conscious", avatar: "M", }, { quote: "Step-by-step guide was clear and the builder kept my parts in check. Highly recommend for beginners.", name: "Jake T.", role: "Academic build · Student", avatar: "J", }, ].map((t, i) => (

“{t.quote}”

{t.avatar}

{t.name}

{t.role}

))}
{/* Footer — style: clear CTA block, simple bar, max-width */}
) }