zibll-子比主题美化-添加一个灵动岛样式

教程开始

将下面代码添加到自定义css中

.dynamic-island:hover img {width:30px;    height:30px;;}
.bars {display:flex;align-items:center;  justify-content:flex-end;  gap:3px;}
.bar {width:2px;height:13px;background-color:green;animation:bounce 1s infinite ease-in-out;animation-direction:alternate;}
.bar:nth-child(1) {animation-duration:1s;}
.bar:nth-child(2) {animation-duration:0.9s;}
.bar:nth-child(3) {animation-duration:0.8s;}
.bar:nth-child(4) {animation-duration:0.7s;}
.bar:nth-child(5) {animation-duration:0.6s;}
.bar:nth-child(6) {animation-duration:0.9s;}
.bar:nth-child(7) {animation-duration:0.7s;}
.dynamic-island {position:fixed;top:80px;left:50%;transform:translateX(-50%) scale(0);    transform-origin:center;width:auto;max-width:80%;height:40px;background-color:#000;border-radius:25px;    color:white;display:flex;align-items:center;justify-content:space-between;    transition:transform 0.4s ease-in-out,height 0.6s ease-in-out,border-radius 0.6s ease-in-out,box-shadow 0.5s ease-in-out,opacity 0.5s ease-in-out;overflow:visible;    z-index:1000;padding-left:35px;    padding-right:20px;    opacity:0;box-shadow:0 0px 10px rgba(0,0,0,0.45);;}
.dynamic-island.active {transform:translateX(-50%) scale(1);    opacity:1;}
.dynamic-island.inactive {transform:translateX(-50%) scale(0);    opacity:0;}
.island-content {opacity:0;transition:opacity 0.9s ease-in-out,filter 0.8s ease-in-out;    font-weight:bold;    flex-grow:1;    text-align:right;    width:100%;}
.dynamic-island.active .island-content {opacity:1;}
.dynamic-island img {position:absolute;left:10px;    width:20px;    height:20px;    object-fit:cover;    transition:height 0.8s ease-in-out,width 0.8s ease-in-out,filter 0.8s ease-in-out;}
.dynamic-island:hover {height:60px;border-radius:50px;}
@keyframes bounce {0% {transform:scaleY(0.3);background-color:green;}
50% {transform:scaleY(1);background-color:orange;}
100% {transform:scaleY(0.3);background-color:green;}
;}

将下面代码添加到后台自定义头部html

<div class="dynamic-island inactive" id="dynamicIsland" style="opacity: 0;">
    <img src="https://img.alicdn.com/imgextra/i1/2210123621994/O1CN01lajerM1QbIl9aoHcJ_!!2210123621994.png" alt="通知图标" width="30" height="30">
    <div class="island-content">
        <div class="bars" style="line-height: 50px; margin: 0;">
            <p style="line-height: 50px; margin: 0; font-size: 12px; padding-right: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;"> 欢迎访问墨星博客</p>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
        </div>
    </

将下面代码添加到zibll文件夹中的function.php或func.php文件中

温馨提示:本文最后更新于2025-03-10 12:53:54,某些文章具有时效性,若有错误或已失效,请在下方留言或联系站长
© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
评论 共2条

请登录后发表评论