|
1 | 1 | <template> |
2 | 2 | <section |
3 | 3 | id="marquee-section" |
4 | | - class="text-flax-smoke-200 relative mb-60 h-fit w-full overflow-clip leading-none" |
5 | | - style="height: clamp(3.5rem, 2.3571rem + 8.5143vw, 10.5rem)" |
| 4 | + class="text-flax-smoke-200 relative mb-50 h-fit w-full overflow-clip leading-none will-change-auto" |
6 | 5 | > |
7 | | - <div id="marquee-1" class="flex" role="marquee"> |
| 6 | + <div id="marquee-1" class="flex h-fit translate-y-0" role="marquee"> |
8 | 7 | <h4 |
9 | 8 | v-for="i in 3" |
10 | 9 | :key="`marquee1-${i}`" |
11 | | - class="heading-1 sm:heading-1 flex items-center font-bold text-nowrap whitespace-nowrap" |
| 10 | + class="heading-1 sm:heading-1 flex items-center font-bold text-nowrap whitespace-nowrap will-change-auto" |
12 | 11 | > |
13 | 12 | Full Stack Developer |
14 | | - <div class="w-fit sm:mx-10 sm:scale-75"> |
| 13 | + <div class="mx-4 w-fit sm:mx-10 sm:scale-75"> |
15 | 14 | <component :is="icons[(i - 1) % icons.length]" /> |
16 | 15 | </div> |
17 | 16 | </h4> |
18 | 17 | </div> |
19 | | - <div id="marquee-2" class="flex" role="marquee"> |
| 18 | + <div |
| 19 | + id="marquee-2" |
| 20 | + class="absolute bottom-0 z-50 flex h-fit translate-y-full" |
| 21 | + role="marquee" |
| 22 | + > |
20 | 23 | <h4 |
21 | 24 | v-for="i in 3" |
22 | 25 | :key="`marquee2-${i}`" |
23 | | - class="heading-1 sm:heading-1 flex items-center font-bold text-nowrap whitespace-nowrap" |
| 26 | + class="heading-1 sm:heading-1 flex items-center font-bold text-nowrap whitespace-nowrap will-change-auto" |
24 | 27 | > |
25 | 28 | Full Stack Developer |
26 | 29 | <div class="w-fit sm:mx-10 sm:scale-75"> |
|
54 | 57 | horizontalLoop(marquee1, { |
55 | 58 | xPercent: -100, |
56 | 59 | repeat: -1, |
57 | | - speed: 0.7, |
| 60 | + speed: 0.8, |
58 | 61 | }); |
59 | 62 |
|
60 | 63 | // Horizontal loop for marquee-2 (opposite direction) |
61 | 64 | horizontalLoop(marquee2, { |
62 | 65 | xPercent: 100, |
63 | 66 | repeat: -1, |
64 | | - speed: 0.7, |
| 67 | + speed: 0.8, |
65 | 68 | reversed: true, |
66 | 69 | }); |
67 | 70 |
|
|
83 | 86 | function initMarqueeAnimations() { |
84 | 87 | // Animate marquee-1 upwards |
85 | 88 | gsap.to('#marquee-1', { |
86 | | - y: -100, |
| 89 | + yPercent: -100, |
87 | 90 | duration: 1, |
88 | 91 | ease: 'power2.inOut', |
89 | 92 | }); |
90 | | -
|
91 | | - // Animate marquee-2 downwards |
| 93 | + // // Animate marquee-2 downwards |
92 | 94 | gsap.to('#marquee-2', { |
93 | | - y: -90, |
| 95 | + yPercent: 0, |
94 | 96 | duration: 1, |
| 97 | + top: '-100%', |
95 | 98 | ease: 'power2.inOut', |
96 | 99 | }); |
97 | 100 | } |
98 | 101 |
|
99 | 102 | function resetMarqueeAnimations() { |
100 | 103 | // Reset marquee-1 position |
101 | 104 | gsap.to('#marquee-1', { |
102 | | - y: 0, |
| 105 | + yPercent: 0, |
103 | 106 | duration: 1, |
104 | 107 | ease: 'power2.inOut', |
105 | 108 | }); |
106 | | -
|
107 | | - // Reset marquee-2 position |
| 109 | + // // Reset marquee-2 position |
108 | 110 | gsap.to('#marquee-2', { |
109 | | - y: 100, |
| 111 | + yPercent: 100, |
110 | 112 | duration: 1, |
| 113 | + top: '0%', |
111 | 114 | ease: 'power2.inOut', |
112 | 115 | }); |
113 | 116 | } |
|
0 commit comments