Change some $$props.class to shorthands
This commit is contained in:
@@ -18,17 +18,11 @@
|
||||
|
||||
|
||||
/** Navigate to specific slide */
|
||||
const goToSlide = (index: number = 0) => {
|
||||
carousel.scrollTo(index)
|
||||
}
|
||||
const goToSlide = (index: number = 0) => carousel.scrollTo(index)
|
||||
|
||||
/** Move and change arrow direction when moving */
|
||||
const arrowPosition = writable({ x: 0, y: 0 })
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/** Move arrow and define direction on mousemove */
|
||||
const handleArrowMove = (event: MouseEvent) => {
|
||||
const { left, top, width } = carouselEl.getBoundingClientRect()
|
||||
@@ -88,7 +82,7 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="carousel {$$props.class ? $$props.class : ''}">
|
||||
<div class="carousel {$$props.class ?? ''}">
|
||||
{#if slides.length}
|
||||
<div class="carousel__viewport" bind:this={carouselEl}
|
||||
on:mousemove={handleArrowMove}
|
||||
|
||||
Reference in New Issue
Block a user