2022-04-25 18:46:53 +08:00
|
|
|
import { Keyframes } from '@ant-design/cssinjs';
|
2022-05-19 10:06:58 +08:00
|
|
|
import type { UploadToken } from '.';
|
|
|
|
import type { GenerateStyle } from '../../_util/theme';
|
2022-04-25 18:46:53 +08:00
|
|
|
|
|
|
|
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 ===========================
|
2022-05-19 10:06:58 +08:00
|
|
|
const genMotionStyle: GenerateStyle<UploadToken> = token => {
|
2022-04-25 18:46:53 +08:00
|
|
|
const { componentCls } = token;
|
|
|
|
const inlineCls = `${componentCls}-animate-inline`;
|
|
|
|
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
|
[`${inlineCls}-appear, ${inlineCls}-enter, ${inlineCls}-leave`]: {
|
|
|
|
animationDuration: token.motionDurationSlow,
|
|
|
|
animationFillMode: token.motionEaseInOutCirc,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${inlineCls}-appear, ${inlineCls}-enter`]: {
|
|
|
|
animationName: uploadAnimateInlineIn,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${inlineCls}-leave`]: {
|
|
|
|
animationName: uploadAnimateInlineOut,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
uploadAnimateInlineIn,
|
|
|
|
uploadAnimateInlineOut,
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
export default genMotionStyle;
|