Skip to content

Commit a6c16f2

Browse files
committed
fix: improve marquee animation and adjust positioning
1 parent 988bee6 commit a6c16f2

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

src/components/design/Marquee.vue

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
<template>
22
<section
33
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"
65
>
7-
<div id="marquee-1" class="flex" role="marquee">
6+
<div id="marquee-1" class="flex h-fit translate-y-0" role="marquee">
87
<h4
98
v-for="i in 3"
109
: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"
1211
>
1312
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">
1514
<component :is="icons[(i - 1) % icons.length]" />
1615
</div>
1716
</h4>
1817
</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+
>
2023
<h4
2124
v-for="i in 3"
2225
: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"
2427
>
2528
Full Stack Developer
2629
<div class="w-fit sm:mx-10 sm:scale-75">
@@ -54,14 +57,14 @@
5457
horizontalLoop(marquee1, {
5558
xPercent: -100,
5659
repeat: -1,
57-
speed: 0.7,
60+
speed: 0.8,
5861
});
5962
6063
// Horizontal loop for marquee-2 (opposite direction)
6164
horizontalLoop(marquee2, {
6265
xPercent: 100,
6366
repeat: -1,
64-
speed: 0.7,
67+
speed: 0.8,
6568
reversed: true,
6669
});
6770
@@ -83,31 +86,31 @@
8386
function initMarqueeAnimations() {
8487
// Animate marquee-1 upwards
8588
gsap.to('#marquee-1', {
86-
y: -100,
89+
yPercent: -100,
8790
duration: 1,
8891
ease: 'power2.inOut',
8992
});
90-
91-
// Animate marquee-2 downwards
93+
// // Animate marquee-2 downwards
9294
gsap.to('#marquee-2', {
93-
y: -90,
95+
yPercent: 0,
9496
duration: 1,
97+
top: '-100%',
9598
ease: 'power2.inOut',
9699
});
97100
}
98101
99102
function resetMarqueeAnimations() {
100103
// Reset marquee-1 position
101104
gsap.to('#marquee-1', {
102-
y: 0,
105+
yPercent: 0,
103106
duration: 1,
104107
ease: 'power2.inOut',
105108
});
106-
107-
// Reset marquee-2 position
109+
// // Reset marquee-2 position
108110
gsap.to('#marquee-2', {
109-
y: 100,
111+
yPercent: 100,
110112
duration: 1,
113+
top: '0%',
111114
ease: 'power2.inOut',
112115
});
113116
}

src/components/design/Slider.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121
<div id="quote-tags" class="flex gap-3">
2222
<p
23-
class="rounded-full border border-flax-smoke-500 px-3 uppercase text-flax-smoke-600"
23+
class="border-flax-smoke-500 text-flax-smoke-600 rounded-full border px-3 uppercase"
2424
v-for="i in people[index].tags"
2525
:key="i"
2626
>
@@ -69,7 +69,7 @@
6969
/>
7070
<div
7171
id="quote-overlay"
72-
class="absolute inset-0 z-50 rounded-lg bg-flax-smoke-500"
72+
class="bg-flax-smoke-500 absolute inset-0 z-50 rounded-lg"
7373
></div>
7474
</div>
7575
</template>
@@ -78,9 +78,9 @@
7878
<template v-else>
7979
<div class="col-span-full">
8080
<template v-for="(p, i) in people" :key="i">
81-
<div class="mt-10 grid w-full grid-cols-4 items-start">
81+
<div class="mt-10 grid w-full grid-cols-5 items-start sm:grid-cols-4">
8282
<div
83-
class="columns-gap heading-2 relative col-span-1 flex h-full flex-col font-bold leading-none"
83+
class="columns-gap heading-2 relative col-span-1 flex h-full flex-col leading-none font-bold"
8484
>
8585
{{ (i + 1).toString().padStart(2, '0') }}
8686
</div>
@@ -93,7 +93,7 @@
9393
/>
9494

9595
<p
96-
class="heading-4 mt-4 max-w-[25ch] font-semibold leading-none"
96+
class="heading-4 mt-4 max-w-[25ch] leading-none font-semibold"
9797
>
9898
" {{ p.quote }} "
9999
</p>
@@ -106,10 +106,10 @@
106106
</div>
107107

108108
<div
109-
class="flex max-w-60 flex-wrap gap-3 uppercase leading-[200%]"
109+
class="flex max-w-60 flex-wrap gap-3 leading-[200%] uppercase"
110110
>
111111
<p
112-
class="text-nowrap rounded-full border border-flax-smoke-500 px-3 uppercase text-flax-smoke-600"
112+
class="border-flax-smoke-500 text-flax-smoke-600 rounded-full border px-3 text-nowrap uppercase"
113113
v-for="i in p.tags"
114114
:key="i"
115115
>

src/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ layer(base);
190190
background-color: #000000;
191191
} */
192192

193+
html {
194+
@apply overflow-x-clip;
195+
}
193196
body {
194197
@apply light-theme overflow-x-clip;
195198
}

0 commit comments

Comments
 (0)