div+css实现夜间行驶的火车穿越桥梁动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现夜间行驶的火车穿越桥梁动画效果代码

代码标签: 行驶 火车 穿越 桥梁 动画 效果

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    *,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

body {
  font-size: 1.6rem;
  min-height: 100vh;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
  background: #4b4247;
}

.container {
  width: 57rem;
  height: 84rem;
  position: relative;
  box-shadow: 0 0 2.5rem #2b2628;
  overflow: hidden;
}

.moon {
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: #fff8d7;
  box-shadow: 0 0 7rem 7rem rgba(255, 248, 216, 0.2);
  position: absolute;
  top: 5rem;
  left: 8rem;
}

.clouds {
  opacity: 0.4;
}

.cloud {
  display: inline-block;
  width: 10rem;
  height: 3rem;
  background: #918584;
  border-radius: 5rem 3.5rem 3.5rem 1.5rem;
  position: absolute;
  -webkit-animation: cloud-move 50s linear infinite;
          animation: cloud-move 50s linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 3.5rem;
}
.cloud::before {
  width: 4rem;
  height: 4.5rem;
  bottom: 0;
  left: 1.2rem;
}
.cloud::after {
  width: 4rem;
  height: 5rem;
  bottom: 0;
  right: 1.6rem;
}
.cloud:nth-child(1) {
  top: 14rem;
  left: -8rem;
}
.cloud:nth-child(2) {
  top: 26rem;
  left: -20rem;
}
.cloud:nth-child(3) {
  top: 18rem;
  left: -35rem;
}
.cloud:nth-child(4) {
  top: 32rem;
  left: -60rem;
}
.cloud:nth-child(5) {
  top: 20rem;
  left: -70rem;
}

@-webkit-keyframes cloud-move {
  0% {
    -webkit-transform: translateX(-10rem);
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0