mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-11 23:00:20 +08:00
de2992f96f
* chore: base move * chore: all path * chore: fix script
46 lines
1016 B
TypeScript
46 lines
1016 B
TypeScript
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
|
import { Keyframes } from '@ant-design/cssinjs';
|
|
import type { AliasToken } from '../../theme';
|
|
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
|
import { initMotion } from './motion';
|
|
|
|
export const fadeIn = new Keyframes('antFadeIn', {
|
|
'0%': {
|
|
opacity: 0,
|
|
},
|
|
'100%': {
|
|
opacity: 1,
|
|
},
|
|
});
|
|
|
|
export const fadeOut = new Keyframes('antFadeOut', {
|
|
'0%': {
|
|
opacity: 1,
|
|
},
|
|
'100%': {
|
|
opacity: 0,
|
|
},
|
|
});
|
|
|
|
export const initFadeMotion = (token: TokenWithCommonCls<AliasToken>): CSSInterpolation => {
|
|
const { antCls } = token;
|
|
const motionCls = `${antCls}-fade`;
|
|
|
|
return [
|
|
initMotion(motionCls, fadeIn, fadeOut, token.motionDurationMid),
|
|
{
|
|
[`
|
|
${motionCls}-enter,
|
|
${motionCls}-appear
|
|
`]: {
|
|
opacity: 0,
|
|
animationTimingFunction: 'linear',
|
|
},
|
|
|
|
[`${motionCls}-leave`]: {
|
|
animationTimingFunction: 'linear',
|
|
},
|
|
},
|
|
];
|
|
};
|