使用html+css制作一个发光立方体特效

使用html+css制作一个发光立方体特效

html 复制代码
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!--QQ沐编程 www.qqmu.com 学习QQ群:290987565  域名抢注 33210.jm.cn -->
    <style>
      * {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
      }
      body {
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: black;
      }
      .container {
        position: relative;
        width: 300px;
        height: 300px;
        transform-style: preserve-3d;
        animation: zuan 6s linear alternate infinite;
      }
      @keyframes zuan {
        0% {
          transform: rotateX(-30deg) rotateY(0deg);
        }

        100% {
          transform: rotateX(-30deg) rotateY(360deg);
        }
      }
      .q1,
      .h2,
      .z3,
      .y4 {
        position: absolute;
        width: 100%;
        height: 100%;
        /* opacity: 0.8; */
        /*   border-left: solid 1px rgba(9, 255, 9, 1); */
        background-image: linear-gradient(rgb(26, 26, 26), rgb(9, 255, 9));
      }

      .q1 {
        transform: translateZ(150px);
      }
      .h2 {
        transform: rotateY(180deg) translateZ(150px);
      }
      .z3 {
        transform: rotateY(-90deg) translateZ(150px);
      }
      .y4 {
        transform: rotateY(90deg) translateZ(150px);
      }
      .s5,
      .x6 {
        position: absolute;
        width: 100%;
        height: 100%;
      }
      .s5 {
        transform: rotateX(90deg) translateZ(150px);
        background-color: rgb(26, 26, 26);
      }
      .x6 {
        background-color: rgb(9, 255, 9);
        transform: rotateX(-90deg) translateZ(250px);
        box-shadow: 0 0 150px 30px rgb(9, 255, 9);
        filter: blur(30px);
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="q1"></div>
      <div class="h2"></div>
      <div class="z3"></div>
      <div class="y4"></div>
      <div class="s5"></div>
      <div class="x6"></div>
    </div>
  </body>
</html>
相关推荐
松涛和鸣12 小时前
49、智能电源箱项目技术栈解析
服务器·c语言·开发语言·http·html·php
加个鸡腿儿16 小时前
经验分享2:SSR 项目中响应式组件的闪动陷阱与修复实践
前端·css·架构
华仔啊17 小时前
写 CSS 用 px?这 3 个单位能让页面自动适配屏幕
前端·css
菩提小狗18 小时前
Sqli-Labs Less-3 靶场完整解题流程解析-豆包生成
前端·css·less
智航GIS18 小时前
10.5 PyQuery:jQuery 风格的 Python HTML 解析库
python·html·jquery
Pilot-HJQ21 小时前
固定 Element UI 表格表头的方法(超简单)
vue.js·学习·css3·html5
web小白成长日记1 天前
CSS 作用域隔离实战:React、Vue 与 Styled Components 的三种范式
前端·css·vue.js·react.js
@@小旭1 天前
实现头部Sticky 粘性布局,并且点击菜单滑动到相应位置
前端·javascript·css
Irene19911 天前
CSS 定位属性(relative、absolute、fixed、sticky)与实用技巧总结
css
我的写法有点潮2 天前
推荐几个国外比较流行的UI库(上)
前端·javascript·css