Skip to content

Commit 92873da

Browse files
committed
improved animation
1 parent 592cca5 commit 92873da

4 files changed

Lines changed: 36 additions & 28 deletions

File tree

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,21 @@ export const Hero = (props: Props) => {
9797

9898
<motion.div
9999
aria-hidden="true"
100-
className="pointer-events-none absolute top-[70px] lg:top-[200px] h-[350px] w-[100px] md:h-[400px] md:w-[260px] rounded-[24px] rotate-[35deg] blur-[60px] md:blur-[150px]"
101-
style={{ right: '160px' }}
102-
animate={
103-
process.env.NODE_ENV === 'test'
104-
? {}
105-
: {
106-
backgroundColor: [
107-
'hsla(330, 100%, 50%, 0.2)',
108-
'hsla(240, 100%, 50%, 0.8)',
109-
],
110-
x: [300, 0],
111-
}
112-
}
100+
className="pointer-events-none absolute rounded-[24px] rotate-[35deg]"
101+
style={{
102+
top: 200,
103+
right: 460,
104+
width: 260,
105+
height: 400,
106+
filter: 'blur(150px)',
107+
}}
108+
animate={{
109+
right: [460, 160],
110+
backgroundColor: [
111+
'hsla(330, 100%, 50%, 0.2)',
112+
'hsla(240, 100%, 50%, 0.8)',
113+
],
114+
}}
113115
transition={{
114116
duration: 4,
115117
repeat: Infinity,

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: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,21 @@ export const Hero = () => {
5454

5555
<motion.div
5656
aria-hidden="true"
57-
className="pointer-events-none absolute top-[70px] lg:top-[200px] h-[350px] w-[100px] md:h-[400px] md:w-[260px] rounded-[24px] rotate-[35deg] blur-[60px] md:blur-[150px]"
58-
style={{ right: '160px' }}
59-
animate={
60-
process.env.NODE_ENV === 'test'
61-
? {}
62-
: {
63-
backgroundColor: [
64-
'hsla(330, 100%, 50%, 0.2)',
65-
'hsla(240, 100%, 50%, 0.8)',
66-
],
67-
x: [300, 0],
68-
}
69-
}
57+
className="pointer-events-none absolute rounded-[24px] rotate-[35deg]"
58+
style={{
59+
top: 200,
60+
right: 460,
61+
width: 260,
62+
height: 400,
63+
filter: 'blur(150px)',
64+
}}
65+
animate={{
66+
right: [460, 160],
67+
backgroundColor: [
68+
'hsla(330, 100%, 50%, 0.2)',
69+
'hsla(240, 100%, 50%, 0.8)',
70+
],
71+
}}
7072
transition={{
7173
duration: 4,
7274
repeat: Infinity,

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>

0 commit comments

Comments
 (0)