Complete the code to apply a flip animation on a div using Svelte's built-in transition.
<script> import { [1] } from 'svelte/transition'; </script> <div transition:flip> Flip me! </div>
The flip transition is imported from svelte/transition to enable flip animations.
Complete the code to bind a list of items and animate their position changes with flip.
<script> import { flip } from 'svelte/transition'; let items = ['A', 'B', 'C']; </script> <ul> {#each items as item (item)} <li transition:[1]>{{item}}</li> {/each} </ul>
The flip transition animates the position changes of list items smoothly.
Fix the error in the code to correctly apply flip animation with a duration of 500ms.
<script> import { flip } from 'svelte/transition'; </script> <div transition:flip=[1]> Animated box </div>
The transition directive expects an object with options inside curly braces, like { duration: 500 }.
Fill both blanks to create a flip animation that triggers only when the list changes and lasts 300ms.
<script> import { [1] } from 'svelte/transition'; let list = [1, 2, 3]; </script> <ul> {#each list as num (num)} <li transition:[2]={{ duration: 300 }}>{{num}}</li> {/each} </ul>
Importing and using flip transition with a duration option animates list changes smoothly.
Fill all three blanks to create a flip animation with a custom easing and delay of 100ms.
<script> import { flip } from 'svelte/transition'; import { [1] } from 'svelte/easing'; </script> <div transition:flip={{ duration: 400, easing: [2], delay: [3] }}> Custom flip animation </div>
The easing function cubicIn is imported and used with a delay of 100ms for the flip transition.