mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-15 17:31:25 +08:00
5d9cb2e50d
* refactor: Optimize theme export and add docs * chore: fix lint * chore: fix lint * chore: fix lint
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import { Keyframes } from '@ant-design/cssinjs';
|
|
import type { UploadToken } from '.';
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
|
|
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,
|
|
animationFillMode: 'forwards',
|
|
},
|
|
|
|
[`${inlineCls}-appear, ${inlineCls}-enter`]: {
|
|
animationName: uploadAnimateInlineIn,
|
|
},
|
|
|
|
[`${inlineCls}-leave`]: {
|
|
animationName: uploadAnimateInlineOut,
|
|
},
|
|
},
|
|
},
|
|
uploadAnimateInlineIn,
|
|
uploadAnimateInlineOut,
|
|
];
|
|
};
|
|
|
|
export default genMotionStyle;
|