Skip to content

Commit 7c86e97

Browse files
committed
feat: stars
1 parent c68c5e5 commit 7c86e97

5 files changed

Lines changed: 3476 additions & 336 deletions

File tree

frontend/components.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "radix-nova",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.js",
8+
"css": "src/styles/globals.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"rtl": false,
15+
"aliases": {
16+
"components": "@/components",
17+
"utils": "@/lib/utils",
18+
"ui": "@/components/ui",
19+
"lib": "@/lib",
20+
"hooks": "@/hooks"
21+
},
22+
"menuColor": "default",
23+
"menuAccent": "subtle",
24+
"registries": {
25+
"@animate-ui": "https://animate-ui.com/r/{name}.json"
26+
}
27+
}

frontend/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,23 @@
1313
"test:watch": "vitest --watch"
1414
},
1515
"dependencies": {
16+
"@fontsource-variable/geist": "^5.2.9",
1617
"@lottiefiles/dotlottie-react": "^0.19.4",
1718
"class-variance-authority": "^0.7.1",
1819
"clsx": "^2.1.1",
1920
"framer-motion": "^12.40.0",
2021
"lottie-react": "^2.4.1",
2122
"lucide-react": "^0.577.0",
23+
"motion": "^12.40.0",
24+
"radix-ui": "^1.4.3",
2225
"react": "^19.2.4",
2326
"react-dom": "^19.2.4",
2427
"react-icons": "^5.6.0",
2528
"react-router-dom": "^7.15.1",
2629
"rolldown": "^1.0.0-rc.10",
27-
"tailwind-merge": "^3.5.0"
30+
"shadcn": "^4.8.1",
31+
"tailwind-merge": "^3.6.0",
32+
"tw-animate-css": "^1.4.0"
2833
},
2934
"devDependencies": {
3035
"@eslint/js": "^9.39.4",

frontend/src/components/landing/HeroSection.tsx

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,61 @@
11
import { motion, useScroll, useTransform } from "framer-motion";
22
import { Link } from "react-router-dom";
33
import { ArrowRight, Play } from "lucide-react";
4-
import { useRef } from "react";
4+
import { useRef, useMemo } from "react";
55
import googleLogo from "../../assets/google.png";
6-
import amazonLogo from "../../assets/amazon.png"
6+
import amazonLogo from "../../assets/amazon.png";
77
import metaLogo from "../../assets/meta.svg";
88
import uberLogo from "../../assets/uber.png";
99

1010
const COMPANIES = [
11-
{ name: "Google", logo: googleLogo},
12-
{ name: "Amazon", logo:amazonLogo},
11+
{ name: "Google", logo: googleLogo },
12+
{ name: "Amazon", logo: amazonLogo },
1313
{ name: "Meta", logo: metaLogo },
1414
{ name: "Uber", logo: uberLogo },
1515
];
1616

17+
// Componente Interno para gerar as estrelas de forma otimizada
18+
function StarsBackground() {
19+
// Gera posições aleatórias fixas para evitar recalculado a cada render
20+
const stars = useMemo(() => {
21+
return Array.from({ length: 80 }).map((_, i) => ({
22+
id: i,
23+
top: `${Math.random() * 100}%`,
24+
left: `${Math.random() * 100}%`,
25+
size: Math.random() * 2 + 1, // Tamanhos entre 1px e 3px
26+
delay: Math.random() * 5,
27+
duration: Math.random() * 4 + 2,
28+
}));
29+
}, []);
30+
31+
return (
32+
<div className="absolute inset-0 overflow-hidden pointer-events-none">
33+
{stars.map((star) => (
34+
<motion.div
35+
key={star.id}
36+
className="absolute rounded-full bg-emerald-800/40 dark:bg-white"
37+
style={{
38+
top: star.top,
39+
left: star.left,
40+
width: star.size,
41+
height: star.size,
42+
}}
43+
animate={{
44+
opacity: [0.2, 1, 0.2],
45+
scale: [1, 1.2, 1],
46+
}}
47+
transition={{
48+
duration: star.duration,
49+
repeat: Infinity,
50+
delay: star.delay,
51+
ease: "easeInOut",
52+
}}
53+
/>
54+
))}
55+
</div>
56+
);
57+
}
58+
1759
export function HeroSection() {
1860
const ref = useRef(null);
1961
const { scrollYProgress } = useScroll({
@@ -28,13 +70,17 @@ export function HeroSection() {
2870
return (
2971
<section ref={ref} className="relative min-h-[90vh] flex flex-col items-center justify-start pt-16 md:pt-24 pb-0 overflow-hidden bg-transparent font-sans">
3072

73+
{/* Container de Background Animado (Grid + Estrelas) */}
3174
<motion.div
3275
style={{ y: backgroundY }}
3376
className="absolute inset-0 pointer-events-none w-full h-[150%]
3477
bg-[linear-gradient(to_right,rgba(0,0,0,0.04)_1px,transparent_1px),linear-gradient(to_bottom,rgba(0,0,0,0.04)_1px,transparent_1px)]
3578
dark:bg-[linear-gradient(to_right,rgba(255,255,255,0.02)_1px,transparent_1px),linear-gradient(to_bottom,rgba(255,255,255,0.02)_1px,transparent_1px)]
3679
bg-[size:60px_60px]"
37-
/>
80+
>
81+
{/* Renderiza as estrelas dentro do container parallax do background */}
82+
<StarsBackground />
83+
</motion.div>
3884

3985
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[600px] bg-emerald-100/30 dark:bg-emerald-950/15 blur-[120px] rounded-full pointer-events-none" />
4086

0 commit comments

Comments
 (0)