div+css实现三维地铁车厢效果代码

代码语言:html

所属分类:三维

代码描述:div+css实现三维地铁车厢效果代码

代码标签: div css 三维 地铁 车厢

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

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

<head>
  <meta charset="UTF-8">
  




  <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@100&amp;display=swap'>
  
<style>
body {
  background: #000;
}

.train-art {
  transform: translate(-250px, -100px);
}

.background-section .sky {
  top: -300px;
  left: -1000px;
  width: 2500px;
  height: 800px;
  background: linear-gradient(to bottom, #FFC371, #FF5F6D);
  transform: translate3d(0, 0, -500px);
}
.background-section .sun {
  width: 50px;
  height: 50px;
  background: #ff0;
  border-radius: 100%;
  transform: translate3d(250px, -50px, -500px);
  filter: drop-shadow(0 0 20px #ff0) blur(2px);
}
.background-section .pole {
  top: -300px;
  width: 20px;
  height: 800px;
  background: linear-gradient(90deg, #444, #000);
  transform: translate3d(0, 0, -200px);
  -webkit-animation: pole 2000ms linear infinite;
          animation: pole 2000ms linear infinite;
}

@-webkit-keyframes pole {
  0% {
    transform: translate3d(-500px, 0, -200px);
  }
  50% {
    transform: translate3d(1000px, 0, -200px);
  }
  100% {
    transform: translate3d(1000px, 0, -200px);
  }
}

@keyframes pole {
  0% {
    transform: translate3d(-500px, 0, -200px);
  }
  50% {
    transform: translate3d(1000px, 0, -200px);
  }
  100% {
    transform: translate3d(1000px, 0, -200px);
  }
}
.back-section .screen {
  background: #000;
}
.back-section .screen.-top {
  left: -500px;
  top: -500px;
  width: 1500px;
  height: 500px;
  transform: translate3d(0, 0, -110px);
}
.back-section .screen.-bottom {
  left: -500px;
  top: 200px;
  width: 1500px;
  height: 500px;
  transform: translate3d(0, 0, -110px);
}
.back-section .screen.-left {
  left: -500px;
  top: -500px;
  width: 500px;
  height: 1200px;
  transform: translate3d(0, 0, -110px);
}
.back-section .screen.-right {
  left: 500px;
  top: -500px;
  width: 500px;
  height: 1200px;
  transform: translate3d(0, 0, -110px);
}
.back-section .body .panel {
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.back-section .body .panel.-top {
  width: 500px;
  height: 40px;
  background: #e7e3d9;
  transform: translateZ(-100px);
}
.back-section .body .panel.-windowleft {
  width: 70px;
  height: 200px;
  background: #e7e3d9;
  transform: translate3d(150px, 0, -100px);
}
.back-section .body .panel.-windowright {
  width: 40px;
  height: 200px;
  background: #e7e3d9;
  transform: translate3d(460px, 0, -100px);
}
.back-section .body .panel.-windowbottom {
  width: 330px;
  height: 80px;
  background: #e7e3d9;
  transform: translate3d(170px, 120px, -100px);
}
.back-section .body .panel.-doorleft {
  width: 30px;
  height: 200px;
  background: #e7e3d9;
  transform: translate3d(0, 0, -100px);
}
.back-section .body .panel.-bottomleft {
  width: 30px;
  height: 10px;
  background: #c3bca6;
  transform: translate3d(0, 195px, -105px) rotateX(-90deg);
}
.back-section .body .panel.-bottomright {
  width: 350px;
  height: 10px;
  background: #c3bca6;
  transform: translate3d(150px, 195px, -105px) rotateX(-90deg);
}
.back-section .body .windowthickness {
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.back-section .body .windowthickness.-top {
  width: 240px;
  height: 10px;
  background: #b8b2a4;
  transform: translate3d(220px, 35px, -105px) rotateX(-90deg);
}
.back-section .body .windowthickness.-bottom {
  width: 240px;
  height: 10px;
  background: #f2ecdd;
  transform: translate3d(220px, 115px, -105px) rotateX(90deg);
}
.back-section .body .windowthickness.-left {
  width: 10px;
  height: 80px;
  background: #d7cfbe;
  transform: translate3d(215px, 40px, -105px) rotateY(90deg);
}
.back-section .body .windowthickness.-right {
  width: 10px;
  height: 80px;
  background: #d7cfbe;
  transform: translate3d(455px, 40px, -105px) rotateY(-90deg);
}
.back-section .body .bodythickness {
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.back-section .body .bodythickness.-left {
  width: 10px;
  height: 200px;
  background: #d7cfbe;
  transform: translate3d(-5px, 0, -105px) rotateY(-90deg);
}
.back-section .body .bodythickness.-right {
  width: 10px;
  height: 200px;
  background: #d7cfbe;
  transform: translate3d(495px, 0, -105px) rotateY(90deg);
}
.back-section .door.-left {
  transform: translate3d(30px, 40px, -100px);
}
.back-section .door.-right {
  transform: translate3d(90px, 40px, -100px);
}
.back-section .door .panel {
  background: #ccc;
  background: linear-gradient(180deg, #c0c0c0 0, #f2f2f2 60px, #c0c0c0 120px);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.back-section .door .panel.-top {
  width: 60px;
  height: 10px;
}
.back-section .door .panel.-left {
  width: 10px;
  height: 160px;
}
.back-section .door .panel.-right {
  width: 10px;
  height: 160px;
  transform: translateX(50px);
}
.back-section .door .panel.-bottom {
  width: 60px;
  height: 160px;
  -webkit-clip-path: polygon(0 80px, 100% 80px, 100% 105%, 0 105%);
          clip-path: polygon(0 80px, 100% 80px, 100% 105%, 0 105%);
}
.back-section .door .panel.-doorbottom {
  width: 60px;
  height: 4px;
  background: #999;
  transform: translate3d(0, 158px, -2px) rotateX(-90deg);
}
.back-section .door .thickness {
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.back-section .door .thickness.-top {
  width: 40px;
  height: 4px;
  background: #888;
  transform: translate3d(10px, 8px, -2px) rotateX(-90deg);
}
.back-section .door .thickness.-bottom {
  width: 40px;
  height: 4px;
  background: #ddd;
  transform: translate3d(10px, 78px, -2px) rotateX(90deg);
}
.back-section .door .thickness.-left {
  width: 4px;
  height: 70px;
  background: #aaa;
  transform: translate3d(8px, 10px, -2px) rotateY(90deg);
}
.back-section .door .thickness.-right {
  width: 4px;
  height: 70px;
  background: #aaa;
  transform: translate3d(48px, 10px, -2px) rotateY(-90deg);
}
.back-section .doors {
  transform: translate3d(0, 0, -2px);
}
.back-section .doorpocket.-top {
  width: 120px;
  height: 10px;
  background: #3b3a36;
  transform: translate3d(30px, 35px, -105px) rotateX(-90deg);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.back-section .doorpocket.-bottom {
  width: 120px;
  height: 10px;
  background: #3b3a36;
  transform: translate3d(30px, 195px, -105px) rotateX(90deg);
}
.back-section .doorpocket.-left {
  width: 10px;
  height: 160px;
  background: #65625a;
  transform: translate3d(25px, 40px, -105px) rotateY(90deg);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.back-section .doorpocket.-right {
  width: 10px;
  height: 160px;
  background: #65625a;
  transform: translate3d(145px, 40px, -105px) rotateY(-90deg);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}

.floor-section .panel {
  width: 500px;
  height: 140px;
  background: repeating-radial-gradient(ellipse at right top, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.02) 10px), linear-gradient(0deg, #c1c2c6, #a2a29e);
  transform: translate3d(0px, 130px, -30px) rotateX(90deg);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}

.ceiling-section .panel {
  width: 500px;
  height: 140px;
  background: linear-gradient(0deg, #afaca4, #bebbb5);
  transform: translate3d(0px, -70px, -30px) rotateX(-90deg);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}

.seat-section .cussion {
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.seat-section .cussion.-back {
  width: 320px;
  height: 44px;
  background: linear-gradient(180deg, #26294f 0%, rgba(81, 99, 166, 0) 50%, rgba(81, 99, 166, 0.5) 100%), repeating-linear-gradient(90deg, #313a65 0, #26294f 10px, #26294f 30px, #313a65 40px);
  transform: translate3d(180px, 129.7px, -87px) rotateX(10deg);
}
.seat-section .cussion.-backtop {
  width: 320px;
  height: 10px;
  background: #2c2f57;
  transform: translate3d(180px, 125px, -95px) rotateX(90deg);
}
.seat-section .cussion.-top {
  width: 320px;
  height: 40px;
  background: linear-gradient(180deg, #26294f 0%, rgba(81, 99, 166, 0) 50%, rgba(81, 99, 166, 0.5) 100%), repeating-linear-gradient(90deg, #313a65 0, #26294f 10px, #26294f 30px, #313a65 40px);
  transform: translate3d(180px, 150px, -65px) rotateX(90deg);
}
.seat-section .cussion.-front {
  width: 320px;
  height: 10px;
  background: linear-gradient(0deg, rgba(81, 99, 166, 0) 50%, rgba(81, 99, 166, 0.5) 100%), repeating-linear-gradient(90deg, #313a65 0, #26294f 10px, #26294f 30px, #313a65 40px);
  transform: translate3d(180px, 170px, -45px);
}
.seat-section .cussion.-bottom {
  width: 320px;
  height: 10px;
  background: #00a;
  transform: translate3d(180px, 175px, -50px) rotateX(-90deg);
}
.seat-section .mecha.-front {
  width: 320px;
  height: 22.3px;
  background: repeating-linear-gradient(90deg, #666 0, #666 1px, rgba(0, 0, 0, 0) 1.1px, rgba(0, 0, 0, 0) 1.3px), repeating-linear-gradient(0deg, #666 0, #666 1px, #000 2px, #000 3px);
  transform: translate3d(180px, 179px, -59px) rotateX(-22deg);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  border: 3px solid #666;
  box-sizing: border-box;
}
.seat-section .mecha.-front::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 60%);
}
.seat-section .mecha.-front::before {
  content: "";
  position: absolute;
  left: calc(50% - 3px);
  width: 6px;
  height: 100%;
  background: #666;
}
.seat-section .mecha.-bottom {
  width: 320px;
  height: 37px;
  background: #222;
  transform: translate3d(180px, 181.6px, -82px) rotateX(-90deg);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.seat-section .shadow {
  width: 320px;
  height: 30px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
  transform: translate3d(180px, 185px, -50px) rotateX(90deg);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.seat-section .side {
  width: 60px;
  height: 100px;
  background: radial-gradient(ellipse at left top, white, #cccccc);
  border-radius: 80% 0 0 0;
}
.seat-section .side.-left {
  transform: translate3d(150px, 100px, -70px) rotateY(90deg);
}
.seat-section .side.-right {
  transform: translate3d(470px, 100px, -70px) rotateY(90deg);
}

.info-section .panel {
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.info-section .panel.-top {
  width: 500px;
  height: 31px;
  background: #fff;
  transform: translate3d(0, -15.5px, -94.4px) rotateX(90deg);
}
.info-section .panel.-front {
  width: 500px;
  height: 30px;
  background: linear-gradient(0deg, #d1cdc4, #bfbbb2);
  transform: translate3d(0, -4.5px, -89.4px) rotateX(-45deg);
}
.info-section .panel.-left {
  width: 21px;
  height: 21.5px;
  background: #d7cfbe;
  -webkit-clip-path: polygon(0 0, 100% 0, 0 100%);
          clip-path: polygon(0 0, 100% 0, 0 100%);
  transform: translate3d(-10.5px, 0, -90px) rotateY(-90deg);
}
.info-section .panel.-right {
  width: 21px;
  height: 21.5px;
  background: #d7cfbe;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%);
          clip-path: polygon(0 0, 100% 0, 100% 100%);
  transform: translate3d(489.5px, 0, -90px) rotateY(90deg);
}

.shelf-section .pillar {
  width: 4px;
  height: 110px;
  background-image: linear-gradient(0deg, #555555, rgba(85, 85, 85, 0)), linear-gradient(90deg, #555, #fff);
  border-radius: 99px;
}
.shelf-section .pillar.-left {
  transform: translate3d(178px, 34px, -45px) rotateY(90deg) rotateZ(10deg);
}
.shelf-section .pillar.-right {
  transform: translate3d(498px, 34px, -45px) rotateY(90deg) rotateZ(10deg);
}
.shelf-section .pillar::before {
  content: "";
  position: absolute;
  bottom: -12px;
  width: 100%;
  height: 15px;
  border-radius: 99px;
  background: #555;
  transform-origin: 50% 2px;
  transform: rotateZ(-50deg);
}
.shelf-section .pillar.-center {
  height: 145px;
  transform: translate3d(338px, 34px, -42px) rotateY(90deg) rotateZ(10deg);
}
.shelf-section .pillar.-center::before {
  bottom: -37px;
  height: 40px;
  transform: rotateZ(-80deg);
}
.shelf-section .line {
  width: 320px;
  height: 3px;
  background: linear-gradient(0deg, #555, #fff);
}
.shelf-section .line.-line1 {
  transform: translate3d(180px, 35px, -55px);
}
.shelf-section .line.-line2 {
  transform: translate3d(180px, 35px, -63px);
}
.shelf-section .line.-line3 {
  transform: translate3d(180px, 35px, -71px);
}
.shelf-section .line.-line4 {
  transform: translate3d(180px, 35px, -79px);
}
.shelf-section .line.-line5 {
  transform: translate3d(180px, 35px, -88px);
}
.shelf-section .line.-line6 {
  transform: translate3d(180px, 35px, -87px);
}
.shelf-section .arm {
  width: 50px;
  height: 3px;
  background: linear-gradient(0deg, #555, #fff);
}
.shelf-section .arm.-left {
  transform: translate3d(155px, 35px, -80px) rotateY(90deg);
}
.shelf-section .arm.-right {
  transform: translate3d(475px, 35px, -80px) rotateY(90deg);
}
.shelf-section .arm.-center {
  transform: translate3d(312px, 35px, -80px) rotateY(90deg);
}

.strap-section .arm {
  width: 500px;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0