Skip to content

Commit 590b446

Browse files
committed
Refactor Slider.svelte to simplify class binding and enhance stopAnimation handling
1 parent 0ab3d2e commit 590b446

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/routes/landing/Slider.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@
5353
<img
5454
src={image}
5555
alt={title}
56-
class={[
57-
'size-full object-cover translate-x-[calc(-1_*_var(--slide))] transform-gpu shrink-0 motion-safe:transition-transform motion-safe:duration-300',
58-
stopAnimation && 'motion-safe:transition-none motion-safe:duration-0'
59-
]}
56+
class="size-full object-cover translate-x-[calc(-1_*_var(--slide))] transform-gpu shrink-0 motion-safe:transition-transform motion-safe:duration-300"
57+
class:stopAnimation
6058
/>
6159
{/each}
6260
</div>
@@ -80,3 +78,9 @@
8078
{/each}
8179
</ul>
8280
</div>
81+
82+
<style>
83+
.stopAnimation {
84+
transition: none !important;
85+
}
86+
</style>

0 commit comments

Comments
 (0)