<!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>
#test {
animation: change 3s linear 0s infinite;
}
@keyframes change {
0% {
color: #333;
background-color: aqua;
}
50% {
color: #f60;
background-color: #f60;
}
100% {
color: #f00;
background-color: aquamarine;
}
}
</style>
</head>
<body>
<div id="test">这里是内容</div>
</body>
</html>
```xml
<!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 {
position: relative;
}
.test {
position: absolute;
}
.test1 {
top: 100px;
left: 100px;
}
.test2 {
top: 250px;
left: 300px;
}
.test3 {
top: 410px;
left: 320px;
}
.test4 {
top: 320px;
left: 120px;
}
.change {
animation: change 3s linear 0s infinite;
}
@keyframes change {
0% {
opacity: 0;
transform: scale(0.5);
}
25% {
opacity: 0.5;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.5);
}
75% {
opacity: 0.5;
transform: scale(1);
}
100% {
opacity: 0;
transform: scale(0.5);
}
}
</style>
</head>
<body>
<div class="test test1">这里是内容1</div>
<div class="test test2">这里是内容2</div>
<div class="test test3">这里是内容3</div>
<div class="test test4">这里是内容4</div>
<script src="http://localhost:8086/adap/ta/resource/face1.1.0/support/jquery/jquery-1.11.0.min.js"></script>
<script>
let timer = undefined
let timerInter = undefined
timerInter = setInterval(() => {
let timeout = Math.floor(Math.random() * 4 + 1)
if (timer) return
timer = setTimeout(() => {
let index = Math.floor(Math.random() * 4 + 1)
console.log(timeout, index, 'timeouttimeout');
$('.change').removeClass('change')
$('.test' + index).addClass('change')
timer = undefined
}, timeout * 1000);
}, 2000);
</script>
</body>
</html>
```xml
<!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>
.block {
width: 400px;
height: 300px;
padding: 50px;
border: 1px solid red;
}
@keyframes twinkling {
0% {
opacity: 0.2;
opacity: 0.2;
transform: scale(1);
}
50% {
opacity: 0.5;
opacity: 0.5;
transform: scale(1.12);
}
100% {
opacity: 0.2;
opacity: 0.2;
transform: scale(1);
}
}
.circle {
width: 100px;
height: 100px;
border-radius: 50%;
background: #3a96e1;
text-align: center;
font-weight: bold;
position: relative;
line-height: 100px;
z-index: 1;
}
.circle::before {
background: inherit;
content: '';
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: -2;
border-radius: 50%;
animation: twinkling 2.2s ease-in-out infinite;
}
.circle::after {
background: inherit;
content: '';
position: absolute;
width: 110%;
height: 110%;
left: -5%;
top: -5%;
z-index: -1;
border-radius: 50%;
animation: twinkling 2.2s ease-in-out infinite;
}
.circle2 {
margin-top: 50px;
width: 80px;
height: 80px;
line-height: 80px;
font-size: 12px;
background: #d67c61;
}
</style>
</head>
<body>
<div class="block">
<div class="circle">千乐微云</div>
<div class="circle circle2">小程序开发</div>
</div>
</body>
</html>