css卡片翻转 父元素翻转子元素不翻转效果

css卡片翻转 父元素翻转子元素不翻转效果

复制代码
vue
<div class="moduleBox">
      <div class="headTitle">
        <span class="headName">大额案例</span>
      </div>
      <div class="moduleItem">
        <span class="moduleNum">--</span>
        <span class="moduleLabel">待处理</span>
      </div>
      <div class="moduleItem">
        <span class="moduleNum">--</span>
        <span class="moduleLabel">待审核</span>
      </div>
      <div class="moduleItem">
        <span class="moduleNum">--</span>
        <span class="moduleLabel">待审批</span>
      </div>
    </div>

scss
.moduleBox{
  display:flex;
  justify-content:space-evenly;
      align-items:center;
  width:30%;
  height:320px;
  background:#ccdbfe;
  margin:22px 1.6%;
   border-radius:6px;
   position: relative; 
   perspective: 1000px; /* 设置透视 */
   transform: translateZ(0); /* 开启硬件加速 */
   .headTitle{
    width: 200px;     
        border-bottom: 43px solid transparent;                  
        border-top: 43px solid #4c7efd;  
        border-left: 13px solid transparent;          
        border-right: 13px solid transparent;
    position:absolute;
    top:0;
    left:calc(50% - 113px);
    .headName{
      width:100%;
      text-align:center;
      font:18px/40px '';
      position:absolute;
      top:-40px;
      color:#fff;
    }
   }
  .moduleItem{
  width:26%;
  height:90px;
  background:#c1d2fd;
   border-radius:3px;
  display:flex;
  justify-content:center;
      align-items:center;
      flex-direction:column;
      transition: 0.4s ease-in-out;
      color:#4d7EFD;
      cursor:pointer;
    .moduleNum{
      font:28px/34px '';
      transition: 0.4 0.6;
    }
    .moduleLabel{
      font:14px/20px '';
      transition: 0.4 0.6;
    }
    
  }
    .moduleItem:hover{
      background:#4c7efd;
      color:#fff;
      transform: rotateX(180deg);
      .moduleNum{
      transform: rotateX(-180deg);
      }
      .moduleLabel{
      transform: rotateX(-180deg);
      }
  }
}
相关推荐
甲维斯10 分钟前
GLM5.2超过Opus4.8Think,全球第二了!
前端·人工智能·ai编程
黄敬峰11 分钟前
纯 CSS3 打造 3D 旋转魔方:从文档流、Flex 布局到空间变换的硬核复盘
css
by————组态12 分钟前
Ricon组态系统 - 新一代Web可视化组态平台
前端·后端·物联网·架构·组态·组态软件
JieE21213 分钟前
手把手带你用纯 CSS 实现一个 3D 旋转魔方,这些前端基础你能打几分?
前端·css·html
lichenyang45325 分钟前
鸿蒙 Web 容器(二):H5 和 ArkTS 说话前,先定一份「协议」
前端
JYeontu28 分钟前
开箱流水加载动画
前端·javascript·css
RANxy30 分钟前
AntV 入门系列:G6 图可视化实战
前端
尽欢i31 分钟前
Vue3 customRef 封神教程:防抖、本地存储、自动埋点一套搞定,模板干干净净
前端·javascript·vue.js
VOLUN34 分钟前
TypeScript封装通用RESTful BaseAPI,后台接口代码精简80%
前端·javascript