feat: 缓动函数加法与乘法

This commit is contained in:
unanmed 2024-10-05 23:23:54 +08:00
parent 4bc4588cde
commit 67d425d4ab

View File

@ -1,3 +1,4 @@
import { TimingFn } from 'mutate-animate';
import { RenderAdapter } from './adapter';
import { FloorViewport } from './preset/viewport';
@ -12,3 +13,17 @@ export function enableViewport() {
if (!adapter) return;
adapter.sync('disable');
}
/**
*
*/
export function AddTiming(timing1: TimingFn, timing2: TimingFn): TimingFn {
return (p: number) => timing1(p) + timing2(p);
}
/**
*
*/
export function multiplyTiming(timing1: TimingFn, timing2: TimingFn): TimingFn {
return (p: number) => timing1(p) * timing2(p);
}