页面加载动画效果
如图所示:
如果有不足的地方也请指出,一定虚心接受和改正。
命名有点不规范,之后会注意的。
HTML代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="./css/1234.css">
<link rel="stylesheet" href="css/ying.css">
</head>
<body>
<!-- 小球 -->
<div class="move">
<span style="--i:1;"></span>
<span style="--i:2;"></span>
<span style="--i:3;"></span>
<span style="--i:4;"></span>
<span style="--i:5;"></span>
<span style="--i:6;"></span>
<span style="--i:7;"></span>
<span style="--i:8;"></span>
</div>
<!-- 这个放音乐 -->
<audio controls="controls" loop="loop" autoplay="autoplay">
<source src="yin/h.mp3" type="audio/mpeg" />
<source src="yin/h.ogg" type="audio/ogg" />
</audio>
<div class="pu">
<h3>ladding...</h3>
</div>
<svg>
<filter id="ok">
<feGaussianBlur in="SourceGranphic" stdDeviation="10" />
<feColorMatrix values="
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 50 -10
" />
</filter>
</svg>
</body>
</html>
第一个css文件代码:
* {
margin: auto;
padding: 0 auto;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #000000;
}
body::-webkit-scrollbar {
display: none;
}
svg {
width: 0;
height: 0;
}
.move {
position: relative;
width: 420px;
height: 420px;
/* filter: url(#ok); */
}
.move span {
position: absolute;
top: -110px;
left: 0;
width: 100%;
height: 100%;
display: block;
animation: move 4s ease-in-out infinite;
animation-delay: calc(0.2s * var(--i));
}
.move span::before {
content: "";
position: absolute;
top: 0;
left: calc(50% - 20px);
width: 70px;
height: 70px;
border-radius: 50%;
box-shadow: 0 0 15px #55aaff;
filter: blur(1px);
animation-fill-mode: forwards;
background: linear-gradient(#ffffff, #57cdff, #55aaff);
}
@keyframes move {
0% {
transform: rotate(0deg);
}
50%,
100% {
transform: rotate(360deg);
}
}
第二个css文件代码:
*
{
margin: 0;
padding: 0;
}
audio
{
display: none;
width: 100px;
height: 80px;
background-color: #57CDFF;
}
.pu
{
position: absolute;
width: 300px;
height: 80px;
top: 700px;
left: auto;
right: auto;
border-radius: 25px;
background: linear-gradient(#ffffff,#6ab7ff,#00aaff,#00aaff);
}
div
{
margin: 180px auto;
}
h3
{
font-size: 36px;
text-align: center;
margin-top: 18px;
/* font-family: "estrangelo edessa"; */
color: black;
}