transition t,u Svelte

Svelte

5/12/2022, 11:44:20 AM

by Leo Voon

When doing custom transition,

If it’s possible to use css instead of tick, do so — CSS animations can run off the main thread, preventing jank on slower devices.

transition = (node: HTMLElement, params: any) => {
	delay?: number,
	duration?: number,
	easing?: (t: number) => number,
	css?: (t: number, u: number) => string,
	tick?: (t: number, u: number) => void
}

t : 0 to 1 1 is natural state

u : is equal to 1 minus t