网站添加人生倒计时小插件源码

网站添加人生倒计时小插件源码 第2张插图
博客添加时间倒计时,适用于全部主题,看你添加在哪里了,一般在侧栏最好看,根据主题自行放在合适位置即可。

演示图

网站添加人生倒计时小插件源码 第3张插图
1、引入JQ文件
首先需要去引入第三方库jquery,这个主题一般都有,没有的话,在主题的header.php引入以下。

<script src="http://libs.baidu.com/jqueryui/1.9.1/jquery-ui.min.js"></script>

2、定义CSS样式
然后把以下css样式放入主题的style.css。

.aside-count .content {
    padding: 15px
}

.aside-count .content .item {
    margin-bottom: 15px
}

.aside-count .content .item:last-child {
    margin-bottom: 0
}

.aside-count .content .item .title {
    font-size: 12px;
    color: var(--minor);
    margin-bottom: 5px;
    display: flex;
    align-items: center
}

.aside-count .content .item .title span {
    color: var(--theme);
    font-weight: 500;
    font-size: 14px;
    margin: 0 5px
}

.aside-count .content .item .progress {
    display: flex;
    align-items: center
}

.aside-count .content .item .progress .progress-bar {
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--classC);
    width: 0;
    min-width: 0;
    flex: 1;
    margin-right: 5px
}
@keyframes progress {
    0% {
        background-position: 0 0
    }

    100% {
        background-position: 30px 0
    }
}
.aside-count .content .item .progress .progress-bar .progress-inner {
    width: 0;
    height: 100%;
    border-radius: 5px;
    transition: width 0.35s;
    -webkit-animation: progress 750ms linear infinite;
    animation: progress 750ms linear infinite
}

.aside-count .content .item .progress .progress-bar .progress-inner-1 {
    background: #bde6ff;
    background-image: linear-gradient(135deg, #50bfff 25%, transparent 25%, transparent 50%, #50bfff 50%, #50bfff 75%, transparent 75%, transparent 100%);
    background-size: 30px 30px
}

.aside-count .content .item .progress .progress-bar .progress-inner-2 {
    background: #ffd980;
    background-image: linear-gradient(135deg, #f7ba2a 25%, transparent 25%, transparent 50%, #f7ba2a 50%, #f7ba2a 75%, transparent 75%, transparent 100%);
    background-size: 30px 30px
}

.aside-count .content .item .progress .progress-bar .progress-inner-3 {
    background: #ffa9a9;
    background-image: linear-gradient(135deg, #ff4949 25%, transparent 25%, transparent 50%, #ff4949 50%, #ff4949 75%, transparent 75%, transparent 100%);
    background-size: 30px 30px
}

.aside-count .content .item .progress .progress-bar .progress-inner-4 {
    background: #67c23a;
    background-image: linear-gradient(135deg, #4f9e28 25%, transparent 25%, transparent 50%, #4f9e28 50%, #4f9e28 75%, transparent 75%, transparent 100%);
    background-size: 30px 30px
}

3、定义JS样式
之后引入以下js,具体是自建js引入还是放在主题的js文件里,自己请随意发挥。

网站添加人生倒计时小插件源码 第4张插图
此处内容已隐藏,评论后刷新即可查看!

免责声明

本站提供的一切软件、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络收集整理,如果您喜欢该程序和内容,请支持正版,购买注册,得到更好的正版服务。我们非常重视版权问题,如有侵权请邮件与我们联系处理。敬请谅解!
如若转载,请注明出处:https://www.zxki.cn/2663.html

上一篇 2022-1-22 20:54
下一篇 2022-1-23 09:05

相关推荐

发表评论

为了防止灌水评论,登录后即可评论!

已有 4 条评论