Skip to content

Commit 9d52633

Browse files
Hero section dashboard frontend revamp (#459)
* TaskDialog UI updated, overlapping issue resolved * truncation is removed * removed hover tooltips to show full text * replace Hero CSS animation with Framer Motion * fixed test fail issue * improved animation * refactor hero animation into shared component
1 parent 3729006 commit 9d52633

6 files changed

Lines changed: 40 additions & 66 deletions

File tree

frontend/src/components/HomeComponents/Hero/Hero.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CopyButton } from './CopyButton';
33
import { ToastNotification } from './ToastNotification';
44
import { useState } from 'react';
55
import { Eye, EyeOff } from 'lucide-react';
6+
import { AnimatedHeroGlow } from '@/components/utils/AnimatedHeroGlow';
67

78
export const Hero = (props: Props) => {
89
const [showUuid, setShowUuid] = useState(true);
@@ -94,7 +95,7 @@ export const Hero = (props: Props) => {
9495
</div>
9596
</div>
9697

97-
<div className="shadow"></div>
98+
<AnimatedHeroGlow />
9899

99100
<ToastNotification />
100101
</section>

frontend/src/components/HomeComponents/Hero/__tests__/__snapshots__/Hero.test.tsx.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ exports[`Hero component using snapshot renders correctly 1`] = `
167167
</div>
168168
</div>
169169
<div
170-
class="shadow"
170+
aria-hidden="true"
171+
class="pointer-events-none absolute rounded-[24px] rotate-[35deg]"
172+
style="top: 200px; right: 460px; width: 260px; height: 400px; filter: blur(150px);"
171173
/>
172174
<div
173175
data-testid="toast-notification"

frontend/src/components/LandingComponents/Hero/Hero.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Button } from '../../ui/button';
33
import { buttonVariants } from '../../ui/button';
44
import { HeroCards } from './HeroCards';
55
import { GitHubLogoIcon } from '@radix-ui/react-icons';
6+
import { AnimatedHeroGlow } from '@/components/utils/AnimatedHeroGlow';
67

78
export const Hero = () => {
89
return (
@@ -51,7 +52,7 @@ export const Hero = () => {
5152
<HeroCards />
5253
</div>
5354

54-
<div className="shadow"></div>
55+
<AnimatedHeroGlow />
5556
</section>
5657
);
5758
};

frontend/src/components/LandingComponents/Hero/__tests__/__snapshots__/Hero.test.tsx.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ exports[`Hero component using snapshot renders correctly 1`] = `
8484
</div>
8585
</div>
8686
<div
87-
class="shadow"
87+
aria-hidden="true"
88+
class="pointer-events-none absolute rounded-[24px] rotate-[35deg]"
89+
style="top: 200px; right: 460px; width: 260px; height: 400px; filter: blur(150px);"
8890
/>
8991
</section>
9092
</DocumentFragment>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { motion } from 'framer-motion';
2+
3+
export const AnimatedHeroGlow = () => {
4+
return (
5+
<motion.div
6+
aria-hidden="true"
7+
className="pointer-events-none absolute rounded-[24px] rotate-[35deg]"
8+
style={{
9+
top: 200,
10+
right: 460,
11+
width: 260,
12+
height: 400,
13+
filter: 'blur(150px)',
14+
}}
15+
animate={{
16+
right: [460, 160],
17+
backgroundColor: [
18+
'hsla(330, 100%, 50%, 0.2)',
19+
'hsla(240, 100%, 50%, 0.8)',
20+
],
21+
}}
22+
transition={{
23+
duration: 4,
24+
repeat: Infinity,
25+
repeatType: 'reverse',
26+
ease: 'linear',
27+
}}
28+
/>
29+
);
30+
};

frontend/src/index.css

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,3 @@
11
html {
22
scroll-behavior: smooth;
33
}
4-
5-
/* HeroCards background shadow */
6-
.shadow {
7-
position: absolute;
8-
background: hsla(330, 100%, 50%, 0%);
9-
border-radius: 24px;
10-
rotate: 35deg;
11-
12-
width: 260px;
13-
top: 200px;
14-
height: 400px;
15-
filter: blur(150px);
16-
animation: shadow-slide infinite 4s linear alternate;
17-
}
18-
19-
@keyframes shadow-slide {
20-
from {
21-
background: hsla(330, 100%, 50%, 20%); /* Pink shadow color */
22-
right: 460px;
23-
}
24-
to {
25-
background: hsla(240, 100%, 50%, 80%); /* Blue shadow color */
26-
right: 160px;
27-
}
28-
}
29-
30-
@media (max-width: 1024px) {
31-
.shadow {
32-
top: 70px;
33-
}
34-
35-
@keyframes shadow-slide {
36-
from {
37-
background: hsla(330, 100%, 50%, 20%); /* Pink shadow color */
38-
right: 460px;
39-
}
40-
to {
41-
background: hsla(240, 100%, 50%, 50%); /* Blue shadow color */
42-
right: 160px;
43-
}
44-
}
45-
}
46-
47-
@media (max-width: 768px) {
48-
.shadow {
49-
top: 70px;
50-
width: 100px;
51-
height: 350px;
52-
filter: blur(60px);
53-
}
54-
55-
@keyframes shadow-slide {
56-
from {
57-
background: hsla(330, 100%, 50%, 20%); /* Pink shadow color */
58-
right: 280px;
59-
}
60-
to {
61-
background: hsla(240, 100%, 50%, 30%); /* Blue shadow color */
62-
right: 100px;
63-
}
64-
}
65-
}

0 commit comments

Comments
 (0)