@ant-design/x
Version:
Craft AI-driven interfaces effortlessly
51 lines (50 loc) • 1.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.blinkMotion = exports.blink = void 0;
var _cssinjs = require("@ant-design/cssinjs");
const blink = exports.blink = new _cssinjs.Keyframes('antXBlink', {
'0%': {
backgroundPositionX: '-200%',
backgroundPositionY: '100%'
},
'25%': {
backgroundPositionX: '-100%',
backgroundPositionY: '100%'
},
'50%': {
backgroundPositionX: '-0%',
backgroundPositionY: '100%'
},
'75%': {
backgroundPositionX: '100%',
backgroundPositionY: '100%'
},
'100%': {
backgroundPositionX: '200%',
backgroundPositionY: '100%'
}
});
const blinkMotion = (token, motionName) => {
const motionCls = motionName;
return [blink, {
[token.componentCls]: {
[motionCls]: {
backgroundClip: 'text',
color: token.colorTextBlinkDefault,
WebkitBackgroundClip: 'text',
// For Safari
backgroundImage: `linear-gradient(90deg,transparent,${token.colorTextBlink},transparent)`,
animationDuration: '1s',
animationIterationCount: 'infinite',
animationTimingFunction: 'linear',
animationFillMode: 'forwards',
backgroundSize: '50%',
backgroundRepeat: 'no-repeat',
animationName: blink
}
}
}];
};
exports.blinkMotion = blinkMotion;