Sunny-117 / js-challenges

✨✨✨ Challenge your JavaScript programming limits step by step

Home Page:https://juejin.cn/column/7244788137410560055

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

实现 筛子

Sunny-117 opened this issue · comments

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .dice {
        width: 200px;
        height: 200px;
        position: relative;
        left: 300px;
        top: 200px;
        transform-style: preserve-3d;
        transform: rotateX(45deg) rotateY(45deg);
      }
      .face {
        position: absolute;
        width: 100%;
        height: 100%;
        background-color: white;
        border: 1px solid black;
      }
      .front {
        transform: translateZ(100px);
      }

      .back {
        transform: translateZ(-100px);
      }

      .top {
        transform: rotateX(-90deg) translateZ(100px);
      }

      .bottom {
        transform: rotateX(90deg) translateZ(100px);
      }

      .left {
        transform: rotateY(-90deg) translateZ(100px);
      }

      .right {
        transform: rotateY(90deg) translateZ(100px);
      }
    </style>
  </head>
  <body>
    <div class="dice">
      <div class="face front"></div>
      <div class="face back"></div>
      <div class="face top"></div>
      <div class="face bottom"></div>
      <div class="face left"></div>
      <div class="face right"></div>
    </div>
  </body>
</html>