#84 : Validate autoplay duration value, add marquee demo

This commit is contained in:
Vadim
2022-05-04 22:23:51 +03:00
parent 715b2d3174
commit f505b1a361
2 changed files with 34 additions and 1 deletions

View File

@@ -129,6 +129,39 @@
<Divider />
## Marquee mode!anchorId:marquee-mode;
<Carousel
autoplayDuration={0}
duration={5000}
autoplay
timingFunction="linear"
dots={false}
arrows={false}
swiping={false}
>
{#each colors as { color, text } (color)}
<Color {color} {text} />
{/each}
</Carousel>
```jsx
<Carousel
autoplayDuration={0}
duration={5000}
autoplay
timingFunction="linear"
dots={false}
arrows={false}
swiping={false}
>
{#each colors as { color, text } (color)}
<Color {color} {text} />
{/each}
</Carousel>
```
<Divider />
## Lazy loading of images!anchorId:features-lazy-loading;
<Carousel
let:loaded

View File

@@ -22,7 +22,7 @@ export class ProgressManager {
return new Promise((resolve) => {
this.reset()
const stepMs = Math.min(STEP_MS, this._autoplayDuration)
const stepMs = Math.min(STEP_MS, Math.max(this._autoplayDuration, 1))
let progress = -stepMs
this._interval = setIntervalImmediate(async () => {