Merge pull request #107 from vadimkorr/feature/#84_Marquee-mode
#84 Validate autoplay duration value, add marquee demo
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user