子比主题美化-顶部导航下增加一排小桔灯

非常喜庆个性的一个美化,有点非常的闪亮,不是一般人都能接受的,默认出现时间为晚8点到早8点,距离顶部为50px;可以根据自己的需求修改。

图片展示

图片[1]-子比主题美化-顶部导航下增加一排小桔灯

使用教程

下面的代码加入到主题目录下function.php中

CSS代码加入到主题自定义CSS代码里面:

/*小桔灯*/
  #xiaojudeng{
            position: fixed;
            z-index: 999;
            top: 50px; //到顶部的距离。
            pointer-events: none;
            width: 100%;
            height: 120px;
            white-space: nowrap;
            overflow: hidden;
        }
        #xiaojudeng li{
            display: inline-block;
            margin-top: 15px;
            margin-right: 50px;
            width: 15px;
            height: 30px;
            border-radius: 50%;
            position: relative;
        }
        #xiaojudeng li::after{
            content: '';
            position: absolute;
            top: -5px;
            left: 50%;
            transform: translateX(-50%);
            width: 20px;
            height: 12px;
            background-color: #727472;
            box-shadow: inset 0 0 3px #c3c3bd;
            border-radius: 10px;

        }
        #xiaojudeng li::before{
            content: '';
            position: absolute;
            top: -23px;
            left: 15px;
            width: 55px;
            height: 30px;
            border-bottom: 3px solid  #e7e7e7;
            border-radius: 50%;
        }
        #xiaojudeng li:nth-of-type(2n+1){
           animation: lan 2s  infinite;
        }#xiaojudeng li:nth-child(2n+2){
            animation: huang 2.2s infinite;
        }#xiaojudeng li:nth-child(3n+3){
            animation: zhi 1.8s infinite;
        }
       #xiaojudeng li:nth-child(4n+4){
        animation: lv 2.8s infinite;
       }

        @keyframes lan{
            0%,100%{
                background-color: rgba(4, 255, 242, 0.5);
            }
            50%{
                background-color: rgb(4, 255, 242);
                box-shadow: 0 0 10px rgb(4, 255, 242),
                0 0 30px rgb(4, 255, 242),
                0 0 50px rgb(4, 255, 242);              
            }
        }
        @keyframes huang{
            0%,100%{
                background-color: rgba(251, 255, 4,.5);
            }
            50%{
                background-color: rgb(251, 255, 4);
                box-shadow: 0 0 10px rgb(251, 255, 4),
                0 0 12px rgb(251, 255, 4),
                0 0 30px rgb(251, 255, 4);              
            }
        }
        @keyframes lv{
            0%,100%{
                background-color: rgba(33, 255, 4,.5);
            }
            50%{
                background-color: rgb(33, 255, 4);
                box-shadow: 0 0 10px rgb(33, 255, 4),
                0 0 12px rgb(33, 255, 4),
                0 0 30px rgb(33, 255, 4);              
            }
        }
        @keyframes zhi{
            0%,100%{
                background-color:  rgba(255, 4, 255,.5);
            }
            50%{
                background-color: rgb(255, 4, 255);
                box-shadow: 0 0 10px  rgb(255, 4, 255),
                0 0 25px  rgb(255, 4, 255),
                0 0 40px  rgb(255, 4, 255);              
            }
        }
温馨提示:本文最后更新于2024-04-18 00:19:12,某些文章具有时效性,若有错误或已失效,请在下方留言或联系执笔
© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
子比主题美化-顶部导航下增加一排小桔灯-执笔博客
子比主题美化-顶部导航下增加一排小桔灯
此内容为免费阅读,请登录后查看
执币0
免费阅读
评论 共2条

请登录后发表评论