css实现小船漂浮在海浪中的动画效果
代码语言:html
所属分类:动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<html>
<head>
<meta charset="UTF-8"><title>HTML5</title>
<style>
.ship-wrap {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
border-radius: 50%;
overflow: hidden;
width: 600px;
height: 600px;
background-color: #aae7ff;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.ship-wrap .wave {
position: absolute;
width: 1200px;
-webkit-transform-origin: center center;
transform-origin: center center;
}
.ship-wrap .wave:before {
content: "";
position: absolute;
left: 0;
top: -10px;
right: 0;
background-repeat: repeat;
height: 10px;
background-size: 20px 20px;
background-image: -webkit-radial-gradient(10px -5px circle, rgba(0, 0, 0, 0) 12px, #91b9ff 12px);
background-image: radial-gradient(circle at 10px -5px, rgba(0, 0, 0, 0) 12px, #91b9ff 12px);
}
.ship-wrap .wave:after {
content: "";
position: absolute;
left: 0;
top: -15px;
right: 0;
background-repeat: repeat;
height: 15px;
background-size: 40px 20px;
background-image: -webkit-radial-gradient(10px 15px circle, #91b9ff 12px, rgba(0, 0, 0, 0) 13.04348px);
background-image: radial-gradient(circle at 10px 15px, #91b9ff 12px, rgba(0, 0, 0, 0) 13.04348px);
}
.ship-wrap .wave1 {
height: 600px;
background-color: #91b9ff;
opacity: .8;
-webkit-animation: wave 115s ease-in-out infinite;
animation: wave1 15s ease-in-out infinite;
bottom: -461.53846px;
z-index: 3;
}
.ship-wrap .wave2 {
height: 600px;
background-color: #91b9ff;
opacity: .4;
left: -30%;
-webkit-animation: wave220s ease-out infinite;
animation: wave2 20s ease-out infinite;
bottom: -444.44444px;
z-index: 1;
}
.ship-wrap .main {
width: 150px;
height: 33.33333px;
background-color: #684000;
position: absolute;
left: 0;
right: 0;
margin: auto;
bot.........完整代码请登录后点击上方下载按钮下载查看
网友评论0