Skip to content

Commit f4d428d

Browse files
committed
Update Hero
1 parent afd8f44 commit f4d428d

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

src/app/page/hero/Hero.css

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
/* GPU-accelerated gradient animation */
1+
.animate-gradient-x {
2+
background: linear-gradient(
3+
90deg,
4+
rgba(42, 123, 155, 1),
5+
rgba(87, 199, 133, 1),
6+
rgba(237, 221, 83, 1)
7+
);
8+
background-size: 300% 300%;
9+
animation: gradient-x 10s ease infinite;
10+
}
11+
212
@keyframes gradient-x {
313
0% {
414
background-position: 0% 50%;
@@ -10,8 +20,3 @@
1020
background-position: 0% 50%;
1121
}
1222
}
13-
14-
.animate-gradient-x {
15-
background-size: 200% 200%;
16-
animation: gradient-x 15s ease infinite;
17-
}

src/app/page/hero/Hero.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { useEffect, useRef, useState } from "react";
44
import { motion } from "framer-motion";
55
import { Poppins, Lato, Great_Vibes } from "next/font/google";
6+
import "./Hero.css";
67

78
const nameArr = [
89
"Avinash",
@@ -65,7 +66,7 @@ export default function Hero() {
6566
<section className="relative h-screen w-screen m-0 p-0">
6667
{/* GPU-friendly animated gradient background */}
6768
<motion.div
68-
className="absolute top-0 left-0 w-full h-full bg-gradient-to-r from-(--primary) via-(--background) to-(--secondary) animate-gradient-x"
69+
className="absolute top-0 left-0 w-full h-full animate-gradient-x"
6970
style={{
7071
opacity,
7172
transform: `translateY(${translateY}px)`,
@@ -91,7 +92,10 @@ export default function Hero() {
9192
variants={headingVariants}
9293
initial="hidden"
9394
animate="visible"
94-
className="inline-block mr-2">
95+
className="inline-block mr-2"
96+
style={{
97+
WebkitTextStroke: "1px black",
98+
}}>
9599
{word}
96100
</motion.span>
97101
))}

0 commit comments

Comments
 (0)