feat(ComparisonSlider): add appearance animation to the slider line
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '$shared/shadcn/utils/shadcn-utils';
|
import { cn } from '$shared/shadcn/utils/shadcn-utils';
|
||||||
|
import { cubicOut } from 'svelte/easing';
|
||||||
|
import { fade } from 'svelte/transition';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/**
|
/**
|
||||||
@@ -27,6 +29,7 @@ let { sliderPos, isDragging }: Props = $props();
|
|||||||
)}
|
)}
|
||||||
style:left="{sliderPos}%"
|
style:left="{sliderPos}%"
|
||||||
style:will-change={isDragging ? 'left' : 'auto'}
|
style:will-change={isDragging ? 'left' : 'auto'}
|
||||||
|
in:fade={{ duration: 300, delay: 150, easing: cubicOut }}
|
||||||
>
|
>
|
||||||
<!-- We use part of lucide cursor svg icon as a handle -->
|
<!-- We use part of lucide cursor svg icon as a handle -->
|
||||||
<svg
|
<svg
|
||||||
|
|||||||
Reference in New Issue
Block a user