<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
padding: 0;
margin: 0;
background: url(./west/bg.jpg);
padding-top: 360px;
animation: bj 20s linear infinite;
}
.background {
width: 780px;
background-repeat: no-repeat;
position: absolute;
top: 340px;
left: 340px;
/* margin: 0 auto;
display: flex;
justify-content: center; */
}
@keyframes bj {
from {
background-position: 0 0;
}
to {
background-position: 1920px 0;
}
}
.background div {
overflow: hidden;
float: left;
}
.background div:nth-child(1) {
width: 200px;
}
.background div:nth-child(1) img {
width: 1600px;
animation: wkbj 2s infinite steps(8);
}
.background div:nth-child(2) {
width: 200px;
}
.background div:nth-child(2) img {
width: 1600px;
animation: wkbj 3s infinite steps(8);
}
.background div:nth-child(3) {
width: 170px;
}
.background div:nth-child(3) img {
width: 1360px;
animation: ts 4s infinite steps(8);
}
.background div:nth-child(4) {
width: 210px;
}
.background div:nth-child(4) img {
width: 1680px;
animation: ss 3s infinite steps(8);
}
@keyframes wkbj {
from {
margin-left: 0;
}
to {
margin-left: -1600px;
}
}
@keyframes ts {
from {
margin-left: 0;
}
to {
margin-left: -1360px;
}
}
@keyframes ss {
from {
margin-left: 0;
}
to {
margin-left: -1680px;
}
}
</style>
</head>
<body>
<section class="background">
<div><img src="./west/wk.png" alt=""></div>
<div><img src="./west/bj.png" alt=""></div>
<div><img src="./west/ts.png" alt=""></div>
<div><img src="./west/ss.png" alt=""></div>
</section>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<style>
div {
box-sizing: border-box;
}
.room {
width: 400px;
height: 400px;
background-color: black;
margin: 0 auto;
padding: 50px;
}
.outer {
height: 100%;
width: 100%;
border: 3px solid #777;
border-radius: 50%;
padding: 20px;
}
.inner {
height: 100%;
width: 100%;
border-radius: 50%;
border: 10px solid #FFF;
}
@keyframes small {
from {
padding: 50px;
}
to {
padding: 40px;
}
}
@keyframes big {
0% {
padding: 20px;
}
100% {
padding: 32px;
}
}
.room {
animation-name: small;
animation-duration: 2000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
animation-direction: alternate;
}
.outer {
animation: big 2000ms infinite linear alternate;
}
body div:hover {
animation-play-state: paused;
}
</style>
</head>
<body>
<div class="room">
<div class="outer">
<div class="inner"></div>
</div>
</div>
</body>
</html>