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 '.';
|
2022-06-27 14:25:59 +08:00
|
|
|
import type { GenerateStyle } from '../../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-11-19 13:47:33 +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,
|
2022-06-10 17:17:54 +08:00
|
|
|
animationTimingFunction: token.motionEaseInOutCirc,
|
2022-08-01 17:30:14 +08:00
|
|
|
animationFillMode: 'forwards',
|
2022-04-25 18:46:53 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
[`${inlineCls}-appear, ${inlineCls}-enter`]: {
|
|
|
|
animationName: uploadAnimateInlineIn,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${inlineCls}-leave`]: {
|
|
|
|
animationName: uploadAnimateInlineOut,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
uploadAnimateInlineIn,
|
|
|
|
uploadAnimateInlineOut,
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
export default genMotionStyle;
|