Branchwell

Become a Pro / website · becomeapro.ai / src / app / page.tsx

Raw 3.7 KB on d27a4e234d2622fe12dfe92667dd00367e1dc2de
1import Link from "next/link";
2import { BranchBand } from "@/components/branch-band";
3import { practiceLessons } from "@/lib/practice";
4import { AREAS } from "@/lib/catalog";
5import { getFieldLessons } from "@/lib/lessons";
6import { pageMetadata, SITE_DESCRIPTION, SITE_TITLE } from "@/lib/seo";
7
8export const metadata = pageMetadata({ title: SITE_TITLE, description: SITE_DESCRIPTION, absoluteTitle: true });
9
10export default function HomePage() {
11 return (
12 <div className="page">
13 <div className="visitor-welcome mb-8" data-visitor-odometer="" data-visitor-site="becomeapro" />
14 <header className="border-b border-border pb-9">
15 <p className="text-xs font-semibold uppercase tracking-widest text-[var(--ash)]">The lesson library</p>
16 <h1 className="mt-2 text-[clamp(2.8rem,8vw,4.6rem)] font-bold leading-none tracking-tight">Become a Pro</h1>
17 <p className="mt-4 max-w-[32rem] text-xl">Free lessons that teach the useful skills of your trade, step by step.</p>
18 <nav aria-label="Start learning" className="mt-5 flex flex-wrap items-center gap-x-5 gap-y-3">
19 <Link href="/practice" className="inline-block bg-foreground px-4 py-2 text-base font-semibold text-background">Start a practice lesson</Link>
20 <a href="#subjects" className="text-base underline">Browse all subjects</a>
21 </nav>
22 <figure className="mt-7">
23 {/* eslint-disable-next-line @next/next/no-img-element */}
24 <img src="/practice-images/workbench.webp" width={1200} height={800} alt="Hands checking a wooden assembly at a workbench with a square, a ruler, and an open notebook nearby" className="block h-auto w-full" fetchPriority="high" />
25 <figcaption className="mt-2 text-sm text-[var(--ash)]">Learn the method, try it yourself, and check what worked.</figcaption>
26 </figure>
27 </header>
28 <section aria-labelledby="practice-preview" className="mt-9 border-b border-border pb-8">
29 <h2 id="practice-preview" className="text-2xl font-bold">Try something today</h2>
30 <p className="mt-2 text-[var(--ash)]">Each practice lesson has a diagram, an exercise, and an answer you can reveal when you’re ready.</p>
31 <ul className="mt-4 space-y-2">
32 {[practiceLessons[0], practiceLessons[3], practiceLessons[6]].map((lesson) => (
33 <li key={lesson.href}><Link href={lesson.href} className="underline">{lesson.title}</Link> <span className="text-sm text-[var(--ash)]">· {lesson.time}</span></li>
34 ))}
35 </ul>
36 <p className="mt-4"><Link href="/practice" className="font-semibold underline">See all eight practice lessons</Link></p>
37 </section>
38 <h2 id="subjects" className="mt-10 text-3xl font-bold tracking-tight">Browse all subjects</h2>
39
40 {AREAS.map((area) => (
41 <section key={area.slug} className="mt-12" aria-labelledby={`area-${area.slug}`}>
42 <h3 id={`area-${area.slug}`} className="text-2xl font-bold">
43 <Link href={`/${area.slug}`} className="underline">
44 {area.name}
45 </Link>
46 </h3>
47 <p className="mt-1 text-[var(--ash)]">{area.summary}</p>
48 <ul className="mt-3 list-disc space-y-1 pl-6">
49 {area.fields.map((field) => {
50 const count = getFieldLessons(field.slug).length;
51 return (
52 <li key={field.slug}>
53 <Link href={`/${area.slug}/${field.slug}`} className="underline">
54 {field.name}
55 </Link>
56 {count > 0 && <span className="text-[var(--ash)]"> ({count === 1 ? "1 lesson" : `${count} lessons`})</span>}
57 </li>
58 );
59 })}
60 </ul>
61 </section>
62 ))}
63
64 <BranchBand />
65 </div>
66 );
67}