动画渐变:
<div id="moiveAnimation" style="background: linear-gradient(-45deg, #990066, #FFCC00, #CC0033);background-size: 500% 500%;"></div>
let moiveAnimation = document.querySelector('#moiveAnimation')
let myMoiveAnimation =
@keyframes moiveAnimation {
0% {
background-position: 0% 50%
}
50% {
background-position: 100% 50%
}
100% {
background-position: 0% 50%
}
}
document.styleSheets[0].insertRule(myMoiveAnimation)
moiveAnimation.style.animationDuration = '10'
moiveAnimation.style.animationIterationCount = 'infinite'
moiveAnimation.style.animationName = 'moiveAnimation'
移除:document.styleSheets[0].deleteRule(0)
字体渐变:
background-image: linear-gradient(to right, #990066, #FFCC00, #CC0033);
-webkit-background-clip: text;
color: transparent;
vue动画渐变色
最新推荐文章于 2023-07-31 10:15:07 发布