Files
video-gen/video-gen-admin/node_modules/antd/lib/style/motion/motion.js
T
2026-05-25 17:08:18 +08:00

39 lines
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.initMotion = void 0;
const initMotionCommon = duration => ({
animationDuration: duration,
animationFillMode: 'both'
});
const initMotion = (motionCls, inKeyframes, outKeyframes, duration, sameLevel = false) => {
const sameLevelPrefix = sameLevel ? '&' : '';
return {
[`
${sameLevelPrefix}${motionCls}-enter,
${sameLevelPrefix}${motionCls}-appear
`]: {
...initMotionCommon(duration),
animationPlayState: 'paused'
},
[`${sameLevelPrefix}${motionCls}-leave`]: {
...initMotionCommon(duration),
animationPlayState: 'paused'
},
[`
${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active,
${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active
`]: {
animationName: inKeyframes,
animationPlayState: 'running'
},
[`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: {
animationName: outKeyframes,
animationPlayState: 'running',
pointerEvents: 'none'
}
};
};
exports.initMotion = initMotion;