Skip to content

Commit

Permalink
fix: duration speed and custom gap bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Selemon Dev committed Feb 13, 2024
1 parent 650ab25 commit 9f787e9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/lib/Marquee.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
</script>

<div
{...$$restProps}
class={cn('group flex gap-[1rem] overflow-hidden', {
class={cn(`group flex gap-[1rem] overflow-hidden ${$$restProps.class}`, {
'flex-row': direction === 'left',
'flex-col': direction !== 'left',
})}
}
)}
style={`mask-image: ${
fade
? `linear-gradient(${
Expand Down
36 changes: 25 additions & 11 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
content:
"I'm thoroughly impressed with Marquee's performance and ease of use. It made implementing complex scrolling texts a breeze, and the support for TypeScript is top-notch.",
},
{
name: 'Sofia Garcia',
title: 'UI/UX Designer',
Expand Down Expand Up @@ -75,7 +76,7 @@ import "@selemondev/svelte-marquee/dist/style.css";`;
<div>Content 2</div>
<div>Content 3</div>
</Marquee>`;
const customGapAndSpeedSnippet = `<Marquee innerClassName="gap-[3rem] [--duration:5s] [--gap:3rem]" fade={true}>
const customGapAndSpeedSnippet = `<Marquee class="gap-[3rem] [--duration:5s] [--gap:3rem]" innerClassName="gap-[3rem]" fade={true}>
<div>Content 1</div>
<div>Content 2</div>
<div>Content 3</div>
Expand Down Expand Up @@ -292,17 +293,30 @@ import "@selemondev/svelte-marquee/dist/style.css";`;
<div class="space-y-1">
<h3 class="font-semibold">Custom gap and speed</h3>
<Marquee
innerClassName="gap-[3rem] [--duration:5s] [--gap:3rem]"
class="gap-[3rem] [--duration:5s] [--gap:3rem]"
innerClassName="gap-[3rem]"
fade={true}
>
{#each testimonials as testimonial (testimonial.name)}
<Card
avatar={testimonial.avatar}
name={testimonial.name}
title={testimonial.title}
content={testimonial.content}
/>
{/each}
<img
alt="Logo"
src="https://www.vectorlogo.zone/logos/google/google-ar21.svg"
/>
<img
alt="Logo"
src="https://www.vectorlogo.zone/logos/microsoft/microsoft-ar21.svg"
/>
<img
alt="Logo"
src="https://www.vectorlogo.zone/logos/apple/apple-ar21.svg"
/>
<img
alt="Logo"
src="https://www.vectorlogo.zone/logos/oracle/oracle-ar21.svg"
/>
<img
alt="Logo"
src="https://www.vectorlogo.zone/logos/reactjs/reactjs-ar21.svg"
/>
</Marquee>
</div>
<div class="space-y-1">
Expand All @@ -322,7 +336,7 @@ import "@selemondev/svelte-marquee/dist/style.css";`;
<div>Disable animation when user device prefers reduced motion.</div>
<Marquee
class="py-4 motion-reduce:overflow-auto"
innerclass="motion-reduce:animate-none motion-reduce:first:hidden"
innerClassName="motion-reduce:animate-none motion-reduce:first:hidden"
>
{#each testimonials as testimonial (testimonial.name)}
<Card
Expand Down

0 comments on commit 9f787e9

Please sign in to comment.