three+css实现一个三维排队直升机旋转动画效果代码

代码语言:html

所属分类:三维

代码描述:three+css实现一个三维排队直升机旋转动画效果代码

代码标签: 三维 排队 直升机 旋转 动画 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
<style>
.cuboid {
  width: 100%;
  height: 100%;
  position: relative;
}
.cuboid__side:nth-of-type(1) {
  height: calc(var(--thickness) * 1vmin);
  width: 100%;
  position: absolute;
  top: 0;
  transform: translate(0, -50%) rotateX(90deg);
}
.cuboid__side:nth-of-type(2) {
  height: 100%;
  width: calc(var(--thickness) * 1vmin);
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(50%, -50%) rotateY(90deg);
}
.cuboid__side:nth-of-type(3) {
  width: 100%;
  height: calc(var(--thickness) * 1vmin);
  position: absolute;
  bottom: 0;
  transform: translate(0%, 50%) rotateX(90deg);
}
.cuboid__side:nth-of-type(4) {
  height: 100%;
  width: calc(var(--thickness) * 1vmin);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%) rotateY(90deg);
}
.cuboid__side:nth-of-type(5) {
  height: 100%;
  width: 100%;
  transform: translate3d(0, 0, calc(var(--thickness) * 0.5vmin));
  position: absolute;
  top: 0;
  left: 0;
}
.cuboid__side:nth-of-type(6) {
  height: 100%;
  width: 100%;
  transform: translate3d(0, 0, calc(var(--thickness) * -0.5vmin)) rotateY(180deg);
  position: absolute;
  top: 0;
  left: 0;
}
*,
*:after,
*:before {
  box-sizing: border-box;
  transform-style: preserve-3d;
  transition: background 0.25s;
}
:root {
  --base-size: 20;
  --helicopter-height: calc(var(--base-size) * 1vmin);
  --helicopter-width: calc(var(--helicopter-height) * 2);
  --helicopter-one: hsl(0, 0%, calc((60 + (var(--on, 0) * 35)) * 1%));
  --helicopter-two: hsl(0, 0%, calc((55 + (var(--on, 0) * 35)) * 1%));
  --helicopter-three: hsl(0, 0%, calc((50 + (var(--on, 0) * 35)) * 1%));
  --helicopter-four: hsl(0, 0%, calc((40 + (var(--on, 0) * 35)) * 1%));
  --chair-one: hsl(0, 0%, calc((20 + (var(--on, 0) * 15)) * 1%));
  --chair-two: hsl(0, 0%, calc((15 + (var(--on, 0) * 15)) * 1%));
  --chair-three: hsl(0, 0%, calc((10 + (var(--on, 0) * 15)) * 1%));
  --chair-four: hsl(0, 0%, calc((5 + (var(--on, 0) * 15)) * 1%));
  --dash-one: hsl(0, 0%, calc((50 + (var(--on, 0) * 15)) * 1%));
  --dash-two: hsl(0, 0%, calc((45 + (var(--on, 0) * 15)) * 1%));
  --dash-three: hsl(0, 0%, calc((40 + (var(--on, 0) * 15)) * 1%));
  --dash-four: hsl(0, 0%, calc((35 + (var(--on, 0) * 15)) * 1%));
  --accent-one: hsl(10, 60%, calc((30 + (var(--on, 0) * 35)) * 1%));
  --accent-two: hsl(10, 60%, calc((25 + (var(--on, 0) * 35)) * 1%));
  --accent-three: hsl(10, 60%, calc((20 + (var(--on, 0) * 35)) * 1%));
  --accent-four: hsl(10, 60%, calc((15 + (var(--on, 0) * 35)) * 1%));
  --rocket-one: hsl(1, 60%, calc((20 + (var(--on, 0) * 25)) * 1%));
  --rocket-two: hsl(1, 60%, calc((15 + (var(--on, 0) * 25)) * 1%));
  --rocket-three: hsl(1, 60%, calc((10 + (var(--on, 0) * 25)) * 1%));
  --rocket-four: hsl(1, 60%, calc((5 + (var(--on, 0) * 25)) * 1%));
  --screen-one: hsla(210, 80%, calc((25 + (var(--on, 0) * 25)) * 1%), 0.45);
  --screen-two: hsla(210, 80%, calc((25 + (var(--on, 0) * 25)) * 1%), 0.4);
  --screen-three: hsla(210, 80%, calc((25 + (var(--on, 0) * 25)) * 1%), 0.35);
  --screen-four: hsla(210, 80%, calc((25 + (var(--on, 0) * 25)) * 1%), 0.35);
  --bg: hsl(210, 80%, calc((15 + (var(--on, 0) * 75)) * 1%));
}
body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  overflow: hidden;
  touch-action: non.........完整代码请登录后点击上方下载按钮下载查看

网友评论0