div+css模拟飞船火星登录动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css模拟飞船火星登录动画效果代码

代码标签: 火星 登录 动画 效果

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


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  
  
  
  
<style>
.space {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #435d70;
  overflow: hidden;
}
.space .mars {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
}
.space .mars .tentacle {
  position: absolute;
  top: -60px;
  right: -80px;
  z-index: 1;
  height: 70px;
  width: 70px;
  box-sizing: border-box;
  border-radius: 100%;
  border-left: 15px solid #1aae1e;
  -webkit-transform: rotate(-30deg);
          transform: rotate(-30deg);
  -webkit-animation: tentacle 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
          animation: tentacle 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}
.space .mars .flag {
  position: absolute;
  height: 17px;
  width: 15px;
  top: -57px;
  left: -1px;
  -webkit-animation: flag-pole 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
          animation: flag-pole 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}
.space .mars .flag:before {
  content: "";
  position: absolute;
  height: 17px;
  width: 2px;
  background: #eee;
}
.space .mars .flag:after {
  content: "";
  position: absolute;
  height: 10px;
  width: 14px;
  left: 2px;
  top: 0;
  background: #aaa;
  -webkit-animation: flag-unfurl 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
          animation: flag-unfurl 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}
.space .mars .flag .small-tentacle {
  position: absolute;
  left: -16px;
  top: 3px;
  height: 50px;
  width: 50px;
  border-left: 10px solid #1aae1e;
  border-radius: 100%;
  -webkit-transform: rotate(25deg);
          transform: rotate(25deg);
  -webkit-animation: small-tentacle 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
          animation: small-tentacle 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
  z-index: 2;
}
.space .mars:before {
  content: "";
  position: absolute;
  top: 80px;
  left: -30px;
  height: 10px;
  width: 60px;
  background: rgba(0, 0, 0, 0.2);
  background: #374d5c;
  border-radius: 100%;
}
.space .mars .planet {
  box-sizing: border-box;
  position: absolute;
  border-radius: 100%;
  height: 120px;
  width: 120px;
  overflow: hidden;
  margin-left: -60px;
  margin-top: -60px;
  z-index: 2;
}
.space .mars .planet .surface {
  position: absolute;
  border-radius: 100%;
  height: 140%;
  width: 140%;
  top: -30%;
  right: -10%;
  box-sizing: border-box;
  border: 30px solid rgba(0, 0, 0, 0.15);
  background: #ff5f40;
}
.space .mars .planet .crater1,
.space .mars .planet .crater2,
.space .mars .planet .crater3 {
  position: absolute;
  border-radius: 100%;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.2);
}
.space .mars .planet .crater1 {
  height: 20px;
  width: 20px;
  top: 32%;
  left: 17%;
}
.space .mars .planet .crater2 {
  height: 10px;
  width: 10px;
  top: 26%;
  left: 55%;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2);
}
.space .mars .planet .crater3 {
  height: 10px;
  width: 10px;
  top: 60%;
  left: 40%;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2);
}
.space .ship {
  position: absolute;
  right: 50%;
  top: 50%;
  margin-top: -55px;
  margin-right: -55px;
  height: 22px;
  background: rgba(0, 0, 0, 0.1);
  -webkit-transform-origin: 0% 100% 0;
          transform-origin: 0% 100% 0;
  z-index: 1;
  -webkit-animation: ship 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
          animation: ship 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}
.space .ship .ship-rotate {
  position: absolute;
  height: 22px;
  -webkit-transform: rotate(-110deg);
          transform: rotate(-110deg);
  -webkit-animation: ship-rotate 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
          animation: ship-rotate 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}
.space .ship .pod {
  position: absolute;
  top: 0;
  left: -8px;
  height: 16px;
  width: 16px;
  background: #eee;
  border-radius: 100% 0 100% 0;
  -webkit-transform: rotate(-45deg);
          transform: rotate(-45deg);
}
.space .ship .fuselage {
  position: absolute;
  top: 14px;
  left: -6px;
  height: 8px;
  width: 12px;
  background: #eee;
  border-radius: 100% 100% 0 0;
}
.space .ship .fuselage:after {
  content: "";
  position: absolute;
  left: 2px;
  top: 100%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid red;
}
.space .ship-shadow {
  position: absolute;
  right: 10%;
  top: 50%;
  margin-right: -28px;
  margin-top: 83px;
  height: 4px;
  width: 16px;
  background: #374d5c;
  border-radius: 100%;
  -webkit-animation: ship-shadow 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
          animation: ship-shadow 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}

@-webkit-keyframes small-tentacle {
  0% {
    -webkit-transform: rotate(-60deg);
            transform: rotate(-60deg);
  }
  86% {
    -webkit-transform: rotate(-60deg);
            transform: rotate(-60deg);
  }
  89% {
    -webkit-transform: rotate(10deg);
            transform: rotate(10deg);
  }
  100% {
    -webkit-transform: rotate(10deg);
            transform: rotate(10deg);
  }
}

@keyframes small-tentacle {
  0% {
    -webkit-transform: rotate(-60deg);
            transform: rotate(-60deg);
  }
  86% {
    -webkit-transform: rotate(-60deg);
            transform: rotate(-60deg);
  }
  89% {
    -webkit-transform: rotate(10deg);
            transform: rotate(10deg);
  }
  100% {
    -webkit-transform: rotate(10deg);
            transform: rotate(10deg);
  }
}
@-webkit-keyframes tentacle {
  0% {
    -webkit-transform: rotate(-30de.........完整代码请登录后点击上方下载按钮下载查看

网友评论0