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: 1000px;
}

div {
  position: absolute;
  transform-style: preserve-3d;
  background: linear-gradient(45deg, #938d7f 0%, #c5bfb1 100%);
  box-sizing: border-box;
  will-change: transform;
}

.window {
  background: rgba(0, 100, 255, 0.3);
}

#truck {
  -webkit-animation: drive 10000ms linear infinite;
          animation: drive 10000ms linear infinite;
}
#truck .body {
  width: 100px;
  transform: translate(200px, -100px) translateZ(100px);
}
#truck .shadow {
  width: 160px;
  height: 210px;
  background: #aaaaaa;
  transform-origin: 50% 100%;
  transform: translate(-30px, -130px) translateZ(20px) rotateX(90deg);
  filter: blur(0px);
  box-shadow: 0 0 35px 25px white inset;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
#truck .cockpit {
  -webkit-animation: bounce 600ms ease-out infinite alternate;
          animation: bounce 600ms ease-out infinite alternate;
}
#truck .cockpit .front {
  width: 100px;
  height: 50px;
}
#truck .cockpit .back {
  width: 100px;
  height: 75px;
  transform: translate(0, -50px) translateZ(-50px);
}
#truck .cockpit .top {
  width: 100px;
  height: 25px;
  transform-origin: 50% 100%;
  transform: translate(0, -75px) translateZ(-25px) rotateX(90deg);
}
#truck .cockpi.........完整代码请登录后点击上方下载按钮下载查看

网友评论0