0
0
Svelteframework~10 mins

Why transitions enhance user experience in Svelte - Test Your Understanding

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

Complete the code to import the built-in fade transition in Svelte.

Svelte
import { [1] } from 'svelte/transition';
Drag options to blanks, or click blank then click option'
Ascale
Bslide
Cfly
Dfade
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a transition that moves elements instead of fading.
Forgetting to import the transition before using it.
2fill in blank
medium

Complete the code to apply a fade transition when the paragraph appears.

Svelte
<p transition:[1]>{{message}}</p>
Drag options to blanks, or click blank then click option'
Afade
Bslide
Cfly
Dscale
Attempts:
3 left
💡 Hint
Common Mistakes
Using a transition that was not imported.
Forgetting the colon after 'transition'.
3fill in blank
hard

Fix the error in the code to correctly use the fade transition with a duration of 500ms.

Svelte
<div transition:fade=[1]>{{content}}</div>
Drag options to blanks, or click blank then click option'
A[duration=500]
B{duration: 500}
Cduration: 500
D(duration: 500)
Attempts:
3 left
💡 Hint
Common Mistakes
Passing parameters without curly braces.
Using incorrect brackets or parentheses.
4fill in blank
hard

Fill both blanks to create a fade transition that lasts 300ms and delays start by 100ms.

Svelte
<section transition:fade=[1]>{{text}}</section>
Drag options to blanks, or click blank then click option'
A{duration: 100, delay: 300}
B{delay: 100, duration: 300}
C{duration: 300, delay: 100}
D{delay: 300, duration: 100}
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping duration and delay values.
Using wrong brackets or missing commas.
5fill in blank
hard

Fill all three blanks to create a fade transition with duration 400ms, easing 'cubicInOut', and delay 50ms.

Svelte
<div transition:fade=[1]>{{content}}</div>
Drag options to blanks, or click blank then click option'
A{duration: 400, easing: cubicInOut, delay: 50}
C{delay: 50, duration: 400, easing: cubicInOut}
D{duration: 400, delay: 50, easing: cubicInOut}
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around easing function name.
Missing commas between properties.
Using parentheses or brackets instead of curly braces.