3D css实现公园街道透视效果

代码语言:html

所属分类:三维

代码描述:3D css实现公园街道透视效果

代码标签: 公园 街道 透视 效果

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
@charset "UTF-8";
@font-face {
  font-family: 'VenturisSansADFLt-Bold';
  src: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/25387/VenturisSansADFLt-Bold.ttf.woff") format("woff"), url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/25387/VenturisSansADFLt-Bold.ttf.svg#VenturisSansADFLt-Bold") format("svg"), url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/25387/VenturisSansADFLt-Bold.ttf.eot"), url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/25387/VenturisSansADFLt-Bold.ttf.eot?#iefix") format("embedded-opentype");
  font-weight: normal;
  font-style: normal;
}
:root {
  --zoom: 1;
  --zoom-square: calc( var(--zoom) * var(--zoom) );
  --camera-x: 0;
  --camera-y: 0;
  --row-count: 0;
  --col-count: 0;
  --tile-width: 1em;
  --gap-width: calc(var(--tile-width) * 5 / 100);
  --total-tile-width: calc(1em + var(--gap-width));
  --gap-color: #666;
}

body {
  height: 100vh;
  display: grid;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
  overflow: hidden;
  font-size: 7vmin;
  -webkit-perspective: 150vmin;
          perspective: 150vmin;
  background: #cfe2e3;
}

.loading-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
  background: rgba(255, 255, 255, 0.85);
}

.has-loaded .loading-overlay {
  display: none;
}

.loading-message {
  font-size: 3rem;
}
.loading-message::after {
  content: "✨";
  -webkit-animation: loading-message .5s infinite;
          animation: loading-message .5s infinite;
}

@-webkit-keyframes loading-message {
  from, to {
    content: "Loading ✨";
  }
  33% {
    content: "Loading 🍓";
  }
  66% {
    content: "Loading ⚡️";
  }
}

@keyframes loading-message {
  from, to {
    content: "Loading ✨";
  }
  33% {
    content: "Loading 🍓";
  }
  66% {
    content: "Loading ⚡️";
  }
}
.tile {
  width: calc(1 * var(--tile-width));
  height: calc(1 * var(--tile-width));
  display: grid;
  gap: var(--gap-width);
  background: var(--gap-color);
}

.enable-shadows .tile spa.........完整代码请登录后点击上方下载按钮下载查看

网友评论0