Skip to content

Commit 1649989

Browse files
committed
feat(components/home): Add HeroSection component with animations and GitHub link
- Introduces a HeroSection component for the homepage featuring motion-based animations, a call-to-action button for learning Java, and a link to the project's GitHub repository. - Enhances user engagement and navigability while maintaining accessibility standards.
1 parent 57197a3 commit 1649989

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
"use client";
2+
3+
import { GitHubIcon } from "@/components/icons";
4+
import { Button } from "@/components/ui/button";
5+
import { motion } from "motion/react";
6+
import { ANIMATION_VARIANTS } from "./animation-variants";
7+
8+
export function HeroSection() {
9+
return (
10+
<motion.section
11+
className="flex flex-col items-center justify-center pt-36 pb-14"
12+
variants={ANIMATION_VARIANTS.container}
13+
initial="hidden"
14+
animate="visible"
15+
role="banner"
16+
aria-labelledby="hero-title"
17+
>
18+
<motion.h1
19+
id="hero-title"
20+
className="font-funnel-display text-foreground max-w-5xl text-5xl font-bold tracking-tighter sm:text-7xl"
21+
variants={ANIMATION_VARIANTS.title}
22+
>
23+
Master Java Programming efficiently with Javaistic
24+
</motion.h1>
25+
<motion.p
26+
className="mt-6 max-w-3xl text-lg font-medium text-neutral-700 sm:text-xl dark:text-neutral-300"
27+
variants={ANIMATION_VARIANTS.item}
28+
role="complementary"
29+
aria-label="Hero description"
30+
>
31+
Interactive, fast-paced learning for absolute beginners to advanced
32+
learners.
33+
<br /> A free and open-source platform to learn Java programming.
34+
</motion.p>
35+
<motion.div
36+
className="mt-8 flex flex-col gap-4 sm:flex-row"
37+
variants={ANIMATION_VARIANTS.container}
38+
initial="hidden"
39+
animate="visible"
40+
>
41+
<motion.a href="/docs" variants={ANIMATION_VARIANTS.title}>
42+
<Button
43+
size="lg"
44+
className="cursor-pointer rounded-lg py-6 text-lg font-semibold duration-200 ease-in-out active:scale-105 dark:hover:bg-white/80"
45+
aria-label="Start learning Java programming with our documentation"
46+
>
47+
Start Learning Now
48+
</Button>
49+
</motion.a>
50+
<motion.a
51+
href="https://github.com/javaistic/javaistic"
52+
target="_blank"
53+
rel="noopener noreferrer"
54+
variants={ANIMATION_VARIANTS.title}
55+
>
56+
<Button
57+
size="lg"
58+
variant="outline"
59+
className="dark:text-foreground border-blue cursor-pointer rounded-lg py-6 text-lg font-semibold"
60+
aria-label="View Javaistic project on GitHub"
61+
>
62+
<GitHubIcon className="!size-5" aria-hidden="true" />
63+
Star on GitHub
64+
</Button>
65+
</motion.a>
66+
</motion.div>
67+
</motion.section>
68+
);
69+
}

0 commit comments

Comments
 (0)