css实现夏日海中冲浪划船动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现夏日海中冲浪划船动画效果代码

代码标签: 海中 冲浪 划船 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
    body {
  background: #fff;
  height: 100vh;
  overflow: hidden;
  display: flex;
  font-family: "Anton", sans-serif;
  justify-content: center;
  align-items: center;
  perspective: 500px;
}

div {
  transform-style: preserve-3d;
}

.sea {
  position: absolute;
  left: -300px;
  top: -300px;
}
.sea .surface {
  position: absolute;
  height: 600px;
  width: 600px;
  background: #2BE3FA;
  overflow: hidden;
  -webkit-animation: surface 13000ms ease-in-out infinite alternate, rotateZ 20000ms linear infinite;
          animation: surface 13000ms ease-in-out infinite alternate, rotateZ 20000ms linear infinite;
}
.sea .surface .inner {
  width: 600px;
  height: 600px;
  animation: rotateZ 20000ms linear infinite reverse;
}

.ship {
  position: absolute;
  top: -15px;
  left: -50px;
  filter: drop-shadow(-30px 40px 0 rgba(0, 0, 0, 0.1));
}
.ship .rotate {
  transform: rotateZ(10deg);
  -webkit-animation: ship 30000ms linear infinite alternate;
          animation: ship 30000ms linear infinite alternate;
}
.ship .human {
  position: absolute;
  top: 0;
  left: 40px;
}
.ship .human .hat {
  position: absolute;
  width: 30px;
  height: 30px;
  background: #F0F09E;
  border-radius: 100%;
  -webkit-animation: hat 1000ms ease-in-out infinite alternate;
          animation: hat 1000ms ease-in-out infinite alternate;
}
.ship .human .hat::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 16px;
  height: 16px;
  border: 1px solid #D9845D;
  border-radius: 100%;
  box-sizing: border-box;
  transform: translateZ(5px);
  transform-style: preserve-3d;
}
.ship .human .leg {
  position: absolute;
  width: 20px;
  height: 8px;
  background: #0849A3;
  border-radius: 40%;
}
.ship .human .leg::before {
  content: "";
  position: absolute;
  left: -4px;
  width: 5px;
  height: 7px;
  background: #fff;
  border-radius: 40%;
}
.ship .human .leg.-left {
  top: 16px;
  left: -10px;
  transform: rotateZ(-5deg);
}
.ship .human .leg.-left::before {
  top: 1px;
}
.ship .human .leg.-right {
  top: 6px;
  left: -10px;
  transform: rotateZ(5deg);
}
.ship .human .leg.-right::before {
  top: -1px;
}
.ship .body {
  position: relative;
}
.ship .body .base {
  width: 100px;
  height: 30px;
  background: #D9845D;
  border-radius: 45% 45% 45% 45%;
}
.ship .body .base::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 96px;
  height: 26px;
  background: #DEAD5E;
  border-radius: 100%;
  border-radius: 45% 45% 45% 45%;
}
.ship .body .board {
  position: absolute;
  top: 5px;
  width: 10px;
  height: 20px;
  background: #D9845D;
  border-radius: 2px;
}
.ship .body .board.-front {
  right: 20px;
}
.ship .body .board.-back {
  left: 20px;
}
.ship .body .waves {
  position: absolute;
}
.ship .body .waves .wave {
  position: absolute;
  -webkit-animation: wave 2000ms linear infinite;
          animation: wave 2000ms linear infinite;
}
.ship .body .waves .wave .graphic {
  background: #fff;
  -webkit-animation: surface 2000ms ease-in-out infinite alternate, rotateZ 6000ms linear infinite;
          animation: surface 2000ms ease-in-out infinite alternate, rotateZ 6000ms linear infinite;
}
.ship .body .waves .bodywaves .wave:nth-child(1) {
  top: 2px;
  left: 13px;
  -webkit-animation-delay: -1597ms;
          animation-delay: -1597ms;
}
.ship .body .waves .bodywaves .wave:nth-child(1) .graphic {
  width: 11px;
  height: 12px;
}
.ship .body .waves .bodywaves .wave:nth-child(2) {
  top: -1px;
  left: 37px;
  -webkit-animation-delay: -1835ms;
          animation-delay: -1835ms;
}
.ship .body .waves .bodywaves .wave:nth-child(2) .graphic {
  width: 18px;
  height: 12px;
}
.ship .body .waves .bodywaves .wave:nth-child(3) {
  top: 11px;
  left: 43px;
  -webkit-animation-delay: -797ms;
          animation-delay: -797ms;
}
.ship .body .waves .bodywaves .wave:nth-child(3) .graphic {
  width: 11px;
  height: 12px;
}
.ship .body .waves .bodywaves .wave:nth-child(4) {
  top: 7px;
  left: 25px;
  -webkit-animation-delay: -3146ms;
          animation-delay: -3146ms;
}
.ship .body .waves .bodywaves .wave:nth-child(4) .graphic {
  width: 9px;
  height: 17px;
}
.ship .body .waves .bodywaves .wave:nth-child(5) {
  top: -2px;
  left: 47px;
  -webkit-animation-delay: -3741ms;
          animation-delay: -3741ms;
}
.ship .body .waves .bodywaves .wave:nth-child(5) .graphic {
  width: 11px;
  height: 14px;
}
.ship .body .waves .bodywaves .wave:nth-child(6) {
  top: 15px;
  left: 49px;
  -webkit-animation-delay: -3107ms;
          animation-delay: -3107ms;
}
.ship .body .waves .bodywaves .wave:nth-child(6) .graphic {
  width: 11px;
  height: 16px;
}
.ship .body .waves .bodywaves .wave:nth-child(7) {
  top: 13px;
  left: 27px;
  -webkit-animation-delay: -2166ms;
          animation-delay: -2166ms;
}
.ship .body .waves .bodywaves .wave:nth-child(7) .graphic {
  width: 13px;
  height: 11px;
}
.ship .body .waves .bodywaves .wave:nth-child(8) {
  top: 10px;
  left: 54px;
  -webkit-animation-delay: -3821ms;
          animation-delay: -3821ms;
}
.ship .body .waves .bodywaves .wave:nth-child(8) .graphic {
  width: 13px;
  height: 14px;
}
.ship .body .waves .bodywaves .wave:nth-child(9) {
  top: 9px;
  left: 45px;
  -webkit-animation-delay: -3382ms;
          animation-delay: -3382ms;
}
.ship .body .waves .bodywaves .wave:nth-child(9) .graphic {
  width: 16px;
  height: 16px;
}
.ship .body .waves .bodywaves .wave:nth-child(10) {
  top: -2px;
  left: 37px;
  -webkit-animation-delay: -1815ms;
          animation-delay: -1815ms;
}
.ship .body .waves .bodywaves .wave:nth-child(10) .graphic {
  width: 11px;
  height: 15px;
}
.ship .body .waves .bodywaves .wave:nth-child(11) {
  top: -2px;
  left: 46px;
  -webkit-animation-delay: -3339ms;
          animation-delay: -3339ms;
}
.ship .body .waves .bodywa.........完整代码请登录后点击上方下载按钮下载查看

网友评论0