svelte/animate
import { function flip(node: Element, { from, to }: {
from: DOMRect;
to: DOMRect;
}, params?: FlipParams): AnimationConfig
The flip function calculates the start and end position of an element and animates between them, translating the x and y values.
flip
stands for First, Last, Invert, Play.
flip } from 'svelte/animate';
flip
flip
函式會計算元素的開始和結束位置,並在它們之間產生動畫,轉換 x 和 y 值。flip
代表 First, Last, Invert, Play。
function flip(
node: Element,
{
from,
to
}: {
from: DOMRect;
to: DOMRect;
},
params?: FlipParams
): AnimationConfig;
AnimationConfig
interface AnimationConfig {…}
delay?: number;
duration?: number;
easing?: (t: number) => number;
css?: (t: number, u: number) => string;
tick?: (t: number, u: number) => void;
FlipParams
interface FlipParams {…}
delay?: number;
duration?: number | ((len: number) => number);
easing?: (t: number) => number;
上一個 下一個