You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.3 KiB
33 lines
1.3 KiB
import { IPopAnimConfig, IPopRevealConfig, PopStaggerPreset } from './PopAnimTypes';
|
|
|
|
/** ConfigRes 常用组合 */
|
|
export const POP_ANIM = {
|
|
standard: { mask: 'dimFast', center: 'scale', close: 2 } as IPopAnimConfig,
|
|
bounce: { mask: 'dimFast', center: 'bounce', close: 2 } as IPopAnimConfig,
|
|
maskOnly: { mask: 'dim', center: 'none', close: 2 } as IPopAnimConfig,
|
|
rootFade: { mask: 'root', center: 'none', close: 2 } as IPopAnimConfig,
|
|
none: { mask: 'none', center: 'none', close: 1 } as IPopAnimConfig,
|
|
};
|
|
|
|
export function popAnimOnce(base: IPopAnimConfig): IPopAnimConfig {
|
|
return { ...base, once: true };
|
|
}
|
|
|
|
/**
|
|
* 签到式:面板弹入 + 列表项隐藏后分帧出现 + 按钮最后出
|
|
* @param itemsNode 列表容器名,或配合 itemNodes
|
|
* @param lastNodes 列表播完后再出现的按钮节点名
|
|
*/
|
|
export function popReveal(
|
|
itemsNodeOrNodes: string | string[],
|
|
lastNodes?: string[],
|
|
itemsPreset: PopStaggerPreset = 'scale',
|
|
): IPopAnimConfig {
|
|
const reveal: IPopRevealConfig = { itemsPreset, lastPreset: 'scale', lastNodes };
|
|
if (Array.isArray(itemsNodeOrNodes)) {
|
|
reveal.itemNodes = itemsNodeOrNodes;
|
|
} else {
|
|
reveal.itemsNode = itemsNodeOrNodes;
|
|
}
|
|
return { ...POP_ANIM.bounce, reveal };
|
|
}
|
|
|