* {
box-sizing: border-box;
}
html,
body {
height: 100%;
}
body {
display: grid;
place-content: center;
grid-template-areas: "body";
overflow: hidden;
}
body::before,
body::after {
--size: 150vmax;
--duration: 8s;
content: "";
grid-area: body;
width: var(--size);
height: var(--size);
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
body::before {
-webkit-animation-name: rotate;
animation-name: rotate;
-webkit-animation-duration: var(--duration);
animation-duration: var(--duration);
background: linear-gradient(to left, var(--palette));
}
body::after {
-webkit-animation-name: rotate, fade;
animation-name: rotate, fade;
-webkit-animation-duration: calc(var(--duration) / 2), var(--duration);
animation-duration: calc(var(--duration) / 2), var(--duration);
background: linear-gradient(to right, var(--palette));
}
@-webkit-keyframes rotate {
to {
transform: rotate(1turn);
}
}
@keyframes rotate {
to {
transform: rotate(1turn);
}
}
@-webkit-keyframes fade {
50% {
opacity: 0;
}
}
@keyframes fade {
50% {
opacity: 0;
}
}
下载
https://pan.baidu.com/s/1JMOrFTyQ0l7LIzx5BYcxfQ
提取码
TAGS
视口渐变旋转
视口渐变旋转