Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Step.svelte
<script>
import { tweened } from 'svelte/motion'
import { quartInOut } from 'svelte/easing'
import { onMount } from 'svelte'
import { get } from 'svelte/store'
import Step from './Step.svelte'
const easing = quartInOut
const duration = 1000
const timeline = [
{
label: '#1',
tween: tweened(0, {duration: 1000, easing})
},
{
label: '#2',
tween: tweened(0, {duration: 1000, easing})
},
{
label: '#3',
tween: tweened(0, {duration: 1000, easing})
},
{
label: '#4',
tween: tweened(0, {duration: 1000, easing})
}
]
const pos = tweened(0, {duration: duration * timeline.length})
let current
let mode = 'playing'
$: currentIndex = Math.floor($pos)
$: current = timeline[currentIndex]
$: {
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */