看到漫川博客mancs.cn里有个加载动画不错,死皮赖脸下找站长要来了。按我自己的垃圾审美改了改,
演示https://www.naigou.cn 额外加了个文字放大的效果 添加到额外css即可
漫川博客源代码
body:after {
content: " ";
position: fixed;
inset: 0;
background-color: white;
z-index: 999;
background-image: url(https://ttimg.cn/logo1.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 20%;
animation: fadeOut 2s;
animation-fill-mode: forwards;
-webkit-transition: fadeOut 2s;
transition: fadeOut 2s;
pointer-events: none;
background-color: #fff;
}
@keyframes fadeOut {
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
画蛇添足版
body:after {
content: " ";
position: fixed;
inset: 0;
background-color: white;
z-index: 999;
background-image: url(https://ttimg.cn/logo1.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 20%;
animation: fadeOut 3s forwards, scaleUp 3s forwards;
pointer-events: none;
}
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes scaleUp {
0% {
background-size: 20%;
}
100% {
background-size: 150%;
}
}