ant-design/components/upload/style/motion.tsx
二货机器人 de2992f96f
chore: move path (#36243)
* chore: base move

* chore: all path

* chore: fix script
2022-06-27 14:25:59 +08:00

52 lines
1.2 KiB
TypeScript

import { Keyframes } from '@ant-design/cssinjs';
import type { UploadToken } from '.';
import type { GenerateStyle } from '../../theme';
const uploadAnimateInlineIn = new Keyframes('uploadAnimateInlineIn', {
from: {
width: 0,
height: 0,
margin: 0,
padding: 0,
opacity: 0,
},
});
const uploadAnimateInlineOut = new Keyframes('uploadAnimateInlineOut', {
to: {
width: 0,
height: 0,
margin: 0,
padding: 0,
opacity: 0,
},
});
// =========================== Motion ===========================
const genMotionStyle: GenerateStyle<UploadToken> = token => {
const { componentCls } = token;
const inlineCls = `${componentCls}-animate-inline`;
return [
{
[`${componentCls}-wrapper`]: {
[`${inlineCls}-appear, ${inlineCls}-enter, ${inlineCls}-leave`]: {
animationDuration: token.motionDurationSlow,
animationTimingFunction: token.motionEaseInOutCirc,
},
[`${inlineCls}-appear, ${inlineCls}-enter`]: {
animationName: uploadAnimateInlineIn,
},
[`${inlineCls}-leave`]: {
animationName: uploadAnimateInlineOut,
},
},
},
uploadAnimateInlineIn,
uploadAnimateInlineOut,
];
};
export default genMotionStyle;