网站链接: 我爱捣鼓
当前位置: 首页 > 前端开发 > css

css制作鸿蒙Harmony系统logo动画特效

2022/8/20 22:28:17

最近很火的华为操作系统鸿蒙,家喻户晓,今天我们就使用css来实现一个鸿蒙系统logo的特效动画,如下图所示:<html><head> <meta charset="UTF-8"> <link rel="apple-touch-icon" type="image/png" href="h…

        最近很火的华为操作系统鸿蒙,家喻户晓,今天我们就使用css来实现一个鸿蒙系统logo的特效动画,如下图所示:

image.png

<html>
<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" type="image/png"
    href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png">
  <meta name="apple-mobile-web-app-title" content="CodePen">
  <link rel="shortcut icon" type="image/x-icon"
    href="https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico">
  <link rel="mask-icon" type="image/x-icon"
    href="https://cpwebassets.codepen.io/assets/favicon/logo-pin-8f3771b1072e3c38bd662872f6b673a722f4b3ca2421637d5596661b4e2132cc.svg"
    color="#111">
  <title>css制作鸿蒙Harmony系统logo动画特效</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
  <style>
    @import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;1,200&display=swap");
    body,
    html {
      width: 100%;
      height: 100%;
      display: flex;
      background: #000;
      font-family: "Montserrat", sans-serif;
    }
    .g-container {
      margin: auto;
    }
    p {
      position: fixed;
      bottom: calc(50vh - 150px);
      left: 50%;
      transform: translate(-50%, 0);
      font-size: 36px;
      color: #fff;
      text-align: center;
      margin-top: 12px;
    }
    p span {
      display: inline-block;
      position: relative;
    }
    p span::before {
      content: "";
      position: absolute;
      bottom: 0;
      width: 18px;
      left: 50%;
      transform: translate(-50%, 4px);
      border-bottom: 4px solid #2d60aa;
    }
    svg {
      position: absolute;
    }
    .g-top {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 50vh;
      background: #000;
      overflow: hidden;
      z-index: 10;
    }
    .g-top::before {
      content: "";
      position: absolute;
      border-radius: 50%;
      bottom: 0;
      left: 50%;
      width: 200px;
      height: 200px;
      transform: translate(-50%, 100px);
      box-sizing: border-box;
      background: #000;
      border: 25px solid #fff;
      z-index: 1;
      box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.8), 0 0 8px 2px rgba(255, 255, 255, 0.6);
    }
    .g-top::after {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: repeating-radial-gradient(circle at 50% 100%, transparent, transparent 5px, #3a77f6 5.2px, #3a77f6 6.2px, transparent 6.5px);
      -webkit-mask: radial-gradient(circle at 50% 100%, white, transparent 25%, transparent);
      mask: radial-gradient(circle at 50% 100%, white, transparent 25%, transparent);
      z-index: 0;
    }
    .g-bottom {
      position: fixed;
      top: 50vh;
      left: 0;
      width: 100vw;
      height: 50vh;
      background: #000;
      overflow: hidden;
      filter: url(#fractal);
    }
    .g-bottom::before {
      content: "";
      position: absolute;
      border-radius: 50%;
      top: 0;
      width: 200px;
      height: 200px;
      background: #000;
      left: 50%;
      transform: translate(-50%, -100px);
      box-sizing: border-box;
      border: 25px solid #fff;
      z-index: 2;
      box-shadow: 0 0 4px rgba(255, 255, 255, 0.8), 0 0 8px rgba(255, 255, 255, 0.7), 0 0 20px rgba(255, 255, 255, 0.6);
      filter: blur(4px);
      -webkit-mask: linear-gradient(white, white 50%, rgba(255, 255, 255, 0.9));
      mask: linear-gradient(white, white 50%, rgba(255, 255, 255, 0.9));
    }
    .g-bottom::after {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: repeating-radial-gradient(circle at 50% 0, transparent, transparent 5px, #3a77f6 5.1px, #3a77f6 6.4px, transparent 6.5px);
      -webkit-mask: radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.6), transparent 25%, transparent);
      mask: radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.6), transparent 25%, transparent);
      z-index: 3;
    }
    .line {
      position: absolute;
      bottom: -8px;
      left: 50%;
      width: 500px;
      height: 6px;
      border-radius: 50%;
      background: rgba(46, 107, 232, 0.8);
      transform: translate(-50%, -50%);
      z-index: 10;
      filter: blur(5px) contrast(1.2) brightness(1.2);
      box-shadow: 0 0 5px rgba(46, 107, 232, 0.7);
    }
  </style>
  <script>
    if (document.location.search.match(/type=embed/gi)) {
      window.parent.postMessage("resize", "*");
    }
  </script>
</head>
<body translate="no">
  <div>
    <div>
      <div></div>
    </div>
    <div></div>
    <p>Harmony <span>O</span>S</p>
  </div>
  <svg>
    <filter id="fractal" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
      <feTurbulence id="turbulence" type="fractalNoise" baseFrequency="0.005 0.005" numOctaves="10">
        <animate attributeName="baseFrequency" dur="30s" values="0.005 0.005;0.05 0.3;0.005 0.005"
          repeatCount="indefinite"></animate>
      </feTurbulence>
      <feDisplacementMap in="SourceGraphic" scale="15"></feDisplacementMap>
    </filter>
  </svg>
  <script
    src="https://cpwebassets.codepen.io/assets/editor/iframe/iframeRefreshCSS-4793b73c6332f7f14a9b6bba5d5e62748e9d1bd0b5c52d7af6376f3d1c625d7e.js"></script>
  <div id="xl_chrome_ext_{4DB361DE-01F7-4376-B494-639E489D19ED}" style="display: none;">
    <div></div>
    <a id="xl_chrome_ext_download" href="javascript:;">下载视频</a>
    <a id="xl_chrome_ext_close" href="javascript:;"></a>
  </div>
</body>
</html>

        查看在线实例

        通过以上内容我们知道了css如何实现鸿蒙Harmony系统logo动画特效?感谢您访问“我爱捣鼓(www.woaidaogu.com)”网站的内容,希望对大家有所帮助!引用本文内容时,请注明出处!谢谢合作!


相关资讯

  • 设置英文首字母大写的css属性是什么?

    设置CSS text-transform 的属性为capitalize就可以实现英文首字母大写。 定义和用法  text-transform 属性控制文本的大小写。 属性值 值 描 述 none 默认。定义带有小写字…

    2021/7/14 20:35:17
  • 只让页面显示横滚动条,不显示竖滚动条如何实现?

    只让页面显示横滚动条,不显示竖滚动条的方法其实很简单,主要用到body的两个css属性 overflow和 overflow-y,如下所示:body { overflow:scroll; overflow-y:hidden;}

    2021/2/28 21:45:25
  • 网页的滚动条样式可以修改吗?如何修改?

    网页的滚动条样式可以修改的,主要是使用css来控制那如何修改呢?如下代码:<div class="inner"> <div class="innerbox"> <p style="height:200px;">这是内容111</p> <p style="hei…

    2021/2/28 21:15:24
  • css如何实现6张图片均匀排列在一行?

    css部分如下:img{width:120px; height:80px;float:left;margin-right:16px;}.img3{margin-right:0;}html部分如下:<img src="images/001.jpg" /><img src="images/002.jpg" /><img src="images/003.jpg" /><img src=…

    2021/2/28 21:10:01