0
0
Svelteframework~10 mins

Crossfade for list items in Svelte - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the crossfade function from Svelte's transition module.

Svelte
import { [1] } from 'svelte/transition';
Drag options to blanks, or click blank then click option'
Afade
Bslide
Cfly
Dcrossfade
Attempts:
3 left
💡 Hint
Common Mistakes
Importing 'fade' instead of 'crossfade'.
Forgetting to import from 'svelte/transition'.
2fill in blank
medium

Complete the code to create crossfade functions with default parameters.

Svelte
const [[1], send] = crossfade({});
Drag options to blanks, or click blank then click option'
Acrossfade
Breceive
Cfade
Dsend
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of send and receive.
Using 'fade' or 'crossfade' as variable names.
3fill in blank
hard

Fix the error in the list item transition directive to use the correct crossfade function.

Svelte
<li transition:[1]={{key}}>{{item}}</li>
Drag options to blanks, or click blank then click option'
Aslide
Bsend
Creceive
Dfade
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'send' instead of 'receive' in the transition directive.
Using 'fade' which is a different transition.
4fill in blank
hard

Fill both blanks to correctly apply crossfade transitions for list items leaving and entering.

Svelte
<li out:[1]={{key}} in:[2]={{key}}>{{item}}</li>
Drag options to blanks, or click blank then click option'
Asend
Breceive
Cfade
Dslide
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping send and receive functions.
Using 'fade' or 'slide' instead of crossfade functions.
5fill in blank
hard

Fill all three blanks to create a crossfade with custom duration and easing.

Svelte
const [receive, send] = crossfade({ duration: [1], easing: [2], fallback: [3] });
Drag options to blanks, or click blank then click option'
A400
BcubicInOut
C() => {}
D200
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong duration values.
Not providing a fallback function.
Using incorrect easing function names.