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.
53 lines
1.3 KiB
53 lines
1.3 KiB
3 years ago
|
import { Keyframes } from '@ant-design/cssinjs';
|
||
3 years ago
|
import type { UploadToken } from '.';
|
||
2 years ago
|
import type { GenerateStyle } from '../../theme/internal';
|
||
3 years ago
|
|
||
|
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 ===========================
|
||
2 years ago
|
const genMotionStyle: GenerateStyle<UploadToken> = (token) => {
|
||
3 years ago
|
const { componentCls } = token;
|
||
|
const inlineCls = `${componentCls}-animate-inline`;
|
||
|
|
||
|
return [
|
||
|
{
|
||
|
[`${componentCls}-wrapper`]: {
|
||
|
[`${inlineCls}-appear, ${inlineCls}-enter, ${inlineCls}-leave`]: {
|
||
|
animationDuration: token.motionDurationSlow,
|
||
2 years ago
|
animationTimingFunction: token.motionEaseInOutCirc,
|
||
2 years ago
|
animationFillMode: 'forwards',
|
||
3 years ago
|
},
|
||
|
|
||
|
[`${inlineCls}-appear, ${inlineCls}-enter`]: {
|
||
|
animationName: uploadAnimateInlineIn,
|
||
|
},
|
||
|
|
||
|
[`${inlineCls}-leave`]: {
|
||
|
animationName: uploadAnimateInlineOut,
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
uploadAnimateInlineIn,
|
||
|
uploadAnimateInlineOut,
|
||
|
];
|
||
|
};
|
||
|
|
||
|
export default genMotionStyle;
|