利用CSS中的linear-gradient属性和帧动画,实现文字的淡入效果。
css代码 linear-gradient属性
@-webkit-keyframes shinetext {
0% {
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 100%);
color: transparent;
-webkit-background-clip: text;
}
7% {
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 5%, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 0) 100%);
color: transparent;
-webkit-background-clip: text;
}
14% {
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 100%);
color: transparent;
-webkit-background-clip: text;
}
21% {
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 1) <