《2018年12月11日》【连续433天】
标题:动画实例:海岸;
内容:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
html, body {
width: 100%;
height: 100%;
background-color: #009BB2;
}
.sun {
width: 100px;
height: 100px;
margin: 50px;
position: relative;
}
.sun::before, .sun::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 50px;
height: 50px;
background: rgba(255,255,255,.8);
border-radius: 50%;
animation: sun 2s infinite;
}
.sun::after {
width: 80px;
height: 80px;
background: rgba(255, 255, 255, 0.6);
animation: sun 3s infinite;
}
img {
width: 100%;
height: auto;
position: absolute;
left: 0;
bottom: 0;
}
img {
animation: move 2s linear infinite;
}
img:last-child {
animation: move 2s linear 1s infinite;
}
@keyframes move {
0% {
bottom: 0;
}
50% {
bottom: -50px;
}
100% {
bottom: 0;
}
}
@keyframes sun {
0% {
box-shadow: 0px 0px 5px rgba(255,255,255,.7);
transform: translate(-50%,-50%)scale(1);
}
50% {
box-shadow: 0px 0px 30px rgba(255,255,255,.7);
transform: translate(-50%,-50%)scale(1.1);
}
100% {
box-shadow: 0px 0px 5px rgba(255,255,255,.7);
transform: translate(-50%,-50%) scale(1);
}
}
</style>
</head>
<body>
<div class="sun"></div>
<img src="images/1.png" alt="">
<img src="images/2.png" alt="">
</body>
</html>