vue+css实现万圣节三维南瓜头可旋转效果代码

代码语言:html

所属分类:三维

代码描述:vue+css实现万圣节三维南瓜头可旋转效果代码

代码标签: vue css 万圣节 三维 南瓜头 可旋转

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


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

<head>

  <meta charset="UTF-8">

  
  <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Inconsolata&amp;display=swap'>
  
<style>
body {
  height: 100vh;
  margin: 0;
  background: linear-gradient(#1c0033, #0d0e11 50%);
  overflow: hidden;
  font-family: Inconsolata, monospace, sans-serif;
}
body * {
  box-sizing: border-box;
}
body #app {
  height: 100vh;
}
body details {
  margin: 1em 0 0 1em;
  color: white;
  z-index: 2;
  position: relative;
  cursor: pointer;
  position: absolute;
}
body #view {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 500px;
  border: 0;
  outline: 0;
}
body #view * {
  transform-style: preserve-3d;
}
body #view #scene #space {
  position: relative;
  display: grid;
  grid-template-areas: "overlap";
  transform-style: preserve-3d;
  justify-content: center;
  align-items: flex-end;
  transform: rotateX(-20deg) rotateY(20deg);
  font-size: calc(5vh + 1vw);
  transform-origin: center 90%;
  -pointer-events: none;
}
body #view #scene #space > * {
  grid-area: overlap;
}
body #view #scene #space .absolute {
  position: absolute;
}
body #view #scene #space .reference {
  transform-style: preserve-3d;
  display: grid;
  grid-template-areas: "overlap";
}
body #view #scene #space .reference > * {
  grid-area: overlap;
  transform-origin: top left;
  align-items: end;
}
body #view #scene #space .group {
  position: absolute;
  bottom: 0;
  transform-origin: bottom left;
  transform: translateX(calc(var(--posX))) translateY(calc(var(--posY) * -1)) translateZ(var(--posZ)) rotateX(var(--rotX)) rotateY(var(--rotY)) rotateZ(var(--rotZ));
}
body #view #scene #space .group > .reference {
  align-items: end;
}
body #view #scene #space .group.shaded > .reference .cuboid > .front, body #view #scene #space .group.shaded > .reference .cuboid > .back {
  filter: brightness(0.9);
}
body #view #scene #space .group.shaded > .reference .cuboid > .left, body #view #scene #space .group.shaded > .reference .cuboid > .right {
  filter: brightness(0.8);
}
body #view #scene #space .group.shaded > .reference .cuboid > .bottom {
  filter: brightness(0.7);
}
body #view #scene #space .cuboid,
body #view #scene #space .plane {
  position: absolute;
  bottom: 0;
  transform-origin: bottom left;
  width: var(--sizeX);
  height: var(--sizeY);
  transform: translateX(var(--posX)) translateY(calc(var(--posY) * -1)) translateZ(var(--posZ)) rotateX(var(--rotX)) rotateY(var(--rotY)) rotateZ(var(--rotZ));
  align-items: start;
}
body #view #scene #space .cuboid.test > *, body #view #scene #space .cuboid.plane.test,
body #view #scene #space .plane.test > *,
body #view #scene #space .plane.plane.test {
  border: solid 1px black;
  background: linear-gradient(#f005, #00f5);
  box-shadow: 0 0 0 1px #0005;
}
body #view #scene #space .cuboid.test > *.top, body #view #scene #space .cuboid.plane.test.top,
body #view #scene #space .plane.test > *.top,
body #view #scene #space .plane.plane.test.top {
  background: radial-gradient(circle, #fff 5%, #f0f5 20%);
}
body #view #scene #space .cuboid.test > *.bottom, body #view #scene #space .cuboid.plane.test.bottom,
body #view #scene #space .plane.test > *.bottom,
body #view #scene #space .plane.plane.test.bottom {
  background: radial-gradient(circle, #000 5%, #0f05 20%);
}
body #view #scene #space .cuboid.test > *.back, body #view #scene #space .cuboid.plane.test.back,
body #view #scene #space .plane.test > *.back,
body #view #scene #space .plane.plane.test.back {
  background: radial-gradient(circle, #f00 5%, #0000 20%), linear-gradient(#f005, #00f5);
}
body #view #scene #space .cuboid.plane.overflow, body #view #scene #space .cuboid.overflow > *,
body #view #scene #space .plane.plane.overflow,
body #view #scene #space .plane.overflow > * {
  box-shadow: 0 0 0 0.5px currentColor;
}
body #view #scene #space .cuboid._top > .top, body #view #scene #space .cuboid._bottom > .bottom, body #view #scene #space .cuboid._right > .right, body #view #scene #space .cuboid._left > .left, body #view #scene #space .cuboid._front > .front, body #view #scene #space .cuboid._back > .back,
body #view #scene #space .plane._top > .top,
body #view #scene #space .plane._bottom > .bottom,
body #view #scene #space .plane._right > .right,
body #view #scene #space .plane._left > .left,
body #view #scene #space .plane._front > .front,
body #view #scene #space .plane._back > .back {
  display: none;
}
body #view #scene #space .cuboid.plane.color, body #view #scene #space .cuboid.color > *,
body #view #scene #space .plane.plane.color,
body #view #scene #space .plane.color > * {
  background-color: currentColor;
}
body #view #scene #space .cuboid > *,
body #view #scene #space .plane > * {
  position: absolute;
}
body #view #scene #space .cuboid .top,
body #view #scene #space .plane .top {
  height: var(--sizeZ);
  width: var(--sizeX);
  transform: rotateX(90deg);
}
body #view #scene #space .cuboid .bottom,
body #view #scene #space .plane .bottom {
  height: var(--sizeZ);
  width: var(--sizeX);
  transform: translateY(var(--sizeY)) rotateX(90deg);
}
body #view #scene #space .cuboid .left,
body #view #scene #space .plane .left {
  height: var(--sizeY);
  width: var(--sizeZ);
  transform: rotateY(-90deg);
}
body #view #scene #space .cuboid .right,
body #view #scene #space .plane .right {
  height: var(--sizeY);
  width: var(--sizeZ);
  transform: translateX(var(--sizeX)) rotateY(-90deg);
}
body #view #scene #space .cuboid .front,
body #view #scene #space .plane .front {
  width: var(--sizeX);
  height: var(--sizeY);
  transform: translateZ(var(--sizeZ));
}
body #view #scene #space .cuboid .back,
body #view #scene #space .plane .back {
  width: var(--sizeX);
  height: var(--sizeY);
}
body #view #scene #space .cuboid.shaded.plane.front, body #view #scene #space .cuboid.shaded.plane.back, body #view #scene #space .cuboid.shaded > .front, body #view #scene #space .cuboid.shaded > .back,
body #view #scene #space .plane.shaded.plane.front,
body #view #scene #space .plane.shaded.plane.back,
body #view #scene #space .plane.shaded > .front,
body #view #scene #space .plane.shaded > .back {
  filter: brightness(0.9);
}
body #view #scene #space .cuboid.shaded.plane.left, body #view #scene #space .cuboid.shaded.plane.right, body #view #scene #space .cuboid.shaded > .left, body #view #scene #space .cuboid.shaded > .right,
body #view #scene #space .plane.shaded.plane.left,
body #view #scene #space .plane.shaded.plane.right,
body #view #scene #space .plane.shaded > .left,
body #view #scene #space .plane.shaded > .right {
  filter: brightness(0.8);
}
body #view #scene #space .cuboid.shaded.plane.top, body #view #scene #space .cuboid.shaded.plane.bottom, body #view #scene #space .cuboid.shaded > .top, body #view #scene #space .cuboid.shaded > .bottom,
body #view #scene #space .plane.shaded.plane.top,
body #view #scene #space .plane.shaded.plane.bottom,
body #view #scene #space .plane.shaded > .top,
body #view #scene #space .plane.shaded > .bottom {
  filter: brightness(0.7);
}
body #view #scene #space .frustum {
  position: absolute;
  bottom: 0;
  transform-origin: bottom left;
  width: var(--sizeX);
  height: var(--sizeY);
  transform: translateX(var(--posX)) translateY(calc(var(--posY) * -1)) translateZ(var(--posZ)) rotateX(var(--rotX)) rotateY(var(--rotY)) rotateZ(var(--rotZ));
  align-items: start;
}
body #view #scene #space .frustum.test > * {
  border: solid 1px black;
  background: linear-gradient(#f005, #00f5);
  box-shadow: 0 0 0 1px #0005;
}
body #view #scene #space .frustum.test > *.top {
  background: radial-gradient(circle, #fff 5%, #f0f5 20%);
}
body #view #scene #space .frustum.test > *.bottom {
  background: radial-gradient(circle, #000 5%, #0f05 20%);
}
body #view #scene #space .frustum.test > *.back {
  background: radial-gradient(circle, #f00 5%, #0000 20%), linear-gradient(#f005, #00f5);
}
body #view #scene #space .frustum.overflow > * {
  box-shadow: 0 0 0 0.5px currentColor;
}
body #view #scene #space .frustum.overflow > *.left {
  -webkit-clip-path: polygon(calc(var(--lrTopL) - 1px) calc(0% - 1px), calc(var(--lrTopR) + 1px) calc(0% - 1px), calc(var(--lrBotR) + 1px) calc(100% + 1px), calc(var(--lrBotL) - 1px) calc(100% + 1px));
          clip-path: polygon(calc(var(--lrTopL) - 1px) calc(0% - 1px), calc(var(--lrTopR) + 1px) calc(0% - 1px), calc(var(--lrBotR) + 1px) calc(100% + 1px), calc(var(--lrBotL) - 1px) calc(100% + 1px));
}
body #view #scene #space .frustum.overflow > *.right {
  -webkit-clip-path: polygon(calc(var(--lrTopL) - 1px) calc(0% - 1px), calc(var(--lrTopR) + 1px) calc(0% - 1px), calc(var(--lrBotR) + 1px) calc(100% + 1px), calc(var(--lrBotL) - 1px) calc(100% + 1px));
          clip-path: polygon(calc(var(--lrTopL) - 1px) calc(0% - 1px), calc(var(--lrTopR) + 1px) calc(0% - 1px), calc(var(--lrBotR) + 1px) calc(100% + 1px), calc(var(--lrBotL) - 1px) calc(100% + 1px));
}
body #view #scene #space .frustum.overflow > *.front {
  -webkit-clip-path: polygon(calc(var(--fbTopL) - 1px) calc(0% - 1px), calc(var(--fbTopR) + 1px) calc(0% - 1px), calc(var(--fbBotR) + 1px) calc(100% + 1px), calc(var(--fbBotL) - 1px) calc(100% + 1px));
          clip-path: polygon(calc(var(--fbTopL) - 1px) calc(0% - 1px), calc(var(--fbTopR) + 1px) calc(0% - 1px), calc(var(--fbBotR) + 1px) calc(100% + 1px), calc(var(--fbBotL) - 1px) calc(100% + 1px));
}
body #view #scene #space .frustum.overflow > *.back {
  -webkit-clip-path: polygon(calc(var(--fbTopL) - 1px) calc(0% - 1px), calc(var(--fbTopR) + 1px) calc(0% - 1px), calc(var(--fbBotR) + 1px) calc(100% + 1px), calc(var(--fbBotL) - 1px) calc(100% + 1px));
          clip-path: polygon(calc(var(--fbTopL) - 1px) calc(0% - 1px), calc(var(--fbTopR) + 1px) calc(0% - 1px), calc(var(--fbBotR) + 1px) calc(100% + 1px), calc(var(--fbBotL) - 1px) calc(100% + 1px));
}
body #view #scene #space .frustum._top > .top, body #view #scene #space .frustum._bottom > .bottom, body #view #scene #space .frustum._right > .right, body #view #scene #space .frustum._left > .left, body #view #scene #space .frustum._front > .front, body #view #scene #space .frustum._back > .back {
  display: none;
}
body #view #scene #space .frustum.color > * {
  background-color: currentColor;
}
body #view #scene #space .frustum > * {
  position: absolute;
}
body #view #scene #space .frustum .top {
  height: var(--topZ);
  width: var(--topX);
  transform: translateX(var(--offsetX)) translateZ(var(--offsetZ)) rotateX(90deg);
}
body #view #scene #space .frustum .bottom {
  height: var(--botZ);
  width: var(--botX);
  transform: translateY(var(--height)) rotateX(90deg);
}
body #view #scene #space .frustum .left {
  -webkit-clip-path: polygon(var(--lrTopL) 0%, var(--lrTopR) 0%, var(--lrBotR) 100%, var(--lrBotL) 100%);
          clip-path: polygon(var(--lrTopL) 0%, var(--lrTopR) 0%, var(--lrBotR) 100%, var(--lrBotL) 100%);
  height: var(--leftHeight);
  width: var(--lrSideWidth);
  transform: translateX(var(--offsetX)) translateZ(var(--lrPos)) rotateY(-90deg) rotateX(var(--lFaceAngle));
}
body #view #scene #space .frustum .right {
  -webkit-clip-path: polygon(var(--lrTopL) 0%, var(--lrTopR) 0%, var(--lrBotR) 100%, var(--lrBotL) 100%);
          clip-path: polygon(var(--lrTopL) 0%, var(--lrTopR) 0%, var(--lrBotR) 100%, var(--lrBotL) 100%);
  height: var(--rightHeight);
  width: var(--lrSideWidth);
  transform: translateX(calc(var(--botX) + var(--revOffsetX))) translateZ(var(--lrPos)) rotateY(-90deg) rotateX(var(--rFaceAngle));
}
body #view #scene #space .frustum .front {
  -webkit-clip-path: polygon(var(--fbTopL) 0%, var(--fbTopR) 0%, var(--fbBotR) 100%, var(--fbBotL) 100%);
          clip-path: polygon(var(--fbTopL) 0%, var(--fbTopR) 0%, var(--fbBotR) 100%, var(--fbBotL) 100%);
  height: var(--frontHeight);
  width: var(--fbSideWidth);
  transform: translateX(var(--fbPos)) translateZ(calc(var(--offsetZ) + var(--topZ))) rotateX(var(--fFaceAngle));
}
body #view #scene #space .frustum .back {
  -webkit-clip-path: polygon(var(--fbTopL) 0%, var(--fbTopR) 0%, var(--fbBotR) 100%, var(--fbBotL) 100%);
          clip-path: polygon(var(--fbTopL) 0%, var(--fbTopR) 0%, var(--fbBotR) 100%, var(--fbBotL) 100%);
  height: var(--backHeight);
  width: var(--fbSideWidth);
  transform: translateX(var(--fbPos)) translateZ(var(--offsetZ)) rotateX(var(--bFaceAngle));
}
body #view #scene #space .frustum.shaded > .front, body #view #scene #space .frustum.shaded > .back {
  filter: brightness(0.9);
}
body #view #scene #space .frustum.shaded > .left, body #view #scene #space .frustum.shaded > .right {
  filter: brightness(0.8);
}
body #view #scene #space .frustum.shaded > .top, body #view #scene #space .frustum.shaded > .bottom {
  filter: brightness(0.7);
}
body #view #scene #space .cylinder {
  position: absolute;
  bottom: 0;
  transform-origin: bottom left;
  transform: translateX(calc(var(--posX))) translateY(calc(var(--posY) * -1)) translateZ(calc(var(--posZ) + var(--radius))) rotateX(var(--rotX)) rotateY(var(--rotY)) rotateZ(var(--rotZ));
  height: var(--height);
  width: var(--diameter);
}
body #view #scene #space .cylinder.test > .cylinder-face {
  border: solid 1px black;
  background: linear-gradient(#f005, #00f5);
}
body #view #scene #space .cylinder.color > * {
  background-color: currentColor;
}
body #view #scene #space .cylinder > .cylinder-face {
  position: absolute;
  height: var(--height);
  width: var(--faceWidth);
  transform: translateX(calc(var(--radius) - var(--faceWidth) / 2)) rotateY(calc(var(--pos) * (360deg / var(--detailLevel)))) translateZ(var(--dist));
  transform-origin: center top;
}
body #view #scene #space .pyramid {
  position: absolute;
  bottom: 0;
  transform-origin: bottom left;
  transform: translateX(calc(var(--posX))) translateY(calc(var(--posY) * -1)) translateZ(calc(var(--posZ) + var(--radius))) rotateX(var(--rotX)) rotateY(var(--rotY)) rotateZ(var(--rotZ));
  height: var(--height);
  width: var(--diameter);
}
body #view #scene #space .pyramid.test > .pyramid-face {
  border: solid 1px black;
  background: linear-gradient(#f005, #00f5);
}
body #view #scene #space .pyramid > .pyramid-face {
  position: absolute;
  height: var(--faceHeight);
  width: var(--faceWidth);
  transform: translateX(calc(var(--radius) - var(--faceWidth) / 2)) rotateY(calc(var(--pos) * (360deg / var(--detailLevel)))) translateZ(var(--dist)) rotateX(var(--pyramidAngle));
  transform-origin: center bottom;
  -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
          clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
body #view #scene #space .pyramid.shaded > *:first-child, body #view #scene #space .pyramid.shaded > *:nth-child(odd) {
  filter: brightness(0.8);
}
body #view #scene #space .pyramid.shaded > *:nth-child(even) {
  filter: brightness(0.9);
}
body #view #scene #space .pyramid.pyramid-shaded > * {
  filter: brightness(var(--shadeLevel));
}
body #view #scene #space .pyramid.color > * {
  background-color: currentColor;
}
body #view #scene #space .pyramid.overflow > * {
  -webkit-clip-path: polygon(calc(50% + .7px) 0, calc(50% - .7px) 0, -2px calc(100% + 1px), calc(100% + 1px) calc(100% + 1px));
          clip-path: polygon(calc(50% + .7px) 0, calc(50% - .7px) 0, -2px calc(100% + 1px), calc(100% + 1px) calc(100% + 1px));
  box-shadow: 0 0 0 1px currentColor;
}
body #view #scene #space .particle-positioner {
  transform: translateX(calc(var(--posX) - 50%)) translateY(calc(var(--posY) * -1 - 50%)) translateZ(var(--posZ));
}
body #view #scene #space .particle-positioner.test .particle {
  border: solid 1px black;
  background: linear-gradient(#f005, #00f5);
}
body #view #scene #space .particle-positioner .particle {
  width: var(--sizeX);
  height: var(--sizeY);
}

@-webkit-keyframes animateRotation {
  0% {
    transform: rotateX(var(--startRotX)) rotateY(var(--startRotY)) rotateZ(var(--startRotZ));
  }
  100% {
    transform: rotateX(var(--endRotX)) rotateY(var(--endRotY)) rotateZ(var(--endRotZ));
  }
}

@keyframes animateRotation {
  0% {
    transform: rotateX(var(--startRotX)) rotateY(var(--startRotY)) rotateZ(var(--startRotZ));
  }
  100% {
    transform: rotateX(var(--endRotX)) rotateY(var(--endRotY)) rotateZ(var(--endRotZ));
  }
}
@-webkit-keyframes animatePosition {
  0% {
    transform: translateX(var(--startPosX)) translateY(var(--startPosY)) translateZ(var(--startPosZ));
  }
  100% {
    transform: translateX(var(--endPosX)) translateY(var(--endPosY)) translateZ(var(--endPosZ));
  }
}
@keyframes animatePosition {
  0% {
    transform: translateX(var(--startPosX)) translateY(var(--startPosY)) translateZ(var(--startPosZ));
  }
  100% {
    transform: translateX(var(--endPosX)) translateY(var(--endPosY)) translateZ(var(--endPosZ));
  }
}
.pumpkin {
  color: #c84504;
}
.pumpkin > *:not(.top, .bottom), .pumpkin.plane {
  background-image: linear-gradient(90deg, #c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504);
}
.pumpkin > .top, .pumpkin > .bottom {
  background-image: conic-gradient(from 15deg, #c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504,#b43e04,#c84504);
}

.pumpkin_flesh {
  color: #ff9d00;
}

.pumpkin_flesh_carved {
  color: #ff9d00;
}
.pumpkin_flesh_carved > *.top, .pumpkin_flesh_carved > *.bottom {
  background: linear-gradient(#ff9d00 90%, #c84504);
}
.pumpkin_flesh_carved > *.left, .pumpkin_flesh_carved > *.right {
  background: linear-gradient(90deg, #ff9d00 90%, #c84504);
}
.pumpkin_flesh_carved.plane {
  background-image: linear-gradient(#ff9d00 90%, #c84504);
}

#innerShadow {
  background-image: radial-gradient(#0002, #0000 70%);
}

#outerFront {
  -webkit-mask: 0 0/0.5em 3em linear-gradient(red, red), 2.5em 0/0.5em 3em linear-gradient(red, red), 0 0/3em 0.5em linear-gradient(red, red), 0 1.25em/3em 0.5em linear-gradient(red, red), 0 2.5em/3em 0.5em linear-gradient(red, red), 1.25em 0.5em/0.5em 1em linear-gradient(red, red), 1.25em 0.5em/0.5em 1em linear-gradient(red, red), 0.9em 1.75em/0.4em 0.25em linear-gradient(red, red), 1.3em 2.25em/0.4em 0.25em linear-gradient(red, red), 1.7em 1.75em/0.4em 0.25em linear-gradient(red, red);
          mask: 0 0/0.5em 3em linear-gradient(red, red), 2.5em 0/0.5em 3em linear-gradient(red, red), 0 0/3em 0.5em linear-gradient(red, red), 0 1.25em/3em 0.5em linear-gradient(red, red), 0 2.5em/3em 0.5em linear-gradient(red, red), 1.25em 0.5em/0.5em 1em linear-gradient(red, red), 1.25em 0.5em/0.5em 1em linear-gradient(red, red), 0.9em 1.75em/0.4em 0.25em linear-gradient(red, red), 1.3em 2.25em/0.4em 0.25em linear-gradient(red, red), 1.7em 1.75em/0.4em 0.25em linear-gradient(red, red);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}

.shine > * {
  background: linear-gradient(#fbcb3c20, #0000);
}

.stem {
  color: #264f0d;
}

#leaves > *[data-face="1"], #leaves > *[data-face="2"] {
  background-image: radial-gradient(ellipse at 50% 80%, #264f0d 66%, #0000 66%);
}
#leaves > *[data-face="3"] {
  background-image: radial-gradient(circle at 24% -24%, #264f0d 66%, #0000 66%);
}
#leaves > *[data-face="4"] {
  background-image: radial-gradient(circle at 76% -24%, #264f0d 66%, #0000 66%);
}

.rock {
  color: #444;
}

.grass {
  color: #2a300b;
}
.grass > * {
  color: #272f09;
  background: 0 0/10em 10em url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence  type='turbulence' baseFrequency='.005' numOctaves='10' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"), linear-gradient(#0005, #0005), currentColor;
}
.grass > *.left, .grass > *.right, .grass > *.back, .grass > *.front {
  background: 0 0/10em 10em url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence  type='turbulence' baseFrequency='.005' numOctaves='10' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"), linear-gradient(#0005, #0000), currentColor;
}

.tall_grass > .pyramid-face::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  -webkit-clip-path: polygon(50% 100%, 30% 0, 70% 0);
          clip-path: polygon(50% 100%, 30% 0, 70% 0);
  background: #272f09;
}

.base > .top {
  color: #272f09;
  background: 0 0/10em 10em url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence  type='turbulence' baseFrequency='.005' numOctaves='10' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"), currentColor;
}
.base > :not(.top) {
  color: #272f09;
  background: 0 0/10em 10em url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence  type='turbulence' baseFrequency='.005' numOctaves='10' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"), linear-gradient(currentColor, #110e08 20%);
}
.base > .bottom {
  color: #110e08;
  background: 0 0/10em 10em url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence  type='turbulence' baseFrequency='.005' numOctaves='10' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"), currentColor;
}

#candle .candle {
  color: #bbae90;
}
#candle .candle > .front, #candle .candle > .back, #candle .candle > .left, #candle .candle > .right {
  background-image: linear-gradient(#bbae90, #9b8d6f);
}
#candle .flame .particle {
  filter: drop-shadow(0 0 0.2em white);
}
#candle .flame .particle::before {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(#b88400, red);
  -webkit-clip-path: polygon(42% 4%, 61% 52%, 63% 78%, 49% 100%, 31% 78%, 30% 55%);
          clip-path: polygon(42% 4%, 61% 52%, 63% 78%, 49% 100%, 31% 78%, 30% 55%);
}

#ghosts .ghost .particle-container .particle {
  -webkit-animation: ghostAppears var(--animDuration) linear infinite;
          animation: ghostAppears var(--animDuration) linear infinite;
  -webkit-animation-delay: var(--animDelay);
          animation-delay: var(--animDelay);
  background-image: linear-gradient(#fff2, #0000);
  -webkit-clip-path: polygon(3% 26%, 11% 10%, 25% 2%, 64% 1%, 85% 7%, 94% 30%, 95% 62%, 85% 100%, 65% 74%, 40% 99%, 24% 84%, 0 99%);
          clip-path: polygon(3% 26%, 11% 10%, 25% 2%, 64% 1%, 85% 7%, 94% 30%, 95% 62%, 85% 100%, 65% 74%, 40% 99%, 24% 84%, 0 99%);
}

@-webkit-keyframes ghostAppears {
  0%, 50% {
    opacity: 0;
    transform: translateY(0);
  }
  95% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-2em);
  }
}

@keyframes ghostAppears {
  0%, 50% {
    opacity: 0;
    transform: translateY(0);
  }
  95% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-2em);
  }
}
</style>



</head>

<body >
  <div id="app">
  <details>
    <summary>Controls</summary>
    <ul>
      <li>left click & drag to rotate</li>
      <li>middle click & drag to move the model</li>
      <li>scroll wheel to zoom</li>
      <li>(still figuring out mobile devices)</li>
    </ul>
  </details>
  <div id="view" tabindex="0" @wheel="wheelAction" @touchmove="doDrag" @mousemove="mouseMove" @touchend="stopDrag" @mousedown="mouseDown" @touchstart="startDrag" @mouseup="mouseUp">
    <div class="reference" id="scene" :style="{ transform: `translateX(${moveX}px)  translateY(${moveY}px)` }">
      <div id="space" style="transform: rotateX(-5deg) rotateY(25deg); font-size: calc(6vh + 0.15vw)" :style="{ transform: `rotateX(${angleX}deg) rotateY(${angleY}deg)`, fontSize: `calc(${20 * zoomLevel}vh + ${zoomLevel / 2}vw)` }">
        <div class="reference group" id="groundGroup" style="
		--posX: -1.5em;
		--posY: 0em;
		--posZ: -1.5em;
		--rotX: 0deg;
		--rotY: 0deg;
		--rotZ: 0deg;
		font-size: 1em">
          <div class="reference" style="font-size: 1em">
            <div class="cuboid reference base shaded" id="" style="
		--sizeX: 7em;
		--sizeY: 1em;
		--sizeZ: 7em;
		--posX: -2em;
		--posY: -0.8em;
		--posZ: -2em;
		--rotX: 0deg;
		--rotY: 0deg;
		--rotZ: 0deg;
		font-size: 1em">
              <div class="top"></div>
              <div class="bottom"></div>
              <div class="left"></div>
              <div class="right"></div>
              <div class="front"></div>
              <div class="back"></div>
            </div>
            <div class="frustum reference _bottom grass overflow" id="" data-test="-1" style="
			--botX: 5em;
			--botZ: 5em;
			--topX: 4em;
			--topZ: 3.2em;
			--offsetX: 0.5em;
			--offsetZ: 0.9em;
			--revOffsetX: -0.5em;
			--revOffsetZ: -0.8999999999999995em;
			--leftHeight: 1.118033988749895em;
			--rightHeight: 1.118033988749895em;
			--frontHeight: 1.3453624047073707em;
			--backHeight: 1.3453624047073711em;
			--height: 1em;
			--posX: -1em;
			--posY: 1em;
			--posZ: -1em;
			--rotX: 0deg;
			--rotY: 0deg;
			--rotZ: 4deg;
			--lrSideWidth: 5em;
			--fbSideWidth: 5em;
			--lrPos: 0em;
			--fbPos: 0em;
			--fbTopL: 0.5em;
			--fbTopR: 4.5em;
			--fbBotL: 0em;
			--fbBotR: 5em;
			--lrTopL: 0.9em;
			--lrTopR: 4.1000000000000005em;
			--lrBotL: 0em;
			--lrBotR: 5em;
			--lFaceAngle: 26.56505117707799deg;
			--rFaceAngle: -26.56505117707799deg;
			--fFaceAngle: 41.98721249581665deg;
			--bFaceAngle: -41.98721249581666deg;
			font-size: 1em;
		">
              <div class="top"></div>
              <div class="bottom"></div>
              <div class="left"></div>
              <div class="right"></div>
              <div class="front"></div>
              <div class="back"></div>
            </div>
            <div class="frustum reference _bottom rock color shaded overflow" id="" data-test="3.7" style="
			--botX: 1em;
			--botZ: 1em;
			--topX: 0.6em;
			--topZ: 0.6em;
			--offsetX: 0.2em;
			--offsetZ: 0.2em;
			--revOffsetX: -0.19999999999999996em;
			--revOffsetZ: -0.19999999999999996em;
			--leftHeight: 0.5385164807134505em;
			--rightHeight: 0.5385164807134504em;
			--frontHeight: 0.5385164807134504em;
			--backHeight: 0.5385164807134505em;
			--height: 0.5em;
			--posX: 3.7em;
			--posY: 0.7em;
			--posZ: 3.8em;
			--rotX: 0deg;
			--rotY: 0deg;
			--rotZ: 5deg;
			--lrSideWidth: 1em;
			--fbSideWidth: 1em;
			--lrPos: 0em;
			--fbPos: 0em;
			--fbTopL: 0.2em;
			--fbTopR: 0.8em;
			--fbBotL: 0em;
			--fbBotR: 1em;
			--lrTopL: 0.2em;
			--lrTopR: 0.8em;
			--lrBotL: 0em;
			--lrBotR: 1em;
			--lFaceAngle: 21.80140948635181deg;
			--rFaceAngle: -21.801409486351808deg;
			--fFaceAngle: 21.801409486351808deg;
			--bFaceAngle: -21.80140948635181deg;
			font-size: 1em;
		">
              <div class="top"></div>
              <div class="bottom"></div>
              <div class="left"></div>
              <div class="right"></div>
              <div class="front"></div>
              <div class="back"></div>
            </div>
            <div class="pyramid reference rock color pyramid-shaded overflow" id="" style="
			--height: 0.1em;
			--diameter: 0.3em;
			--radius: 0.15em;
			--dist: 0.1213525491562421em;
			--detailLevel: 5;
			--faceWidth: 0.17633557568774194em;
			--posX: 0em;
			--posY: -0.5em;
			--posZ: 4.85em;
			--rotX: -90deg;
			--rotY: 0deg;
			--rotZ: 0deg;
			--pyramidAngle: 50.50993094276726deg;
			--faceHeight: 0.15724643457553547em;
			font-size: 1em">
              <div class="absolute pyramid-face" data-face="1" style="
					--shadeLevel: 0.........完整代码请登录后点击上方下载按钮下载查看

网友评论0