1.演示地址
https://animista.net/play/background/bg-pan
2.代码
.bg-pan-left {
background-image: linear-gradient(
90deg,#3e91cc,#2dcca7);
background-size: 200%;
background-repeat: repeat;
animation: bg-pan-right 1.2s infinite both;
animation-direction: alternate;
}
@keyframes bg-pan-left {
0% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}