接續昨天
https://www.youtube.com/watch?v=W8RPE_CyTug&t=221s
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>測試</title>
<link href="C1.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="LD ONE">
<span></span>
<span></span>
</div>
<div class="LD TWO">
<span></span>
<span></span>
</div>
</div>
</body>
</html>
CSS
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
background: #EDFCFF;
}
.container{
width: 100%;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
.container .LD{
position: relative;
width: 150px;
height: 150px;
margin: 100px;
}
.container .LD.ONE span{ /*.LD.ONE 中間不能有空格*/
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
background: rgb(50, 220, 220);
border-radius: 50%;
animation: AM ease-in-out 2s infinite;
}
.container .LD.ONE span:nth-child(2){ /*.LD.ONE 中間不能有空格*/
left: 50%;
background: rgba(50, 220, 220,0.15);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
animation-delay: -1s;
}
@keyframes AM{
0%,100%{ /*循環動畫不卡頓的關鍵*/
transform: translateX(-80px);
}
50%{
transform: translateX(80px);
}
}
今天先這樣,明天找別的