diff --git a/src/components/Carousel/Carousel.svelte b/src/components/Carousel/Carousel.svelte
index 569c574..b25c4a2 100644
--- a/src/components/Carousel/Carousel.svelte
+++ b/src/components/Carousel/Carousel.svelte
@@ -129,8 +129,8 @@
}
})
- function handlePageChange(event) {
- showPage(event.detail + Number(infinite), { offsetDelay: 0, animated: true })
+ function handlePageChange(pageIndex) {
+ showPage(pageIndex + Number(infinite), { offsetDelay: 0, animated: true })
}
function offsetPage(animated) {
@@ -225,12 +225,12 @@
name="dots"
currentPageIndex={originalCurrentPageIndex}
pagesCount={originalPagesCount}
- showPage={pageIndex => showPage(pageIndex, { offsetDelay: 0, animated: true })}
+ showPage={handlePageChange}
>
handlePageChange(event.detail)}
>
{/if}
diff --git a/src/components/Dot/Dot.svelte b/src/components/Dot/Dot.svelte
index ec87eae..e2606af 100644
--- a/src/components/Dot/Dot.svelte
+++ b/src/components/Dot/Dot.svelte
@@ -2,10 +2,10 @@
import { tweened } from 'svelte/motion';
import { cubicInOut } from 'svelte/easing';
- const sizePx = 5
- const sizeCurrentPx = 8
+ const DOT_SIZE_PX = 5
+ const ACTIVE_DOT_SIZE_PX = 8
- const size = tweened(sizePx, {
+ const size = tweened(DOT_SIZE_PX, {
duration: 250,
easing: cubicInOut
});
@@ -16,14 +16,14 @@
export let active = false
$: {
- size.set(active ? sizeCurrentPx : sizePx)
+ size.set(active ? ACTIVE_DOT_SIZE_PX : DOT_SIZE_PX)
}
+ {#each Array(pagesCount) as _, pageIndex (pageIndex)}
+ showPage(pageIndex)}
+ >
+ {/each}
+
+ {#each colors as { color, text } (color)}
+
+ {/each}
+
+
+```jsx
+
+
+ {#each Array(pagesCount) as _, pageIndex (pageIndex)}
+ showPage(pageIndex)}
+ >
+ {/each}
+
+ {#each colors as { color, text } (color)}
+
+ {/each}
+
+```
+
+
+
## Use case
@@ -309,4 +353,13 @@ Slot props:
transform: rotate(-45deg);
left: -4px;
}
+
+ /* custom dots */
+ .custom-dots {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: center;
+ padding: 0 20px;
+ }
\ No newline at end of file
diff --git a/src/docs/components/CustomDot.svelte b/src/docs/components/CustomDot.svelte
new file mode 100644
index 0000000..66aaa09
--- /dev/null
+++ b/src/docs/components/CustomDot.svelte
@@ -0,0 +1,45 @@
+
+
+
+ {symbol}
+
+
+
\ No newline at end of file