您当前的位置: 首页 >  css3

【03】

暂无认证

  • 4浏览

    0关注

    196博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

css3徽章特效

【03】 发布时间:2021-12-08 09:45:15 ,浏览量:4

css3 徽章特效 实现

使用N张图片,使其在Z轴偏移堆叠,形成厚度,使用3D转换,就是徽章的效果了

代码



  
  
  
  Document
  
      html,body{
          width: 100%;
          height: 100%;
          display: flex;
          align-items: center;
          justify-content: center;
      }
      @keyframes spin {
          0% {
              transform: rotateY(0deg);
          }
          100% {
              transform: rotateY(360deg);
          }
      }
      .badge {
          width: 23vw;
          height: 23vw;
          min-width: 400px;
          min-height: 400px;
          transform-style: preserve-3d;
          animation: spin 5.5s linear infinite;
      }

      .badge > div:nth-child(1) {
          transform: translateZ(0.5px);
      }

      .badge > div:nth-child(2) {
          transform: translateZ(1px);
      }

      .badge > div:nth-child(3) {
          transform: translateZ(1.5px);
      }

      .badge > div:nth-child(4) {
          transform: translateZ(2px);
      }

      .badge > div:nth-child(5) {
          transform: translateZ(2.5px);
      }

      .badge > div:nth-child(6) {
          transform: translateZ(3px);
      }

      .badge > div:nth-child(7) {
          transform: translateZ(3.5px);
      }

      .badge > div:nth-child(8) {
          transform: translateZ(4px);
      }

      .badge > div:nth-child(9) {
          transform: translateZ(4.5px);
      }

      .badge > div:nth-child(10) {
          transform: translateZ(5px);
      }

      .badge > div:nth-child(11) {
          transform: translateZ(5.5px);
      }

      .badge > div:nth-child(12) {
          transform: translateZ(6px);
      }

      .badge > div:nth-child(13) {
          transform: translateZ(6.5px);
      }

      .badge > div:nth-child(14) {
          transform: translateZ(7px);
      }

      .badge > div:nth-child(15) {
          transform: translateZ(7.5px);
      }

      .badge > div:nth-child(16) {
          transform: translateZ(8px);
      }

      .badge > div:nth-child(17) {
          transform: translateZ(8.5px);
      }

      .badge > div:nth-child(18) {
          transform: translateZ(9px);
      }

      .badge > div:nth-child(19) {
          transform: translateZ(9.5px);
      }

      .badge > div:nth-child(20) {
          transform: translateZ(10px);
      }

      .badge > div {
          background-image: url("https://web03-1252477692.cos.ap-guangzhou.myqcloud.com/blog/images/1e84e715773a4652a0207d7e501341a1.png");
          height: 100%;
          width: 100%;
          transform: translateZ(1px);
          position: absolute;
          top: 0;
          background-size: 100% 100%;
      }
  


demo

https://web03-1252477692.cos.ap-guangzhou.myqcloud.com/blog/files/5ef87833b94c41f6a3c1bf73976608c1.html

关注
打赏
1657344724
查看更多评论
立即登录/注册

微信扫码登录

0.0367s