CSS抖音文字效果,文字彩色抖动效果
CSS代码(里面渐变颜色可以自己修改)
.doudong{
animation: uk-text-shadow-glitch .65s cubic-bezier(1,-1.91,0,2.79) 0s infinite normal both running;
}
@keyframes uk-text-shadow-glitch {
0% {
text-shadow: none
}
25% {
text-shadow: -2px -2px 0 #ff004f,2px 2px 0 #00f7ef
}
50% {
text-shadow: 2px -2px 0 #ff004f,-2px 2px 0 #00f7ef
}
75% {
text-shadow: -2px 2px 0 #ff004f,2px -2px 0 #00f7ef
}
100% {
text-shadow: 2px 2px 0 #ff004f,-2px -2px 0 #00f7ef
}
}
@keyframes uk-flicker {
0% {
opacity: 0
}
10% {
opacity: .6;
transform: scale(.8)
}
20% {
opacity: 0
}
40% {
opacity: 1
}
50% {
opacity: .2;
transform: scale(1.1)
}
100% {
opacity: 1;
transform: scale(1)
}
};
}
}
然后在你的标签里加入 class="doudong"
,例如
<h1 class="doudong">欢迎来到MDP BLOG!</h1>
via: https://www.madapang.com/technology/csstiktok.html