Change some $$props.class to shorthands

This commit is contained in:
2022-05-31 10:10:41 +02:00
parent 1a0370b0cd
commit 758c3548d7
2 changed files with 3 additions and 9 deletions

View File

@@ -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}