主题说明
在此提醒您:zibll.com是Zibll子比主题唯一官网,子比主题受国家版权保护,著作权登记号: 2021SR0401471
使用盗版主题对您的网站及财产安全将会带来无数的未知风险!同时,为了您的权益及作者的不易,真诚的呼吁每一位用户:支持正版,从我做起!
主题美化说明
主题美化、小工具可能会有一定程度使网站加载缓慢、CSS 全局污染等等一系列的问题,请一定要测试后在进行美化。
主题美化可能会对主题文件进行修改,更新时请及时备份主题美化的文件,或者收藏本站,以免一些主题页面或美化效果丢失。
必要说明:(核心重点)
(最新版)CSS代码添加到后台子比主题设置—>自定义代码—>自定义CSS样式
(最新版)JS即javascript代码添加到后台子比主题设置—>自定义代码—>自定义javascript代码
(最新版)没有特殊说明的小工具,自定义HTML小工具添加网站后台—>外观–>小工具–>点击【自定义HTML】选择放置的位置—>把代码复制进去,保存即可。
其他添加方式的,会在教程里告知,若只需添加CSS+JS的教程,可能不重复告知了,请注意看上面的方法。
美化教程
// FPS 帧开始 $('body').before(''); var showFPS = (function(){ var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000/60); }; var e,pe,pid,fps,last,offset,step,appendFps; fps = 0; last = Date.now(); step = function(){ offset = Date.now() - last; fps += 1; if( offset >= 1000 ){ last += offset; appendFps(fps); fps = 0; } requestAnimationFrame( step ); }; appendFps = function(fps){ console.log(fps+'FPS'); $('#fps').html(fps+'FPS'); }; step(); })(); // FPS 帧结束
// FPS 帧开始
$('body').before('');
var showFPS = (function(){
var requestAnimationFrame =
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback) {
window.setTimeout(callback, 1000/60);
};
var e,pe,pid,fps,last,offset,step,appendFps;
fps = 0;
last = Date.now();
step = function(){
offset = Date.now() – last;
fps += 1;
if( offset >= 1000 ){
last += offset;
appendFps(fps);
fps = 0;
}
requestAnimationFrame( step );
};
appendFps = function(fps){
console.log(fps+’FPS’);
$(‘#fps’).html(fps+’FPS’);
};
step();
})();
// FPS 帧结束
使用方法
复制 CSS 代码到后台子比主题设置—》自定义 CSS 样式—》将 CSS 代码粘贴框里,即可。
CSS 代码:
/*文章随机彩色标签开始*/ .article-tags{margin-bottom: 10px}.article-tags a{padding: 4px 10px;background-color: #19B5FE;color: white;font-size: 12px;line-height: 16px;font-weight: 400;margin: 0 5px 5px 0;border-radius: 2px;display: inline-block}.article-tags a:nth-child(5n){background-color: #4A4A4A;color: #FFF}.article-tags a:nth-child(5n+1){background-color: #ff5e5c;color: #FFF}.article-tags a:nth-child(5n+2){background-color: #ffbb50;color: #FFF}.article-tags a:nth-child(5n+3){background-color: #1ac756;color: #FFF}.article-tags a:nth-child(5n+4){background-color: #19B5FE;color: #FFF}.article-tags a:hover{background-color: #1B1B1B;color: #FFF} /*文章随机彩色标签结束*/
/*文章随机彩色标签开始*/
.article-tags{margin-bottom: 10px}.article-tags a{padding: 4px 10px;background-color: #19B5FE;color: white;font-size: 12px;line-height: 16px;font-weight: 400;margin: 0 5px 5px 0;border-radius: 2px;display: inline-block}.article-tags a:nth-child(5n){background-color: #4A4A4A;color: #FFF}.article-tags a:nth-child(5n+1){background-color: #ff5e5c;color: #FFF}.article-tags a:nth-child(5n+2){background-color: #ffbb50;color: #FFF}.article-tags a:nth-child(5n+3){background-color: #1ac756;color: #FFF}.article-tags a:nth-child(5n+4){background-color: #19B5FE;color: #FFF}.article-tags a:hover{background-color: #1B1B1B;color: #FFF}
/*文章随机彩色标签结束*/
使用方法
一般主题都会自带 自定义代码 这样主题设置的,只需在主题设置自定义 CSS 代码里面添加美化的 css 代码就即可美化!
如果主题没有 自定义代码 那么在 WordPress 主题目录文件里找 style.css 文件或者在 WordPress 后台里找“外观—>自定义—>额外 CSS”里面美化的 css 代码就即可!
CSS代码:
/**彩色滚动条样式开始*/ ::-webkit-scrollbar { width: 10px; height: 1px; } ::-webkit-scrollbar-thumb { background-color: #12b7f5; background-image: -webkit-linear-gradient(45deg, rgba(255, 93, 143, 1) 25%, transparent 25%, transparent 50%, rgba(255, 93, 143, 1) 50%, rgba(255, 93, 143, 1) 75%, transparent 75%, transparent); } ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); background: #f6f6f6; } /**彩色滚动条样式结束*/
/**彩色滚动条样式开始*/
::-webkit-scrollbar {
width: 10px;
height: 1px;
}
::-webkit-scrollbar-thumb {
background-color: #12b7f5;
background-image: -webkit-linear-gradient(45deg, rgba(255, 93, 143, 1) 25%, transparent 25%, transparent 50%, rgba(255, 93, 143, 1) 50%, rgba(255, 93, 143, 1) 75%, transparent 75%, transparent);
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: #f6f6f6;
}
/**彩色滚动条样式结束*/
CSS 代码:
/* logo 扫光开始 */ .navbar-brand{position:relative;overflow:hidden;margin: 0px 0 0 0px;}.navbar-brand:before{content:""; position: absolute; left: -665px; top: -460px; width: 200px; height: 15px; background-color: rgba(255,255,255,.5); -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-animation: searchLights 6s ease-in 0s infinite; -o-animation: searchLights 6s ease-in 0s infinite; animation: searchLights 6s ease-in 0s infinite;}@-moz-keyframes searchLights{50%{left: -100px; top: 0;} 65%{left: 120px; top: 100px;}}@keyframes searchLights{40%{left: -100px; top: 0;} 60%{left: 120px; top: 100px;} 80%{left: -100px; top: 0px;}} /* logo 扫光结束 */
/* logo 扫光开始 */
.navbar-brand{position:relative;overflow:hidden;margin: 0px 0 0 0px;}.navbar-brand:before{content:""; position: absolute; left: -665px; top: -460px; width: 200px; height: 15px; background-color: rgba(255,255,255,.5); -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-animation: searchLights 6s ease-in 0s infinite; -o-animation: searchLights 6s ease-in 0s infinite; animation: searchLights 6s ease-in 0s infinite;}@-moz-keyframes searchLights{50%{left: -100px; top: 0;} 65%{left: 120px; top: 100px;}}@keyframes searchLights{40%{left: -100px; top: 0;} 60%{left: 120px; top: 100px;} 80%{left: -100px; top: 0px;}}
/* logo 扫光结束 */
CSS 代码:
/*导航栏字体加粗开始*/ ul.nav {font-weight: 700;} /*导航栏字体加粗结束*/
/*导航栏字体加粗开始*/
ul.nav {font-weight: 700;}
/*导航栏字体加粗结束*/
CSS 代码:
/*头像呼吸光环和鼠标悬停旋转放大开始*/ .avatar{border-radius: 50%; animation: light 4s ease-in-out infinite; transition: 0.5s;}.avatar:hover{transform: scale(1.15) rotate(720deg);}@keyframes light{0%{box-shadow: 0 0 4px #f00;} 25%{box-shadow: 0 0 16px #0f0;} 50%{box-shadow: 0 0 4px #00f;} 75%{box-shadow: 0 0 16px #0f0;} 100%{box-shadow: 0 0 4px #f00;}} /*头像呼吸光环和鼠标悬停旋转放大结束*/
/*头像呼吸光环和鼠标悬停旋转放大开始*/
.avatar{border-radius: 50%; animation: light 4s ease-in-out infinite; transition: 0.5s;}.avatar:hover{transform: scale(1.15) rotate(720deg);}@keyframes light{0%{box-shadow: 0 0 4px #f00;} 25%{box-shadow: 0 0 16px #0f0;} 50%{box-shadow: 0 0 4px #00f;} 75%{box-shadow: 0 0 16px #0f0;} 100%{box-shadow: 0 0 4px #f00;}}
/*头像呼吸光环和鼠标悬停旋转放大结束*/
CSS 代码:
/*首页文章列表悬停上浮开始*/ @media screen and (min-width: 980px){.tab-content .posts-item:not(article){transition: all 0.3s;}.tab-content .posts-item:not(article):hover{transform: translateY(-10px); box-shadow: 0 8px 10px rgba(255, 112, 173, 0.35);}} /*首页文章列表悬停上浮结束*/
/*首页文章列表悬停上浮开始*/
@media screen and (min-width: 980px){.tab-content .posts-item:not(article){transition: all 0.3s;}.tab-content .posts-item:not(article):hover{transform: translateY(-10px); box-shadow: 0 8px 10px rgba(255, 112, 173, 0.35);}}
/*首页文章列表悬停上浮结束*/
JS代码:
<!--浏览器搞笑标题--> var OriginTitle = document.title; var titleTime; document.addEventListener('visibilitychange', function () { if (document.hidden) { $('[rel="icon"]').attr('href', "https://pic.downk.cc/item/5fbd2ad6b18d6271135414f9.png"); document.title = '我相信你还会回来的!'; clearTimeout(titleTime); } else { $('[rel="icon"]').attr('href', "https://pic.downk.cc/item/5fbd2ad6b18d6271135414f9.png"); document.title = '哈哈,我就知道!' ; titleTime = setTimeout(function () { document.title = OriginTitle; }, 2000); } });
<!--浏览器搞笑标题-->
var OriginTitle = document.title;
var titleTime;
document.addEventListener('visibilitychange', function () {
if (document.hidden) {
$('[rel="icon"]').attr('href', "https://pic.downk.cc/item/5fbd2ad6b18d6271135414f9.png");
document.title = '我相信你还会回来的!';
clearTimeout(titleTime);
}
else {
$('[rel="icon"]').attr('href', "https://pic.downk.cc/item/5fbd2ad6b18d6271135414f9.png");
document.title = '哈哈,我就知道!' ;
titleTime = setTimeout(function () {
document.title = OriginTitle;
}, 2000);
}
});
效果预览
在后台—外观—小工具—首页-底部全宽度,自定义HTML添加下面代码即可。(其他位置自行修改~)
<div id="wiiuii" style="box-shadow: 0 0 10px var(--main-shadow);"> <section class="buy-container"> <div class="buy-box"> <div class="slogan"> <h3>Mx博客</h3> <p>欢迎光临!</p> </div> <ul class="actions"> <li> <a href="http://wpa.qq.com/msgrd?v=3&uin=QQ号&site=qq&menu=yes" target="_blank" class="buy-button primary" rel="noopener noreferrer">联系站长</a> </li> <li> <a href="https://wp.magiclee.cn/?golink=aHR0cHM6Ly93d3cud3dydS5jbi9saW5rcw==" target="_blank" class="demo-button" rel="noopener noreferrer">友链通道</a> </li> </ul> </div> <span class="tips"><div id="go-fav">更多精彩文章,按<span>Ctrl</span>+<span>D</span>收藏本站!</div></span> </section> </div> <style type="text/css"> .buy-container{color: #ccc; padding: 60px 40px 50px 40px;margin: 0 auto; background: rgb(224,32,140); /*下述两行代码为兼容浏览器用,建议同步修改,亦可删除(不建议)*/background: -moz-linear-gradient(left, rgb(160,32,240) 0%, rgb(0,191,255) 100%);background: -webkit-linear-gradient(left, rgb(160,32,240) 0%,rgb(0,191,255) 100%); /*请更改此行代码,颜色为rgb模式*/background: linear-gradient(to right, rgb(160,32,240) 0%, rgb(0,191,255) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0208c', endColorstr='#fa6400',GradientType=1 );/*-webkit-border-radius: 8px;-moz-border-radius: 8px;-o-border-radius: 8px;border-radius: 8px;*/border-radius: var(--main-radius);}.buy-container .buy-box{display: -webkit-box; display: flex; -webkit-box-pack: justify; justify-content: space-between; -webkit-box-align: center; align-items: center; max-width: 900px; margin: 0 auto;}@media screen and (max-width: 700px){.buy-container .buy-box{display: block; text-align: center;}.buy-container .buy-box .slogan{margin-bottom: 30px;}}.buy-container .buy-box .slogan h3{color: #fff;font-size: 26px;margin: 0 0 10px 0;}@media screen and (max-width: 800px){.buy-container .buy-box .slogan h3{font-size: 24px;}}@media screen and (max-width: 500px){.buy-container .buy-box .slogan h3{font-size: 20px;}}@media screen and (max-width: 400px){.buy-container .buy-box .slogan h3{font-size: 18px;}}.buy-container .buy-box .slogan p{color: #fff;font-size: 14px;font-weight: bold;margin: 10px 0;}.buy-container .buy-box .actions{display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center;list-style-type: none;margin: 0;padding: 0;}@media screen and (max-width: 700px){.buy-container .buy-box .actions{-webkit-box-pack: justify; justify-content: center;}}.buy-container .buy-box .actions li{margin: 0;}.buy-container .buy-box .actions li:last-child{margin-left: 10px;}.buy-container .buy-box .actions li a{position: relative;color: #fff !important;font-size: 14px;font-weight: bold; line-height: 1;text-decoration: none;padding: 10px 20px;background-color: rgba(255, 255, 255, .1);-webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;-webkit-transition: .2s;-moz-transition: .2s;-o-transition: .2s;transition: .2s;}.buy-container .buy-box .actions li a:hover{-webkit-transform: translateY(-2px);-moz-transform: translateY(-2px);-o-transform: translateY(-2px);transform: translateY(-2px); -webkit-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); -moz-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); -o-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2);opacity: 1 !important;}@media screen and (max-width: 330px){.buy-container .buy-box .actions li a{font-size: 12px;}}.buy-container .buy-box .actions li a:not(.primary):before{content: "";position: absolute;top: 0;left: 0;width: 100%;height: 100%;-webkit-box-shadow: inset 0 0 0 1px currentColor;-moz-box-shadow: inset 0 0 0 1px currentColor;-o-box-shadow: inset 0 0 0 1px currentColor;box-shadow: inset 0 0 0 1px currentColor;-webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;-khtml-opacity: .3;-moz-opacity: .3;opacity: .3;}.buy-container .buy-box .actions li a:after{display: none;}.buy-container .buy-box .actions li a.primary{color: #ff3b30 !important;background-color: #fff;}.buy-container .tips{border-top: 1px solid rgba(255, 255, 255, .1);display: block;color: #fff;font-size: 12px;text-align: center; max-width: 900px;margin: 30px auto 0 auto;padding-top: 30px;}@media screen and (max-width: 768px){.buy-container {padding: 30px 40px 30px 40px;}}#go-fav{width:100%; height:100%; line-height:30px; text-align:center; font-size:14px; font-weight:700; color:rgba(255, 255, 255, 1);}#go-fav span{padding:5px 10px; background:#f0e7e2; border-radius:8px; color:#202020; margin:0 5px;} </style> <script> document.getElementById("wiiuii").parentNode.parentNode.style.padding=0; </script>
<div id="wiiuii" style="box-shadow: 0 0 10px var(--main-shadow);">
<section class="buy-container">
<div class="buy-box">
<div class="slogan">
<h3>Mx博客</h3>
<p>欢迎光临!</p>
</div>
<ul class="actions">
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=QQ号&site=qq&menu=yes" target="_blank" class="buy-button primary" rel="noopener noreferrer">联系站长</a>
</li>
<li>
<a href="https://wp.magiclee.cn/?golink=aHR0cHM6Ly93d3cud3dydS5jbi9saW5rcw==" target="_blank" class="demo-button" rel="noopener noreferrer">友链通道</a>
</li>
</ul>
</div>
<span class="tips"><div id="go-fav">更多精彩文章,按<span>Ctrl</span>+<span>D</span>收藏本站!</div></span>
</section>
</div>
<style type="text/css">
.buy-container{color: #ccc; padding: 60px 40px 50px 40px;margin: 0 auto; background: rgb(224,32,140); /*下述两行代码为兼容浏览器用,建议同步修改,亦可删除(不建议)*/background: -moz-linear-gradient(left, rgb(160,32,240) 0%, rgb(0,191,255) 100%);background: -webkit-linear-gradient(left, rgb(160,32,240) 0%,rgb(0,191,255) 100%); /*请更改此行代码,颜色为rgb模式*/background: linear-gradient(to right, rgb(160,32,240) 0%, rgb(0,191,255) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0208c', endColorstr='#fa6400',GradientType=1 );/*-webkit-border-radius: 8px;-moz-border-radius: 8px;-o-border-radius: 8px;border-radius: 8px;*/border-radius: var(--main-radius);}.buy-container .buy-box{display: -webkit-box; display: flex; -webkit-box-pack: justify; justify-content: space-between; -webkit-box-align: center; align-items: center; max-width: 900px; margin: 0 auto;}@media screen and (max-width: 700px){.buy-container .buy-box{display: block; text-align: center;}.buy-container .buy-box .slogan{margin-bottom: 30px;}}.buy-container .buy-box .slogan h3{color: #fff;font-size: 26px;margin: 0 0 10px 0;}@media screen and (max-width: 800px){.buy-container .buy-box .slogan h3{font-size: 24px;}}@media screen and (max-width: 500px){.buy-container .buy-box .slogan h3{font-size: 20px;}}@media screen and (max-width: 400px){.buy-container .buy-box .slogan h3{font-size: 18px;}}.buy-container .buy-box .slogan p{color: #fff;font-size: 14px;font-weight: bold;margin: 10px 0;}.buy-container .buy-box .actions{display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center;list-style-type: none;margin: 0;padding: 0;}@media screen and (max-width: 700px){.buy-container .buy-box .actions{-webkit-box-pack: justify; justify-content: center;}}.buy-container .buy-box .actions li{margin: 0;}.buy-container .buy-box .actions li:last-child{margin-left: 10px;}.buy-container .buy-box .actions li a{position: relative;color: #fff !important;font-size: 14px;font-weight: bold; line-height: 1;text-decoration: none;padding: 10px 20px;background-color: rgba(255, 255, 255, .1);-webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;-webkit-transition: .2s;-moz-transition: .2s;-o-transition: .2s;transition: .2s;}.buy-container .buy-box .actions li a:hover{-webkit-transform: translateY(-2px);-moz-transform: translateY(-2px);-o-transform: translateY(-2px);transform: translateY(-2px); -webkit-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); -moz-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); -o-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2);opacity: 1 !important;}@media screen and (max-width: 330px){.buy-container .buy-box .actions li a{font-size: 12px;}}.buy-container .buy-box .actions li a:not(.primary):before{content: "";position: absolute;top: 0;left: 0;width: 100%;height: 100%;-webkit-box-shadow: inset 0 0 0 1px currentColor;-moz-box-shadow: inset 0 0 0 1px currentColor;-o-box-shadow: inset 0 0 0 1px currentColor;box-shadow: inset 0 0 0 1px currentColor;-webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;-khtml-opacity: .3;-moz-opacity: .3;opacity: .3;}.buy-container .buy-box .actions li a:after{display: none;}.buy-container .buy-box .actions li a.primary{color: #ff3b30 !important;background-color: #fff;}.buy-container .tips{border-top: 1px solid rgba(255, 255, 255, .1);display: block;color: #fff;font-size: 12px;text-align: center; max-width: 900px;margin: 30px auto 0 auto;padding-top: 30px;}@media screen and (max-width: 768px){.buy-container {padding: 30px 40px 30px 40px;}}#go-fav{width:100%; height:100%; line-height:30px; text-align:center; font-size:14px; font-weight:700; color:rgba(255, 255, 255, 1);}#go-fav span{padding:5px 10px; background:#f0e7e2; border-radius:8px; color:#202020; margin:0 5px;}
</style>
<script>
document.getElementById("wiiuii").parentNode.parentNode.style.padding=0;
</script>
1、后台主题设置—>自定义代码—>自定义 CSS 样式代码把下面的CSS代码添加到里面
/*左边联系站长开始*/ .contact-help{position: fixed; z-index: 101; left: 0; top: calc(50% - 30px); margin-top: -36px; width: 28px; height: 72px; transition: all .3s; font-size: 12px;background: var(--main-bg-color);border-radius: 0 5px 5px 0; padding: 8px 7px; line-height: 14px;}@media screen and (max-width: 768px){.contact-help{display:none;}} /*左边联系站长结束*/
/*左边联系站长开始*/
.contact-help{position: fixed; z-index: 101; left: 0; top: calc(50% - 30px); margin-top: -36px; width: 28px; height: 72px; transition: all .3s; font-size: 12px;background: var(--main-bg-color);border-radius: 0 5px 5px 0; padding: 8px 7px; line-height: 14px;}@media screen and (max-width: 768px){.contact-help{display:none;}}
/*左边联系站长结束*/
2、在主题目录下 themes/zibll/footer.php 下,添加下面的 PHP 代码:
<!--左侧联系站长--> <a href="https://www.wwru.cn/about"target="_blank"class"contact-help main-shadow"style="font-weight:700;"/>联系站长</a>
<!--左侧联系站长-->
<a href="https://www.wwru.cn/about"target="_blank"class"contact-help main-shadow"style="font-weight:700;"/>联系站长</a>
“富强·民主·爱国”鼠标点击效果
- 把代码添加到footer.php文件的</body>之前
<script type="text/javascript"> var a_idx = 0; jQuery(document).ready(function($) { $("body").click(function(e) { var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正" ,"法治", "爱国", "敬业", "诚信", "友善"); var $i = $("<span/>").text(a[a_idx]); a_idx = (a_idx + 1) % a.length; var x = e.pageX, y = e.pageY; $i.css({ "z-index": 999999999999999999999999999999999999999999999999999999999999999999999, "top": y - 20, "left": x, "position": "absolute", "font-weight": "bold", "color": "#ff6651" }); $("body").append($i); $i.animate({ "top": y - 180, "opacity": 0 }, 1500, function() { $i.remove(); }); }); }); </script>
<script type="text/javascript">
var a_idx = 0;
jQuery(document).ready(function($) {
$("body").click(function(e) {
var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正" ,"法治", "爱国", "敬业", "诚信", "友善");
var $i = $("<span/>").text(a[a_idx]);
a_idx = (a_idx + 1) % a.length;
var x = e.pageX,
y = e.pageY;
$i.css({
"z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
"top": y - 20,
"left": x,
"position": "absolute",
"font-weight": "bold",
"color": "#ff6651"
});
$("body").append($i);
$i.animate({
"top": y - 180,
"opacity": 0
},
1500,
function() {
$i.remove();
});
});
});
</script>
点击彩色效果
- 首先创建JS文件,复制下面的代码,粘贴到文件中,然后用script标签调用:代码调用如:<script src=”/cdn/js/dianji.js”></script>后台主题设置里的自定义JS代码里添加
function clickEffect() { let balls = []; let longPressed = false; let longPress; let multiplier = 0; let width, height; let origin; let normal; let ctx; const colours = ["#F73859", "#14FFEC", "#00E0FF", "#FF99FE", "#FAF15D"]; const canvas = document.createElement("canvas"); document.body.appendChild(canvas); canvas.setAttribute("style", "width: 100%; height: 100%; top: 0; left: 0; z-index: 99999; position: fixed; pointer-events: none;"); const pointer = document.createElement("span"); pointer.classList.add("pointer"); document.body.appendChild(pointer); if (canvas.getContext && window.addEventListener) { ctx = canvas.getContext("2d"); updateSize(); window.addEventListener('resize', updateSize, false); loop(); window.addEventListener("mousedown", function(e) { pushBalls(randBetween(10, 20), e.clientX, e.clientY); document.body.classList.add("is-pressed"); longPress = setTimeout(function() { document.body.classList.add("is-longpress"); longPressed = true; }, 500); }, false); window.addEventListener("mouseup", function(e) { clearInterval(longPress); if (longPressed == true) { document.body.classList.remove("is-longpress"); pushBalls(randBetween(50 + Math.ceil(multiplier), 100 + Math.ceil(multiplier)), e.clientX, e.clientY); longPressed = false; } document.body.classList.remove("is-pressed"); }, false); window.addEventListener("mousemove", function(e) { let x = e.clientX; let y = e.clientY; pointer.style.top = y + "px"; pointer.style.left = x + "px"; }, false); } else { console.log("canvas or addEventListener is unsupported!"); } function updateSize() { canvas.width = window.innerWidth * 2; canvas.height = window.innerHeight * 2; canvas.style.width = window.innerWidth + 'px'; canvas.style.height = window.innerHeight + 'px'; ctx.scale(2, 2); width = (canvas.width = window.innerWidth); height = (canvas.height = window.innerHeight); origin = { x: width / 2, y: height / 2 }; normal = { x: width / 2, y: height / 2 }; } class Ball { constructor(x = origin.x, y = origin.y) { this.x = x; this.y = y; this.angle = Math.PI * 2 * Math.random(); if (longPressed == true) { this.multiplier = randBetween(14 + multiplier, 15 + multiplier); } else { this.multiplier = randBetween(6, 12); } this.vx = (this.multiplier + Math.random() * 0.5) * Math.cos(this.angle); this.vy = (this.multiplier + Math.random() * 0.5) * Math.sin(this.angle); this.r = randBetween(8, 12) + 3 * Math.random(); this.color = colours[Math.floor(Math.random() * colours.length)]; } update() { this.x += this.vx - normal.x; this.y += this.vy - normal.y; normal.x = -2 / window.innerWidth * Math.sin(this.angle); normal.y = -2 / window.innerHeight * Math.cos(this.angle); this.r -= 0.3; this.vx *= 0.9; this.vy *= 0.9; } } function pushBalls(count = 1, x = origin.x, y = origin.y) { for (let i = 0; i < count; i++) { balls.push(new Ball(x, y)); } } function randBetween(min, max) { return Math.floor(Math.random() * max) + min; } function loop() { ctx.fillStyle = "rgba(255, 255, 255, 0)"; ctx.clearRect(0, 0, canvas.width, canvas.height); for (let i = 0; i < balls.length; i++) { let b = balls[i]; if (b.r < 0) continue; ctx.fillStyle = b.color; ctx.beginPath(); ctx.arc(b.x, b.y, b.r, 0, Math.PI * 2, false); ctx.fill(); b.update(); } if (longPressed == true) { multiplier += 0.2; } else if (!longPressed && multiplier >= 0) { multiplier -= 0.4; } removeBall(); requestAnimationFrame(loop); } function removeBall() { for (let i = 0; i < balls.length; i++) { let b = balls[i]; if (b.x + b.r < 0 || b.x - b.r > width || b.y + b.r < 0 || b.y - b.r > height || b.r < 0) { balls.splice(i, 1); } } } } clickEffect();
function clickEffect() {
let balls = [];
let longPressed = false;
let longPress;
let multiplier = 0;
let width, height;
let origin;
let normal;
let ctx;
const colours = ["#F73859", "#14FFEC", "#00E0FF", "#FF99FE", "#FAF15D"];
const canvas = document.createElement("canvas");
document.body.appendChild(canvas);
canvas.setAttribute("style", "width: 100%; height: 100%; top: 0; left: 0; z-index: 99999; position: fixed; pointer-events: none;");
const pointer = document.createElement("span");
pointer.classList.add("pointer");
document.body.appendChild(pointer);
if (canvas.getContext && window.addEventListener) {
ctx = canvas.getContext(“2d”);
updateSize();
window.addEventListener(‘resize’, updateSize, false);
loop();
window.addEventListener(“mousedown”, function(e) {
pushBalls(randBetween(10, 20), e.clientX, e.clientY);
document.body.classList.add(“is-pressed”);
longPress = setTimeout(function() {
document.body.classList.add(“is-longpress”);
longPressed = true;
}, 500);
}, false);
window.addEventListener(“mouseup”, function(e) {
clearInterval(longPress);
if (longPressed == true) {
document.body.classList.remove(“is-longpress”);
pushBalls(randBetween(50 + Math.ceil(multiplier), 100 + Math.ceil(multiplier)), e.clientX, e.clientY);
longPressed = false;
}
document.body.classList.remove(“is-pressed”);
}, false);
window.addEventListener(“mousemove”, function(e) {
let x = e.clientX;
let y = e.clientY;
pointer.style.top = y + “px”;
pointer.style.left = x + “px”;
}, false);
} else {
console.log(“canvas or addEventListener is unsupported!”);
}
function updateSize() {
canvas.width = window.innerWidth * 2;
canvas.height = window.innerHeight * 2;
canvas.style.width = window.innerWidth + ‘px’;
canvas.style.height = window.innerHeight + ‘px’;
ctx.scale(2, 2);
width = (canvas.width = window.innerWidth);
height = (canvas.height = window.innerHeight);
origin = {
x: width / 2,
y: height / 2
};
normal = {
x: width / 2,
y: height / 2
};
}
class Ball {
constructor(x = origin.x, y = origin.y) {
this.x = x;
this.y = y;
this.angle = Math.PI * 2 * Math.random();
if (longPressed == true) {
this.multiplier = randBetween(14 + multiplier, 15 + multiplier);
} else {
this.multiplier = randBetween(6, 12);
}
this.vx = (this.multiplier + Math.random() * 0.5) * Math.cos(this.angle);
this.vy = (this.multiplier + Math.random() * 0.5) * Math.sin(this.angle);
this.r = randBetween(8, 12) + 3 * Math.random();
this.color = colours[Math.floor(Math.random() * colours.length)];
}
update() {
this.x += this.vx – normal.x;
this.y += this.vy – normal.y;
normal.x = -2 / window.innerWidth * Math.sin(this.angle);
normal.y = -2 / window.innerHeight * Math.cos(this.angle);
this.r -= 0.3;
this.vx *= 0.9;
this.vy *= 0.9;
}
}
function pushBalls(count = 1, x = origin.x, y = origin.y) {
for (let i = 0; i < count; i++) {
balls.push(new Ball(x, y));
}
}
function randBetween(min, max) {
return Math.floor(Math.random() * max) + min;
}
function loop() {
ctx.fillStyle = “rgba(255, 255, 255, 0)”;
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (let i = 0; i < balls.length; i++) {
let b = balls[i];
if (b.r < 0) continue;
ctx.fillStyle = b.color;
ctx.beginPath();
ctx.arc(b.x, b.y, b.r, 0, Math.PI * 2, false);
ctx.fill();
b.update();
}
if (longPressed == true) {
multiplier += 0.2;
} else if (!longPressed && multiplier >= 0) {
multiplier -= 0.4;
}
removeBall();
requestAnimationFrame(loop);
}
function removeBall() {
for (let i = 0; i < balls.length; i++) {
let b = balls[i];
if (b.x + b.r < 0 || b.x – b.r > width || b.y + b.r < 0 || b.y – b.r > height || b.r < 0) {
balls.splice(i, 1);
}
}
}
}
clickEffect();
- 温馨提示:建议压缩JS代码后再使用,这样或许能使网站加载更快
CSS代码:
/点击更多/ .theme-pagination .ajax-next a, .theme-pagination .order-ajax-next a{border-radius: 30px; padding: 15px 0; color: var(--muted-color); background-color:var(--main-bg-color);color: #FF0033;display: block;opacity: 1;font-weight:bold;}
/点击更多/
.theme-pagination .ajax-next a, .theme-pagination .order-ajax-next a{border-radius: 30px; padding: 15px 0; color: var(--muted-color); background-color:var(--main-bg-color);color: #FF0033;display: block;opacity: 1;font-weight:bold;}
在子比主题设置—>文章&列表—>文章页—>版权提示内容处添加以下代码:
<fieldset style=" border: 1.5px dashed #008cff; padding: 10px; border-radius: 5px; line-height: 2em;font-weight: 700;color: var(--key-color);background-color: var(--body-bg-color);"> <span class="btn-info btn-xs">1</span> 本网站名称:<span style="color: #3333ff"><span style="color: #FF6666; font-size: 18px"><strong>网站名称</strong></span></span><br> <span class="btn-info btn-xs">2</span> 本站永久网址:<font color="#FF6666">网站网址</font><br> <span class="btn-info btn-xs">3</span> 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长QQ进行删除处理。<br> <span class="btn-info btn-xs">4</span> 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。<br> <span class="btn-info btn-xs">5</span> 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报<br> <span class="btn-info btn-xs">6</span> 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。<br> </fieldset>
<fieldset style=" border: 1.5px dashed #008cff; padding: 10px; border-radius: 5px; line-height: 2em;font-weight: 700;color: var(--key-color);background-color: var(--body-bg-color);">
<span class="btn-info btn-xs">1</span> 本网站名称:<span style="color: #3333ff"><span style="color: #FF6666; font-size: 18px"><strong>网站名称</strong></span></span><br>
<span class="btn-info btn-xs">2</span> 本站永久网址:<font color="#FF6666">网站网址</font><br>
<span class="btn-info btn-xs">3</span> 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长QQ进行删除处理。<br>
<span class="btn-info btn-xs">4</span> 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。<br>
<span class="btn-info btn-xs">5</span> 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报<br>
<span class="btn-info btn-xs">6</span> 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。<br>
</fieldset>
1.子比后台—自定义代码—自定义底部代码添加以下代码。
<!-- 灯笼1 --> <div class="deng-box"> <div class="deng"> <div class="xian"></div> <div class="deng-a"> <div class="deng-b"><div class="deng-t">节</div></div> </div> <div class="shui shui-a"><div class="shui-c"></div><div class="shui-b"></div></div> </div> </div> <!-- 灯笼2 --> <div class="deng-box1"> <div class="deng"> <div class="xian"></div> <div class="deng-a"> <div class="deng-b"><div class="deng-t">春</div></div> </div> <div class="shui shui-a"><div class="shui-c"></div><div class="shui-b"></div></div> </div> </div>
<!-- 灯笼1 -->
<div class="deng-box">
<div class="deng">
<div class="xian"></div>
<div class="deng-a">
<div class="deng-b"><div class="deng-t">节</div></div>
</div>
<div class="shui shui-a"><div class="shui-c"></div><div class="shui-b"></div></div>
</div>
</div>
<!– 灯笼2 –>
<div class=”deng-box1″>
<div class=”deng”>
<div class=”xian”></div>
<div class=”deng-a”>
<div class=”deng-b”><div class=”deng-t”>春</div></div>
</div>
<div class=”shui shui-a”><div class=”shui-c”></div><div class=”shui-b”></div></div>
</div>
</div>
2.WP后台— 外观 —自定义—额外CSS添加以下代码。
/**过年灯笼*/ .deng-box { position: fixed; top: 40px; right: -50px; z-index: 999; } .deng-box1 { position: fixed; top: 40px; z-index: 999; right: -20px; } .deng-box1 .deng { position: relative; width: 120px; height: 90px; margin: 50px; background: #d8000f; background: rgba(216, 0, 15, 0.8); border-radius: 50% 50%; -webkit-transform-origin: 50% -100px; -webkit-animation: swing 5s infinite ease-in-out; box-shadow: -5px 5px 30px 4px rgba(252, 144, 61, 1); } .deng { position: relative; width: 120px; height: 90px; margin: 50px; background: #d8000f; background: rgba(216, 0, 15, 0.8); border-radius: 50% 50%; -webkit-transform-origin: 50% -100px; -webkit-animation: swing 3s infinite ease-in-out; box-shadow: -5px 5px 50px 4px rgba(250, 108, 0, 1); } .deng-a { width: 100px; height: 90px; background: #d8000f; background: rgba(216, 0, 15, 0.1); margin: 12px 8px 8px 10px; border-radius: 50% 50%; border: 2px solid #dc8f03; } .deng-b { width: 45px; height: 90px; background: #d8000f; background: rgba(216, 0, 15, 0.1); margin: -4px 8px 8px 26px; border-radius: 50% 50%; border: 2px solid #dc8f03; } .xian { position: absolute; top: -20px; left: 60px; width: 2px; height: 20px; background: #dc8f03; } .shui-a { position: relative; width: 5px; height: 20px; margin: -5px 0 0 59px; -webkit-animation: swing 4s infinite ease-in-out; -webkit-transform-origin: 50% -45px; background: #ffa500; border-radius: 0 0 5px 5px; } .shui-b { position: absolute; top: 14px; left: -2px; width: 10px; height: 10px; background: #dc8f03; border-radius: 50%; } .shui-c { position: absolute; top: 18px; left: -2px; width: 10px; height: 35px; background: #ffa500; border-radius: 0 0 0 5px; } .deng:before { position: absolute; top: -7px; left: 29px; height: 12px; width: 60px; content: " "; display: block; z-index: 999; border-radius: 5px 5px 0 0; border: solid 1px #dc8f03; background: #ffa500; background: linear-gradient(to right, #dc8f03, #ffa500, #dc8f03, #ffa500, #dc8f03); } .deng:after { position: absolute; bottom: -7px; left: 10px; height: 12px; width: 60px; content: " "; display: block; margin-left: 20px; border-radius: 0 0 5px 5px; border: solid 1px #dc8f03; background: #ffa500; background: linear-gradient(to right, #dc8f03, #ffa500, #dc8f03, #ffa500, #dc8f03); } .deng-t { font-family: 华文行楷,Arial,Lucida Grande,Tahoma,sans-serif; font-size: 3.2rem; color: #dc8f03; font-weight: bold; line-height: 85px; text-align: center; } .night .deng-t, .night .deng-box, .night .deng-box1 { background: transparent !important; } @-moz-keyframes swing { 0% { -moz-transform: rotate(-10deg) } 50% { -moz-transform: rotate(10deg) } 100% { -moz-transform: rotate(-10deg) } } @-webkit-keyframes swing { 0% { -webkit-transform: rotate(-10deg) } 50% { -webkit-transform: rotate(10deg) } 100% { -webkit-transform: rotate(-10deg) } }@media screen and (max-width: 768px){.deng-box{position: fixed; top: 23px; right: -50px; z-index: 999;}.deng-box1 { position: fixed; top: 23px; z-index: 999; right: -20px; }}<br>
/**过年灯笼*/
.deng-box {
position: fixed;
top: 40px;
right: -50px;
z-index: 999;
}
.deng-box1 {
position: fixed;
top: 40px;
z-index: 999;
right: -20px;
}
.deng-box1 .deng {
position: relative;
width: 120px;
height: 90px;
margin: 50px;
background: #d8000f;
background: rgba(216, 0, 15, 0.8);
border-radius: 50% 50%;
-webkit-transform-origin: 50% -100px;
-webkit-animation: swing 5s infinite ease-in-out;
box-shadow: -5px 5px 30px 4px rgba(252, 144, 61, 1);
}
.deng {
position: relative;
width: 120px;
height: 90px;
margin: 50px;
background: #d8000f;
background: rgba(216, 0, 15, 0.8);
border-radius: 50% 50%;
-webkit-transform-origin: 50% -100px;
-webkit-animation: swing 3s infinite ease-in-out;
box-shadow: -5px 5px 50px 4px rgba(250, 108, 0, 1);
}
.deng-a {
width: 100px;
height: 90px;
background: #d8000f;
background: rgba(216, 0, 15, 0.1);
margin: 12px 8px 8px 10px;
border-radius: 50% 50%;
border: 2px solid #dc8f03;
}
.deng-b {
width: 45px;
height: 90px;
background: #d8000f;
background: rgba(216, 0, 15, 0.1);
margin: -4px 8px 8px 26px;
border-radius: 50% 50%;
border: 2px solid #dc8f03;
}
.xian {
position: absolute;
top: -20px;
left: 60px;
width: 2px;
height: 20px;
background: #dc8f03;
}
.shui-a {
position: relative;
width: 5px;
height: 20px;
margin: -5px 0 0 59px;
-webkit-animation: swing 4s infinite ease-in-out;
-webkit-transform-origin: 50% -45px;
background: #ffa500;
border-radius: 0 0 5px 5px;
}
.shui-b {
position: absolute;
top: 14px;
left: -2px;
width: 10px;
height: 10px;
background: #dc8f03;
border-radius: 50%;
}
.shui-c {
position: absolute;
top: 18px;
left: -2px;
width: 10px;
height: 35px;
background: #ffa500;
border-radius: 0 0 0 5px;
}
.deng:before {
position: absolute;
top: -7px;
left: 29px;
height: 12px;
width: 60px;
content: ” “;
display: block;
z-index: 999;
border-radius: 5px 5px 0 0;
border: solid 1px #dc8f03;
background: #ffa500;
background: linear-gradient(to right, #dc8f03, #ffa500, #dc8f03, #ffa500, #dc8f03);
}
.deng:after {
position: absolute;
bottom: -7px;
left: 10px;
height: 12px;
width: 60px;
content: ” “;
display: block;
margin-left: 20px;
border-radius: 0 0 5px 5px;
border: solid 1px #dc8f03;
background: #ffa500;
background: linear-gradient(to right, #dc8f03, #ffa500, #dc8f03, #ffa500, #dc8f03);
}
.deng-t {
font-family: 华文行楷,Arial,Lucida Grande,Tahoma,sans-serif;
font-size: 3.2rem;
color: #dc8f03;
font-weight: bold;
line-height: 85px;
text-align: center;
}
.night .deng-t,
.night .deng-box,
.night .deng-box1 {
background: transparent !important;
}
@-moz-keyframes swing {
0% {
-moz-transform: rotate(-10deg)
}
50% {
-moz-transform: rotate(10deg)
}
100% {
-moz-transform: rotate(-10deg)
}
}
@-webkit-keyframes swing {
0% {
-webkit-transform: rotate(-10deg)
}
50% {
-webkit-transform: rotate(10deg)
}
100% {
-webkit-transform: rotate(-10deg)
}
}@media screen and (max-width: 768px){.deng-box{position: fixed; top: 23px; right: -50px; z-index: 999;}.deng-box1 { position: fixed; top: 23px; z-index: 999; right: -20px; }}<br>
默认是灯笼都在右上角位置,比照原文主要是调整了位置,避免遮挡顶部导航菜单。如果想一边一个,上面代码开头的.deng-box和.deng-box1修改为下面代码即可。
后台设置-自定义代码-自定义CSS样式添加以下代码。
/*导航栏字体加粗*/ ul.nav {font-weight: 700;}
/*导航栏字体加粗*/
ul.nav {font-weight: 700;}
效果预览
在 zibll 主题目录下,themes/zibll/footer.php 文件中的“</footer>”(重要)下面添加下面的代码:
<!--底部波浪开始--> <div class="wiiuii_layout"> <svg class="editorial" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none"> <defs> <path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" /> </defs> <g class="parallax"> <use xlink:href="#gentle-wave" x="50" y="0" fill="#4579e2"/> <use xlink:href="#gentle-wave" x="50" y="3" fill="#3461c1"/> <use xlink:href="#gentle-wave" x="50" y="6" fill="#2d55aa"/> </g> </svg> </div> <style type='text/css'> .parallax > use{animation: move-forever 12s linear infinite;}.parallax > use:nth-child(1){animation-delay: -2s;}.parallax > use:nth-child(2){animation-delay: -2s; animation-duration: 5s;}.parallax > use:nth-child(3){animation-delay: -4s; animation-duration: 3s;}@keyframes move-forever{0%{transform: translate(-90px, 0%);} 100%{transform: translate(85px, 0%);}}.wiiuii_layout{width: 100%;height: 40px;position: relative;overflow: hidden;z-index: 1;background: var(--footer-bg);}.editorial{display: block; width: 100%; height: 40px; margin: 0;} </style> <!--底部波浪结束-->
<!--底部波浪开始-->
<div class="wiiuii_layout">
<svg class="editorial"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 24 150 28"
preserveAspectRatio="none">
<defs>
<path id="gentle-wave"
d="M-160 44c30 0
58-18 88-18s
58 18 88 18
58-18 88-18
58 18 88 18
v44h-352z" />
</defs>
<g class="parallax">
<use xlink:href="#gentle-wave" x="50" y="0" fill="#4579e2"/>
<use xlink:href="#gentle-wave" x="50" y="3" fill="#3461c1"/>
<use xlink:href="#gentle-wave" x="50" y="6" fill="#2d55aa"/>
</g>
</svg>
</div>
<style type='text/css'>
.parallax > use{animation: move-forever 12s linear infinite;}.parallax > use:nth-child(1){animation-delay: -2s;}.parallax > use:nth-child(2){animation-delay: -2s; animation-duration: 5s;}.parallax > use:nth-child(3){animation-delay: -4s; animation-duration: 3s;}@keyframes move-forever{0%{transform: translate(-90px, 0%);} 100%{transform: translate(85px, 0%);}}.wiiuii_layout{width: 100%;height: 40px;position: relative;overflow: hidden;z-index: 1;background: var(--footer-bg);}.editorial{display: block; width: 100%; height: 40px; margin: 0;}
</style>
<!--底部波浪结束-->
- 分为三个步骤
- 1.将下面的 PHP 代码加入到主题目录下:themes/zibll/functions.php 文件中。
//文章过期提示开始 function article_time_update() { date_default_timezone_set('PRC'); $newdate=time(); $updated_date = get_the_modified_time('Y-m-d H:i:s'); $updatetime=strtotime($updated_date); $custom_content = ''; if ( $newdate > $updatetime+86400) { $custom_content= '<div class="article-timeout"><strong><i class="fa fa-bell" aria-hidden="true"></i> 温馨提示:</strong>本文最后更新于<code>'. $updated_date . '</code>,某些文章具有时效性,若有错误或已失效,请在下方<a href="#comment">留言</a>或联系<a target="_blank" title="MX博客"https://www.wwru.cn/about"><b>Mx</b></a>。</div >'; } echo $custom_content; } //文章过期提示结束
//文章过期提示开始
function article_time_update() {
date_default_timezone_set('PRC');
$newdate=time();
$updated_date = get_the_modified_time('Y-m-d H:i:s');
$updatetime=strtotime($updated_date);
$custom_content = '';
if ( $newdate > $updatetime+86400) {
$custom_content= '<div class="article-timeout"><strong><i class="fa fa-bell" aria-hidden="true"></i> 温馨提示:</strong>本文最后更新于<code>'. $updated_date . '</code>,某些文章具有时效性,若有错误或已失效,请在下方<a href="#comment">留言</a>或联系<a target="_blank" title="MX博客"https://www.wwru.cn/about"><b>Mx</b></a>。</div >';
}
echo $custom_content;
}
//文章过期提示结束
- 说明:请自己修改上面有关于自己网站的信息,改成自己网站信息即可,图标可以用阿里矢量图。
2.在主题目录themes/zibll/inc/functions/zib-single.php 文件中,文章分页函数(我的是在 322 行,因为我的代码有改动,所有不确定行数,见下图)下面添加下方代码即可
- PHP 代码:
article_time_update();//文章过期提示
article_time_update();//文章过期提示
3.CSS 代码:(在自定义 CSS 样式添加下面代码)
/*过期文章提示样式*/ .article-timeout{position:relative; border-radius: 8px; position: relative; margin-bottom: 25px; padding: 10px; background-color: var(--body-bg-color);}
/*过期文章提示样式*/
.article-timeout{position:relative; border-radius: 8px; position: relative; margin-bottom: 25px; padding: 10px; background-color: var(--body-bg-color);}
1.子比主题设置—>自定义代码—>自定义javascript代码:,添加以下代码:
//透明复制提示 document.body.oncopy = function() {layer.msg('<p style="font-weight: 700;">【Mx博客-www.wwru.cn】<br>复制成功,若要转载请务必保留原文链接!</p>', function(){});};
//透明复制提示
document.body.oncopy = function() {layer.msg('<p style="font-weight: 700;">【Mx博客-www.wwru.cn】<br>复制成功,若要转载请务必保留原文链接!</p>', function(){});};
2.子比主题设置—>自定义代码—>自定义底部HTML代码,添加以下代码:
<!--透明复制提示开始--> <script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script> <!--透明复制提示结束-->
<!--透明复制提示开始-->
<script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
<!--透明复制提示结束-->
- 在主题目录下go.php文件里面的全部代码清空,然后把下面的代码复制进去即可。替换原来的即可。
- 更新主题和修改前记得备份go.php。
注意:修改代码内的第 108 行的 logo 地址,本教程适用于子比主题最新版,其他主题请自行测试。
<?php if ( strlen($_SERVER['REQUEST_URI']) > 384 || strpos($_SERVER['REQUEST_URI'], "eval(") || strpos($_SERVER['REQUEST_URI'], "base64") ) { @header("HTTP/1.1 414 Request-URI Too Long"); @header("Status: 414 Request-URI Too Long"); @header("Connection: Close"); @exit; } //通过 QUERY_STRING 取得完整的传入数据,然后取得 url=之后的所有值,兼容性更好 @session_start(); $t_url = !empty($_SESSION['GOLINK']) ? $_SESSION['GOLINK'] : preg_replace('/^url=(.*)$/i', '$1', $_SERVER["QUERY_STRING"]); //数据处理 if (!empty($t_url)) { //判断取值是否加密 if ($t_url == base64_encode(base64_decode($t_url))) { $t_url = base64_decode($t_url); } //防止 xss $t_url = htmlspecialchars($t_url); //对取值进行网址校验和判断 preg_match('/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i', $t_url, $matches); if ($matches) { $url = $t_url; $title = '页面加载中,请稍候...'; } else { preg_match('/\./i', $t_url, $matche); if ($matche) { $url = 'http://' . $t_url; $title = '页面加载中,请稍候...'; } else { $url = 'http://' . $_SERVER['HTTP_HOST']; $title = '参数错误,正在返回首页...'; } } } else { $title = '参数缺失,正在返回首页...'; $url = 'http://' . $_SERVER['HTTP_HOST']; } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="robots" content="noindex, nofollow" /> <title><?php echo $title; ?></title> <meta name="keywords" content=""> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" /> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <meta name="renderer" content="webkit"/> <meta name="force-rendering" content="webkit"/> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/> <link rel="shortcut icon" type="image/ico" href="/favicon.ico"> <script> function link_jump() { //禁止其他网站使用我们的跳转页面 var MyHOST = new RegExp("<?php echo $_SERVER['HTTP_HOST']; ?>"); if (!MyHOST.test(document.referrer)) { location.href="https://" + MyHOST; } location.href="<?php echo $url; ?>"; } //延时 1S 跳转,可自行修改延时时间 //setTimeout(link_jump, 1500); //延时 50S 关闭跳转页面,用于文件下载后不会关闭跳转页的问题 setTimeout(function(){window.opener=null;window.close();}, 50000); </script> <style> *,:after,:before{box-sizing:border-box}body.reader-black-font,body.reader-black-font .history-mode .view-area,body.reader-black-font .history-mode .view-area pre,body.reader-black-font .main .kalamu-area,body.reader-black-font .main .markdown .text,body.reader-black-font input,body.reader-black-font select,body.reader-black-font textarea{font-family:-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif}body{background:#f6f7f8}.ext-link__wrapper{position:absolute;width:620px;padding:40px 0;border-radius:6px;text-align:center;top:118px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);background-color:#fff;box-shadow:0 1px 3px rgba(27,95,160,.1);overflow:hidden}.title{font-size:22px;color:#2f2f2f}.sub-title{font-size:16px;color:#888;margin-top:8px}.link-bd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:460px;margin:12px auto 0;padding:10px;border-radius:4px;background:#ebf6ff;border:1px solid #dceaf5;zoom:1}.link-bd:after,.link-bd:before{content:" ";display:table}.link-bd .link-bd__icon{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:flex;align-items:center;width:40px;justify-content:center;height:40px;line-height:40px;font-size:20px;background:#bcc6d8;text-align:center;border-radius:2px}.link-btn{text-align:center;font-size:0;margin-top:24px}.link-bd .link-bd__text{font-size:14px;color:#006cbe;margin-left:10px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.link-btn__text{display:inline-block;width:144px;height:44px;line-height:43px;border-radius:22px;font-size:14px;color:#006cbe;border:1px solid #006cbe;cursor:pointer;text-decoration:none}.link-btn__text:hover{color:#fff;background:#006cbe} .alert-footer { margin: 0 auto; height: 90px; width: 130px; padding-top: 30px; } .alert-footer-icon { float: left; margin-top: 10px; margin-right: 6px; } .alert-footer-text { float: left; border-left: 2px solid #EEE; padding: 3px 0 0 5px; height: 60px; color: #0B85CC; font-size: 12px; text-align: left; } .alert-footer-text p { color: #7A7A7A; font-size: 22px; line-height: 18px; margin-top: 0px; } </style> </head> <body> <div class="ext-link__wrapper"> <img src="/wp-content/themes/zibll/img/logo.png" width="200" style="margin-bottom: 30px;"><!--可修改成自己的 LOGO--> <div class="title">即将跳转到外部网站</div> <div class="sub-title">跳转网站安全性未知,是否继续</div> <div class="link-bd"> <div class="link-bd__icon"><svg t="1585116627498" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2855" width="32" height="32"> <path d="M580.906667 682.496a8.96 8.96 0 0 0-12.501334 0l-129.109333 129.152c-59.818667 59.818667-160.682667 66.133333-226.688 0-66.133333-66.133333-59.733333-166.912 0-226.688l129.109333-129.152a8.917333 8.917333 0 0 0 0-12.544L297.514667 399.061333a8.917333 8.917333 0 0 0-12.544 0l-129.152 129.066667a240.256 240.256 0 0 0 0 340.053333 240.213333 240.213333 0 0 0 340.053333 0l129.066667-129.109333a8.917333 8.917333 0 0 0 0-12.586667l-43.989334-43.989333h-0.042666zM868.224 155.733333a240.554667 240.554667 0 0 1 0 340.138667l-129.109333 129.152a8.917333 8.917333 0 0 1-12.544 0l-44.202667-44.202667a8.96 8.96 0 0 1 0-12.629333l129.109333-129.066667c59.818667-59.818667 66.133333-160.597333 0-226.730666-66.005333-66.133333-166.869333-59.818667-226.688 0l-129.066666 129.194666a8.96 8.96 0 0 1-12.544 0L399.061333 297.514667a8.96 8.96 0 0 1 0-12.544l129.237334-129.152a240.213333 240.213333 0 0 1 339.925333 0v-0.042667z m-247.210667 201.045334l43.946667 43.989333a8.917333 8.917333 0 0 1 0 12.544l-251.562667 251.562667a8.917333 8.917333 0 0 1-12.544 0l-44.032-43.946667a8.917333 8.917333 0 0 1 0-12.544l251.690667-251.605333a8.96 8.96 0 0 1 12.544 0h-0.042667z" fill="#006CBE" fill-opacity=".87" p-id="2856"></path> </svg></div> <div class="link-bd__text"><?php echo $url; ?></div> </div> <div class="link-btn"> <a href="javascript:void(0);" onclick="javascript:window.location.href='<?php echo $url; ?>'" class="link-btn__text">继续前往</a> <a href="<?php echo $_SERVER['HTTP_HOST']; ?>" class="link-btn__text" style="margin-left:100px;">回到主页</a> </div> <div class="alert-footer"> <svg width="46px" height="42px" class="alert-footer-icon"> <circle fill-rule="evenodd" clip-rule="evenodd" fill="#7B7B7B" stroke="#DEDFE0" stroke-width="2" stroke-miterlimit="10" cx="21.917" cy="21.25" r="17"/> <path fill="#FFF" d="M22.907,27.83h-1.98l0.3-2.92c-0.37-0.22-0.61-0.63-0.61-1.1c0-0.71,0.58-1.29,1.3-1.29s1.3,0.58,1.3,1.29 c0,0.47-0.24,0.88-0.61,1.1L22.907,27.83z M18.327,17.51c0-1.98,1.61-3.59,3.59-3.59s3.59,1.61,3.59,3.59v2.59h-7.18V17.51z M27.687,20.1v-2.59c0-3.18-2.59-5.76-5.77-5.76s-5.76,2.58-5.76,5.76v2.59h-1.24v10.65h14V20.1H27.687z"/> <circle fill-rule="evenodd" clip-rule="evenodd" fill="#FEFEFE" cx="35.417" cy="10.75" r="6.5"/> <polygon fill="#7B7B7B" stroke="#7B7B7B" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="35.417,12.16 32.797,9.03 31.917,10.07 35.417,14.25 42.917,5.29 42.037,4.25 "/> </svg> <div class="alert-footer-text"><p>secure</p>安全加密 </div> </div> </div> </body> </html>
<?php
if (
strlen($_SERVER['REQUEST_URI']) > 384 ||
strpos($_SERVER['REQUEST_URI'], "eval(") ||
strpos($_SERVER['REQUEST_URI'], "base64")
) {
@header("HTTP/1.1 414 Request-URI Too Long");
@header("Status: 414 Request-URI Too Long");
@header("Connection: Close");
@exit;
}
//通过 QUERY_STRING 取得完整的传入数据,然后取得 url=之后的所有值,兼容性更好
@session_start();
$t_url = !empty($_SESSION[‘GOLINK’]) ? $_SESSION[‘GOLINK’] : preg_replace(‘/^url=(.*)$/i’, ‘$1’, $_SERVER[“QUERY_STRING”]);
//数据处理
if (!empty($t_url)) {
//判断取值是否加密
if ($t_url == base64_encode(base64_decode($t_url))) {
$t_url = base64_decode($t_url);
}
//防止 xss
$t_url = htmlspecialchars($t_url);
//对取值进行网址校验和判断
preg_match(‘/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i’, $t_url, $matches);
if ($matches) {
$url = $t_url;
$title = ‘页面加载中,请稍候…’;
} else {
preg_match(‘/\./i’, $t_url, $matche);
if ($matche) {
$url = ‘http://’ . $t_url;
$title = ‘页面加载中,请稍候…’;
} else {
$url = ‘http://’ . $_SERVER[‘HTTP_HOST’];
$title = ‘参数错误,正在返回首页…’;
}
}
} else {
$title = ‘参数缺失,正在返回首页…’;
$url = ‘http://’ . $_SERVER[‘HTTP_HOST’];
}
?>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<meta name=”robots” content=”noindex, nofollow” />
<title><?php echo $title; ?></title>
<meta name=”keywords” content=””>
<meta name=”description” content=””>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover” />
<meta http-equiv=”Cache-Control” content=”no-transform” />
<meta http-equiv=”Cache-Control” content=”no-siteapp” />
<meta name=”renderer” content=”webkit”/>
<meta name=”force-rendering” content=”webkit”/>
<meta http-equiv=”X-UA-Compatible” content=”IE=Edge,chrome=1″/>
<link rel=”shortcut icon” type=”image/ico” href=”/favicon.ico”>
<script>
function link_jump()
{
//禁止其他网站使用我们的跳转页面
var MyHOST = new RegExp(“<?php echo $_SERVER[‘HTTP_HOST’]; ?>”);
if (!MyHOST.test(document.referrer)) {
location.href=”https://” + MyHOST;
}
location.href=”<?php echo $url; ?>”;
}
//延时 1S 跳转,可自行修改延时时间
//setTimeout(link_jump, 1500);
//延时 50S 关闭跳转页面,用于文件下载后不会关闭跳转页的问题
setTimeout(function(){window.opener=null;window.close();}, 50000);
</script>
<style>
*,:after,:before{box-sizing:border-box}body.reader-black-font,body.reader-black-font .history-mode .view-area,body.reader-black-font .history-mode .view-area pre,body.reader-black-font .main .kalamu-area,body.reader-black-font .main .markdown .text,body.reader-black-font input,body.reader-black-font select,body.reader-black-font textarea{font-family:-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif}body{background:#f6f7f8}.ext-link__wrapper{position:absolute;width:620px;padding:40px 0;border-radius:6px;text-align:center;top:118px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);background-color:#fff;box-shadow:0 1px 3px rgba(27,95,160,.1);overflow:hidden}.title{font-size:22px;color:#2f2f2f}.sub-title{font-size:16px;color:#888;margin-top:8px}.link-bd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:460px;margin:12px auto 0;padding:10px;border-radius:4px;background:#ebf6ff;border:1px solid #dceaf5;zoom:1}.link-bd:after,.link-bd:before{content:” “;display:table}.link-bd .link-bd__icon{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:flex;align-items:center;width:40px;justify-content:center;height:40px;line-height:40px;font-size:20px;background:#bcc6d8;text-align:center;border-radius:2px}.link-btn{text-align:center;font-size:0;margin-top:24px}.link-bd .link-bd__text{font-size:14px;color:#006cbe;margin-left:10px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.link-btn__text{display:inline-block;width:144px;height:44px;line-height:43px;border-radius:22px;font-size:14px;color:#006cbe;border:1px solid #006cbe;cursor:pointer;text-decoration:none}.link-btn__text:hover{color:#fff;background:#006cbe}
.alert-footer {
margin: 0 auto;
height: 90px;
width: 130px;
padding-top: 30px;
}
.alert-footer-icon {
float: left;
margin-top: 10px;
margin-right: 6px;
}
.alert-footer-text {
float: left;
border-left: 2px solid #EEE;
padding: 3px 0 0 5px;
height: 60px;
color: #0B85CC;
font-size: 12px;
text-align: left;
}
.alert-footer-text p {
color: #7A7A7A;
font-size: 22px;
line-height: 18px;
margin-top: 0px;
}
</style>
</head>
<body>
<div class=”ext-link__wrapper”>
<img src=”/wp-content/themes/zibll/img/logo.png” width=”200″ style=”margin-bottom: 30px;”><!–可修改成自己的 LOGO–>
<div class=”title”>即将跳转到外部网站</div>
<div class=”sub-title”>跳转网站安全性未知,是否继续</div>
<div class=”link-bd”>
<div class=”link-bd__icon”><svg t=”1585116627498″ class=”icon” viewBox=”0 0 1024 1024″ version=”1.1″
xmlns=”http://www.w3.org/2000/svg” p-id=”2855″ width=”32″ height=”32″>
<path
d=”M580.906667 682.496a8.96 8.96 0 0 0-12.501334 0l-129.109333 129.152c-59.818667 59.818667-160.682667 66.133333-226.688 0-66.133333-66.133333-59.733333-166.912 0-226.688l129.109333-129.152a8.917333 8.917333 0 0 0 0-12.544L297.514667 399.061333a8.917333 8.917333 0 0 0-12.544 0l-129.152 129.066667a240.256 240.256 0 0 0 0 340.053333 240.213333 240.213333 0 0 0 340.053333 0l129.066667-129.109333a8.917333 8.917333 0 0 0 0-12.586667l-43.989334-43.989333h-0.042666zM868.224 155.733333a240.554667 240.554667 0 0 1 0 340.138667l-129.109333 129.152a8.917333 8.917333 0 0 1-12.544 0l-44.202667-44.202667a8.96 8.96 0 0 1 0-12.629333l129.109333-129.066667c59.818667-59.818667 66.133333-160.597333 0-226.730666-66.005333-66.133333-166.869333-59.818667-226.688 0l-129.066666 129.194666a8.96 8.96 0 0 1-12.544 0L399.061333 297.514667a8.96 8.96 0 0 1 0-12.544l129.237334-129.152a240.213333 240.213333 0 0 1 339.925333 0v-0.042667z m-247.210667 201.045334l43.946667 43.989333a8.917333 8.917333 0 0 1 0 12.544l-251.562667 251.562667a8.917333 8.917333 0 0 1-12.544 0l-44.032-43.946667a8.917333 8.917333 0 0 1 0-12.544l251.690667-251.605333a8.96 8.96 0 0 1 12.544 0h-0.042667z”
fill=”#006CBE” fill-opacity=”.87″ p-id=”2856″></path>
</svg></div>
<div class=”link-bd__text”><?php echo $url; ?></div>
</div>
<div class=”link-btn”>
<a href=”javascript:void(0);” onclick=”javascript:window.location.href='<?php echo $url; ?>'” class=”link-btn__text”>继续前往</a>
<a href=”<?php echo $_SERVER[‘HTTP_HOST’]; ?>” class=”link-btn__text” style=”margin-left:100px;”>回到主页</a>
</div>
<div class=”alert-footer”>
<svg width=”46px” height=”42px” class=”alert-footer-icon”>
<circle fill-rule=”evenodd” clip-rule=”evenodd” fill=”#7B7B7B” stroke=”#DEDFE0″ stroke-width=”2″ stroke-miterlimit=”10″ cx=”21.917″ cy=”21.25″ r=”17″/>
<path fill=”#FFF” d=”M22.907,27.83h-1.98l0.3-2.92c-0.37-0.22-0.61-0.63-0.61-1.1c0-0.71,0.58-1.29,1.3-1.29s1.3,0.58,1.3,1.29 c0,0.47-0.24,0.88-0.61,1.1L22.907,27.83z M18.327,17.51c0-1.98,1.61-3.59,3.59-3.59s3.59,1.61,3.59,3.59v2.59h-7.18V17.51z M27.687,20.1v-2.59c0-3.18-2.59-5.76-5.77-5.76s-5.76,2.58-5.76,5.76v2.59h-1.24v10.65h14V20.1H27.687z”/>
<circle fill-rule=”evenodd” clip-rule=”evenodd” fill=”#FEFEFE” cx=”35.417″ cy=”10.75″ r=”6.5″/>
<polygon fill=”#7B7B7B” stroke=”#7B7B7B” stroke-linecap=”round” stroke-linejoin=”round” stroke-miterlimit=”10″ points=”35.417,12.16 32.797,9.03 31.917,10.07 35.417,14.25 42.917,5.29 42.037,4.25 “/>
</svg>
<div class=”alert-footer-text”><p>secure</p>安全加密 </div>
</div>
</div>
</body>
</html>
- 网站全体变灰主要在用于哀悼缅怀烈士和悼念日使用,国家公祭日等等
- 勿忘历史勿忘痛
使用教程
也很简单,只需要在两个文件中添加一行代码就可以实现,具体演示效果可以查看上方截图的效果
1、后台主题设置—>自定义代码—>自定义 CSS 样式代码把下面的代码添加到里面
其他网页或者主题直接在 foot 或者 head 文件底部添加即可,记得添加引用即可如
<style type=”text/css”>此处中间添加 css 代码样式</style>
CSS 样式代码:
样式一代码:推荐使用
/*网站整体灰白样式开始一*/ :root { --BG_COLOR: #121212; --FONT_COLOR: rgba(255, 255, 255, .87); --TAB_TITLES_COLOR: rgba(255, 255, 255, .6); --SUB_TITLE_COLOR: rgba(255, 255, 255, .38); --TAB_TITLES_HOVER_COLOR: #fff; --TITLE_HOVER_COLOR: #0D9BFF; --RIGHT_CONTENT_TEXT_COLOR: rgba(255, 255, 255, .5); --FOCUS_BG_COLOR: #222222; --TAB_SUBTITLES_BG_COLOR: rgba(50, 51, 53, .7); --IMG_DEFAULT_COLOR: #333333; } html { -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); } body{ filter:gray; } /*网站整体灰白样式开始一*/
/*网站整体灰白样式开始一*/
:root {
--BG_COLOR: #121212;
--FONT_COLOR: rgba(255, 255, 255, .87);
--TAB_TITLES_COLOR: rgba(255, 255, 255, .6);
--SUB_TITLE_COLOR: rgba(255, 255, 255, .38);
--TAB_TITLES_HOVER_COLOR: #fff;
--TITLE_HOVER_COLOR: #0D9BFF;
--RIGHT_CONTENT_TEXT_COLOR: rgba(255, 255, 255, .5);
--FOCUS_BG_COLOR: #222222;
--TAB_SUBTITLES_BG_COLOR: rgba(50, 51, 53, .7);
--IMG_DEFAULT_COLOR: #333333;
}
html {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
}
body{
filter:gray;
}
/*网站整体灰白样式开始一*/
第二种样式代码:
/*网站整体灰白样式开始二*/ body { -webkit-filter: grayscale(100%); /* webkit */ -moz-filter: grayscale(100%); /*firefox*/ -ms-filter: grayscale(100%); /*ie9*/ -o-filter: grayscale(100%); /*opera*/ filter: grayscale(100%); } /*网站整体灰白样式二结束*/
/*网站整体灰白样式开始二*/
body {
-webkit-filter: grayscale(100%); /* webkit */
-moz-filter: grayscale(100%); /*firefox*/
-ms-filter: grayscale(100%); /*ie9*/
-o-filter: grayscale(100%); /*opera*/
filter: grayscale(100%);
}
/*网站整体灰白样式二结束*/
第三种样式代码:
/*网站整体灰白样式开始三*/ html{ -webkit-filter: grayscale(100%); filter: grayscale(100%); } /*网站整体灰白开始样式三结束*/
/*网站整体灰白样式开始三*/
html{
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
/*网站整体灰白开始样式三结束*/
效果预览
后台设置—>外观—>小工具—>添加自定义 HTML 代码,加到合适侧边栏即可
<div id="he-plugin-standard"></div> <script> WIDGET = { "CONFIG": { "layout": "2", "width": "285", "height": "300", "background": "1", "dataColor": "FFFFFF", "borderRadius": "5", "key": "3180d3c43e524753ab8bcef69dba023a" } } </script> <script src="https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"></script>
<div id="he-plugin-standard"></div>
<script>
WIDGET = {
"CONFIG": {
"layout": "2",
"width": "285",
"height": "300",
"background": "1",
"dataColor": "FFFFFF",
"borderRadius": "5",
"key": "3180d3c43e524753ab8bcef69dba023a"
}
}
</script>
<script src="https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"></script>
效果演示:
1、在后台子比主题设置—自定义 CSS 样式 添加以下代码:
#percentageCounter{position:fixed; left:0; top:0; height:3px; z-index:99999; background-image: linear-gradient(to right, #339933,#FF6666);border-radius:5px;} /*底部可爱底线提示*/
#percentageCounter{position:fixed; left:0; top:0; height:3px; z-index:99999; background-image: linear-gradient(to right, #339933,#FF6666);border-radius:5px;}
/*底部可爱底线提示*/
2、在 zibll 主题目录下,themes/zibll/footer.php 文件中的“第一行”(重要)下面添加下面的代码:
<!--底部可爱底线提示--> <div class="app_normal window" style="padding-top:" data-reactroot=""><div class="common_container lastpagenotice_noticewrap"><img src="https://z3.ax1x.com/2021/08/25/hZZUjU.png" data-spm-anchor-id="a2ha1.14919748_WEBHOME_GRAY.0.i1"><div class="lastpagenotice_text" style="color:#6699FF;font-weight:bold;">我也是有底线哒~</div><div class="lastpagenotice_line"></div></div></div> <!--底部可爱底线提示-->
<!--底部可爱底线提示-->
<div class="app_normal window" style="padding-top:" data-reactroot=""><div class="common_container lastpagenotice_noticewrap"><img src="https://z3.ax1x.com/2021/08/25/hZZUjU.png" data-spm-anchor-id="a2ha1.14919748_WEBHOME_GRAY.0.i1"><div class="lastpagenotice_text" style="color:#6699FF;font-weight:bold;">我也是有底线哒~</div><div class="lastpagenotice_line"></div></div></div>
<!--底部可爱底线提示-->
1、网站管理后台—》主题设置—》文章&列表—》文章页 —》 文章页 在文章内容后-插入内容 ,把下面的 php 代码复制粘贴到里面即可。
2、此代码理论上适用所有主题,只需要在合适的地方添加上代码就行
3、代码中的图片可直接引用 也可以自己保存图片,部分的文字可修改成自己的
<center><span style="color: #ef0c7e;; font-size: 15px"><strong>------本页内容已结束,喜欢请分享------</strong></span></span><br /></center><h3 class="wp-block-zibllblock-biaoti title-theme"><strong>感谢您的来访,获取更多精彩文章请收藏本站。</strong></h3> <a href="https://www.wwru.cn" target="_blank" title="更多精彩文章,请关注“Mx博客”"> <img style="display: inline-block; width: 100%; max-width: 100%; height: auto;border-radius: 9px; -webkit-border-radius: 9px; -moz-border-radius: 9px;" src="https://mx142.github.io/img/bookmark/4.webp"> </a>
<center><span style="color: #ef0c7e;; font-size: 15px"><strong>------本页内容已结束,喜欢请分享------</strong></span></span><br /></center><h3 class="wp-block-zibllblock-biaoti title-theme"><strong>感谢您的来访,获取更多精彩文章请收藏本站。</strong></h3> <a href="https://www.wwru.cn" target="_blank" title="更多精彩文章,请关注“Mx博客”"> <img style="display: inline-block; width: 100%; max-width: 100%; height: auto;border-radius: 9px; -webkit-border-radius: 9px; -moz-border-radius: 9px;" src="https://mx142.github.io/img/bookmark/4.webp"> </a>
效果预览:
第二种效果
添加教程
- 在后台—》外观—》小工具—》首页-底部全宽度,自定义HTML添加下面代码即可
<div id="wiiuii" style="box-shadow: 0 0 10px var(--main-shadow);"> <section class="buy-container"> <div class="buy-box"> <div class="slogan"> <h3>Mx博客</h3> <p>欢迎光临寒舍!</p> </div> <ul class="actions"> <li> <a href="http://wpa.qq.com/msgrd?v=3&uin=你的QQ号&site=qq&menu=yes" target="_blank" class="buy-button primary" rel="noopener noreferrer">联系站长</a> </li> <li> <a href="填写你的链接" target="_blank" class="demo-button" rel="noopener noreferrer">友链通道</a> </li> </ul> </div> <span class="tips"><div id="go-fav">更多精彩文章,按<span>Ctrl</span>+<span>D</span>收藏本站!</div></span> </section> </div> <style type="text/css"> .buy-container{color: #ccc; padding: 60px 40px 50px 40px;margin: 0 auto; background: rgb(224,32,140); /*下述两行代码为兼容浏览器用,建议同步修改,亦可删除(不建议)*/background: -moz-linear-gradient(left, rgb(160,32,240) 0%, rgb(0,191,255) 100%);background: -webkit-linear-gradient(left, rgb(160,32,240) 0%,rgb(0,191,255) 100%); /*请更改此行代码,颜色为rgb模式*/background: linear-gradient(to right, rgb(160,32,240) 0%, rgb(0,191,255) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0208c', endColorstr='#fa6400',GradientType=1 );/*-webkit-border-radius: 8px;-moz-border-radius: 8px;-o-border-radius: 8px;border-radius: 8px;*/border-radius: var(--main-radius);}.buy-container .buy-box{display: -webkit-box; display: flex; -webkit-box-pack: justify; justify-content: space-between; -webkit-box-align: center; align-items: center; max-width: 900px; margin: 0 auto;}@media screen and (max-width: 700px){.buy-container .buy-box{display: block; text-align: center;}.buy-container .buy-box .slogan{margin-bottom: 30px;}}.buy-container .buy-box .slogan h3{color: #fff;font-size: 26px;margin: 0 0 10px 0;}@media screen and (max-width: 800px){.buy-container .buy-box .slogan h3{font-size: 24px;}}@media screen and (max-width: 500px){.buy-container .buy-box .slogan h3{font-size: 20px;}}@media screen and (max-width: 400px){.buy-container .buy-box .slogan h3{font-size: 18px;}}.buy-container .buy-box .slogan p{color: #fff;font-size: 14px;font-weight: bold;margin: 10px 0;}.buy-container .buy-box .actions{display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center;list-style-type: none;margin: 0;padding: 0;}@media screen and (max-width: 700px){.buy-container .buy-box .actions{-webkit-box-pack: justify; justify-content: center;}}.buy-container .buy-box .actions li{margin: 0;}.buy-container .buy-box .actions li:last-child{margin-left: 10px;}.buy-container .buy-box .actions li a{position: relative;color: #fff !important;font-size: 14px;font-weight: bold; line-height: 1;text-decoration: none;padding: 10px 20px;background-color: rgba(255, 255, 255, .1);-webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;-webkit-transition: .2s;-moz-transition: .2s;-o-transition: .2s;transition: .2s;}.buy-container .buy-box .actions li a:hover{-webkit-transform: translateY(-2px);-moz-transform: translateY(-2px);-o-transform: translateY(-2px);transform: translateY(-2px); -webkit-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); -moz-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); -o-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2);opacity: 1 !important;}@media screen and (max-width: 330px){.buy-container .buy-box .actions li a{font-size: 12px;}}.buy-container .buy-box .actions li a:not(.primary):before{content: "";position: absolute;top: 0;left: 0;width: 100%;height: 100%;-webkit-box-shadow: inset 0 0 0 1px currentColor;-moz-box-shadow: inset 0 0 0 1px currentColor;-o-box-shadow: inset 0 0 0 1px currentColor;box-shadow: inset 0 0 0 1px currentColor;-webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;-khtml-opacity: .3;-moz-opacity: .3;opacity: .3;}.buy-container .buy-box .actions li a:after{display: none;}.buy-container .buy-box .actions li a.primary{color: #ff3b30 !important;background-color: #fff;}.buy-container .tips{border-top: 1px solid rgba(255, 255, 255, .1);display: block;color: #fff;font-size: 12px;text-align: center; max-width: 900px;margin: 30px auto 0 auto;padding-top: 30px;}@media screen and (max-width: 768px){.buy-container {padding: 30px 40px 30px 40px;}}#go-fav{width:100%; height:100%; line-height:30px; text-align:center; font-size:14px; font-weight:700; color:rgba(255, 255, 255, 1);}#go-fav span{padding:5px 10px; background:#f0e7e2; border-radius:8px; color:#202020; margin:0 5px;} </style> <script> document.getElementById("wiiuii").parentNode.parentNode.style.padding=0; </script>
<div id="wiiuii" style="box-shadow: 0 0 10px var(--main-shadow);">
<section class="buy-container">
<div class="buy-box">
<div class="slogan">
<h3>Mx博客</h3>
<p>欢迎光临寒舍!</p>
</div>
<ul class="actions">
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=你的QQ号&site=qq&menu=yes" target="_blank" class="buy-button primary" rel="noopener noreferrer">联系站长</a>
</li>
<li>
<a href="填写你的链接" target="_blank" class="demo-button" rel="noopener noreferrer">友链通道</a>
</li>
</ul>
</div>
<span class="tips"><div id="go-fav">更多精彩文章,按<span>Ctrl</span>+<span>D</span>收藏本站!</div></span>
</section>
</div>
<style type="text/css">
.buy-container{color: #ccc; padding: 60px 40px 50px 40px;margin: 0 auto; background: rgb(224,32,140); /*下述两行代码为兼容浏览器用,建议同步修改,亦可删除(不建议)*/background: -moz-linear-gradient(left, rgb(160,32,240) 0%, rgb(0,191,255) 100%);background: -webkit-linear-gradient(left, rgb(160,32,240) 0%,rgb(0,191,255) 100%); /*请更改此行代码,颜色为rgb模式*/background: linear-gradient(to right, rgb(160,32,240) 0%, rgb(0,191,255) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0208c', endColorstr='#fa6400',GradientType=1 );/*-webkit-border-radius: 8px;-moz-border-radius: 8px;-o-border-radius: 8px;border-radius: 8px;*/border-radius: var(--main-radius);}.buy-container .buy-box{display: -webkit-box; display: flex; -webkit-box-pack: justify; justify-content: space-between; -webkit-box-align: center; align-items: center; max-width: 900px; margin: 0 auto;}@media screen and (max-width: 700px){.buy-container .buy-box{display: block; text-align: center;}.buy-container .buy-box .slogan{margin-bottom: 30px;}}.buy-container .buy-box .slogan h3{color: #fff;font-size: 26px;margin: 0 0 10px 0;}@media screen and (max-width: 800px){.buy-container .buy-box .slogan h3{font-size: 24px;}}@media screen and (max-width: 500px){.buy-container .buy-box .slogan h3{font-size: 20px;}}@media screen and (max-width: 400px){.buy-container .buy-box .slogan h3{font-size: 18px;}}.buy-container .buy-box .slogan p{color: #fff;font-size: 14px;font-weight: bold;margin: 10px 0;}.buy-container .buy-box .actions{display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center;list-style-type: none;margin: 0;padding: 0;}@media screen and (max-width: 700px){.buy-container .buy-box .actions{-webkit-box-pack: justify; justify-content: center;}}.buy-container .buy-box .actions li{margin: 0;}.buy-container .buy-box .actions li:last-child{margin-left: 10px;}.buy-container .buy-box .actions li a{position: relative;color: #fff !important;font-size: 14px;font-weight: bold; line-height: 1;text-decoration: none;padding: 10px 20px;background-color: rgba(255, 255, 255, .1);-webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;-webkit-transition: .2s;-moz-transition: .2s;-o-transition: .2s;transition: .2s;}.buy-container .buy-box .actions li a:hover{-webkit-transform: translateY(-2px);-moz-transform: translateY(-2px);-o-transform: translateY(-2px);transform: translateY(-2px); -webkit-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); -moz-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); -o-box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2); box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2);opacity: 1 !important;}@media screen and (max-width: 330px){.buy-container .buy-box .actions li a{font-size: 12px;}}.buy-container .buy-box .actions li a:not(.primary):before{content: "";position: absolute;top: 0;left: 0;width: 100%;height: 100%;-webkit-box-shadow: inset 0 0 0 1px currentColor;-moz-box-shadow: inset 0 0 0 1px currentColor;-o-box-shadow: inset 0 0 0 1px currentColor;box-shadow: inset 0 0 0 1px currentColor;-webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;-khtml-opacity: .3;-moz-opacity: .3;opacity: .3;}.buy-container .buy-box .actions li a:after{display: none;}.buy-container .buy-box .actions li a.primary{color: #ff3b30 !important;background-color: #fff;}.buy-container .tips{border-top: 1px solid rgba(255, 255, 255, .1);display: block;color: #fff;font-size: 12px;text-align: center; max-width: 900px;margin: 30px auto 0 auto;padding-top: 30px;}@media screen and (max-width: 768px){.buy-container {padding: 30px 40px 30px 40px;}}#go-fav{width:100%; height:100%; line-height:30px; text-align:center; font-size:14px; font-weight:700; color:rgba(255, 255, 255, 1);}#go-fav span{padding:5px 10px; background:#f0e7e2; border-radius:8px; color:#202020; margin:0 5px;}
</style>
<script>
document.getElementById("wiiuii").parentNode.parentNode.style.padding=0;
</script>
1、很多时候网页背景也是白的,图片整体也是白色的,有的时候用户不好区分,这是图片还是网页,图片弄个外边框就好区分了,当然图片是鼠标移动到图片上才会显示边框
2、 网站管理后台—》子比主题设置—》自定义代码—》自定 CSS 代码,把下面的 css 代码复制粘贴到里面即可。
里面的 8px 大小可自行调节,颜色代码#63B8FF 也可自行设置
代码如下
/*鼠标移动图片外发光*/ .wp-posts-content img:hover { box-shadow:0px 0px 8px #63B8FF; }
/*鼠标移动图片外发光*/
.wp-posts-content img:hover {
box-shadow:0px 0px 8px #63B8FF;
}
代码如下:
1.H6标题css:
.article-content h6:before{border-bottom:2px solid #4dd0e1;width:100%;content:"";display:block;height:28px;position:absolute;left:0;top:0;bottom:-2px;margin:auto;background-size:28px 28px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABRklEQVRYR2NkGGDAOMD2M4w6YDQERkNg+ITAppcfY/8zMv3wF+NdTUrZQpUQ2PT6cz8Dw/8CkMWMDIwNvqK8jcQ6gmIHNN19EaXPx1XPyMCghrCUKcpPlGc5MY6gyAE+Fx52MjL8j3cU5a1UYWXtZGBkEAVb+p8hxU+Mby5NHQCxnKEMaskzJ37uFmUetkmMjAzrfUX4woixHBJlZAA0y2EmPPYU4enLkhGeQIqRJDsAh+UgO7duNpD3IcVykkOA2paT5ABaWE60A2hlOdEO8D3/4CMDIyMfWvySFefoaYSoROh74eFXBgYGLiTNVLGc+BC48PAnAwMDG9QBVLOcaAd8P5ox+x/jf5AjGLgYfnwnKqv9/8/PwPO/kFF/MSj0cAKiouD/0bgYoixFU8RovWgJIX1EOYCQIZTIjzpgNARGQ2DAQwAAvHBaIdB7zxsAAAAASUVORK5CYII=);background-repeat:no-repeat;animation:h6AnimationBefore 2s infinite alternate}.article-content h6{margin:25px 0;font-size:16px;position:relative;padding:4px 25px;width:max-content;color:#4dd0e1}.article-content h6:after{content:"";display:block;width:28px;height:28px;position:absolute;border:2px solid #4dd0e1;border-radius:50%;right:-15px;top:0;bottom:0;margin:auto;background-size:28px 28px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABRklEQVRYR2NkGGDAOMD2M4w6YDQERkNg+ITAppcfY/8zMv3wF+NdTUrZQpUQ2PT6cz8Dw/8CkMWMDIwNvqK8jcQ6gmIHNN19EaXPx1XPyMCghrCUKcpPlGc5MY6gyAE+Fx52MjL8j3cU5a1UYWXtZGBkEAVb+p8hxU+Mby5NHQCxnKEMaskzJ37uFmUetkmMjAzrfUX4woixHBJlZAA0y2EmPPYU4enLkhGeQIqRJDsAh+UgO7duNpD3IcVykkOA2paT5ABaWE60A2hlOdEO8D3/4CMDIyMfWvySFefoaYSoROh74eFXBgYGLiTNVLGc+BC48PAnAwMDG9QBVLOcaAd8P5ox+x/jf5AjGLgYfnwnKqv9/8/PwPO/kFF/MSj0cAKiouD/0bgYoixFU8RovWgJIX1EOYCQIZTIjzpgNARGQ2DAQwAAvHBaIdB7zxsAAAAASUVORK5CYII=);animation:h6AnimationAfter 2s infinite alternate}animation:h6AnimationAfter 2s infinite alternate}h6{display:block;font-size:1.17em;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0px;margin-inline-end:0px;font-weight:bold} @keyframes h6AnimationBefore{0%{width:28px}25%{width:100%}50%{width:100%}to{width:100%}}@keyframes h6AnimationAfter{0%{transform:rotate(0)}10%{transform:rotate(0)}50%{transform:rotate(-1turn)}to{transform:rotate(-1turn)}}
.article-content h6:before{border-bottom:2px solid #4dd0e1;width:100%;content:"";display:block;height:28px;position:absolute;left:0;top:0;bottom:-2px;margin:auto;background-size:28px 28px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABRklEQVRYR2NkGGDAOMD2M4w6YDQERkNg+ITAppcfY/8zMv3wF+NdTUrZQpUQ2PT6cz8Dw/8CkMWMDIwNvqK8jcQ6gmIHNN19EaXPx1XPyMCghrCUKcpPlGc5MY6gyAE+Fx52MjL8j3cU5a1UYWXtZGBkEAVb+p8hxU+Mby5NHQCxnKEMaskzJ37uFmUetkmMjAzrfUX4woixHBJlZAA0y2EmPPYU4enLkhGeQIqRJDsAh+UgO7duNpD3IcVykkOA2paT5ABaWE60A2hlOdEO8D3/4CMDIyMfWvySFefoaYSoROh74eFXBgYGLiTNVLGc+BC48PAnAwMDG9QBVLOcaAd8P5ox+x/jf5AjGLgYfnwnKqv9/8/PwPO/kFF/MSj0cAKiouD/0bgYoixFU8RovWgJIX1EOYCQIZTIjzpgNARGQ2DAQwAAvHBaIdB7zxsAAAAASUVORK5CYII=);background-repeat:no-repeat;animation:h6AnimationBefore 2s infinite alternate}.article-content h6{margin:25px 0;font-size:16px;position:relative;padding:4px 25px;width:max-content;color:#4dd0e1}.article-content h6:after{content:"";display:block;width:28px;height:28px;position:absolute;border:2px solid #4dd0e1;border-radius:50%;right:-15px;top:0;bottom:0;margin:auto;background-size:28px 28px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABRklEQVRYR2NkGGDAOMD2M4w6YDQERkNg+ITAppcfY/8zMv3wF+NdTUrZQpUQ2PT6cz8Dw/8CkMWMDIwNvqK8jcQ6gmIHNN19EaXPx1XPyMCghrCUKcpPlGc5MY6gyAE+Fx52MjL8j3cU5a1UYWXtZGBkEAVb+p8hxU+Mby5NHQCxnKEMaskzJ37uFmUetkmMjAzrfUX4woixHBJlZAA0y2EmPPYU4enLkhGeQIqRJDsAh+UgO7duNpD3IcVykkOA2paT5ABaWE60A2hlOdEO8D3/4CMDIyMfWvySFefoaYSoROh74eFXBgYGLiTNVLGc+BC48PAnAwMDG9QBVLOcaAd8P5ox+x/jf5AjGLgYfnwnKqv9/8/PwPO/kFF/MSj0cAKiouD/0bgYoixFU8RovWgJIX1EOYCQIZTIjzpgNARGQ2DAQwAAvHBaIdB7zxsAAAAASUVORK5CYII=);animation:h6AnimationAfter 2s infinite alternate}animation:h6AnimationAfter 2s infinite alternate}h6{display:block;font-size:1.17em;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0px;margin-inline-end:0px;font-weight:bold}
@keyframes h6AnimationBefore{0%{width:28px}25%{width:100%}50%{width:100%}to{width:100%}}@keyframes h6AnimationAfter{0%{transform:rotate(0)}10%{transform:rotate(0)}50%{transform:rotate(-1turn)}to{transform:rotate(-1turn)}}
2.彩虹文字特效:css
* 彩虹文字特效 */ .wzw_chwz{background-image:-webkit-linear-gradient(30deg,#32c5ff 25%,#b620e0 50%,#f7b500 75%,#20e050 100%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;-webkit-background-size:200% 100%;-webkit-animation:maskedAnimation 4s infinite linear;font-size:16px}@keyframes maskedAnimation{0%{background-position:0 0}100%{background-position:-100% 0}}
* 彩虹文字特效 */
.wzw_chwz{background-image:-webkit-linear-gradient(30deg,#32c5ff 25%,#b620e0 50%,#f7b500 75%,#20e050 100%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;-webkit-background-size:200% 100%;-webkit-animation:maskedAnimation 4s infinite linear;font-size:16px}@keyframes maskedAnimation{0%{background-position:0 0}100%{background-position:-100% 0}}
为了方便使用 我们把它加入后台按钮
找到主题functions.php加入下面代码:
/*文本编辑器添加彩虹文字按钮*/ add_action('after_wp_tiny_mce', 'bolo_after_wp_tiny_mce'); function bolo_after_wp_tiny_mce($mce_settings) { ?> <script type="text/javascript"> QTags.addButton( 'z_chwz', '彩虹文字', '<div class="wzw_chwz">彩虹文字</div>', "" ); function bolo_QTnextpage_arg1() { } </script> <?php }
/*文本编辑器添加彩虹文字按钮*/
add_action('after_wp_tiny_mce', 'bolo_after_wp_tiny_mce');
function bolo_after_wp_tiny_mce($mce_settings) {
?>
<script type="text/javascript">
QTags.addButton( 'z_chwz', '彩虹文字', '<div class="wzw_chwz">彩虹文字</div>', "" );
function bolo_QTnextpage_arg1() {
}
</script>
<?php
}
添加完成 在文本编辑器中看到
其实很简单,就一段代码!只需在后台—>外观—>小工具—>自定义 HTML添加下面的代码,把它放在合适的位置
1、简洁版
<section id="custom_html-2" class="widget_text widget widget_custom_html mar16-b"> <meta charset="utf-8"> <!--<p align="center" class="widget-title l1 box-header">欢迎访问本站</p>--> <div class="textwidget custom-html-widget"> <aside id="php_text-8" class="widget php_text wow fadeInUp" data-wow-delay="0.3s"> <div class="textwidget widget-text"> <style type="text/css">#container-box-1{color:#526372;text-transform:uppercase;width:100%;font-size:16px; line-height:50px;text-align:center}#flip-box-1{overflow:hidden;height:50px}#flip-box-1 div{height:50px}#flip-box-1>div>div{color:#fff;display:inline-block;text-align:center;height:50px;width:100%}#flip-box-1 div:first-child{animation:show 8s linear infinite}.flip-box-1-1{background-color:#FF7E40}.flip-box-1-2{background-color:#C166FF}.flip-box-1-3{background-color:#737373}.flip-box-1-4{background-color:#4ec7f3} .flip-box-1-5{background-color:#42c58a}.flip-box-1-6{background-color:#F1617D}@keyframes show{0%{margin-top:-300px}5%{margin-top:-250px}16.666%{margin-top:-250px}21.666%{margin-top:-200px}33.332%{margin-top:-200px}38.332%{margin-top:-150px}49.998%{margin-top:-150px}54.998%{margin-top:-100px}66.664%{margin-top:-100px}71.664%{margin-top:-50px}83.33%{margin-top:-50px}88.33%{margin-top:0px}99.996%{margin-top:0px}100%{margin-top:300px}}</style><div id="container-box-1"> <div class="container-box-1-1">坚持每天来逛逛,会让你</div> <div id="flip-box-1"><div><div class="flip-box-1-1">生活也美好了!</div> </div><div><div class="flip-box-1-2">心情也舒畅了!</div></div> <div><div class="flip-box-1-3">走路也有劲了!</div></div><div> <div class="flip-box-1-4">腿也不痛了!</div></div> <div><div class="flip-box-1-5">腰也不酸了!</div></div> <div><div class="flip-box-1-6">工作也轻松了!</div></div> </div><div class="container-box-1-2">你好我也好,不要忘记哦!</div></div></div> <div class="clear"></div> </aside></div> </section>
<section id="custom_html-2" class="widget_text widget widget_custom_html mar16-b">
<meta charset="utf-8">
<!--<p align="center" class="widget-title l1 box-header">欢迎访问本站</p>-->
<div class="textwidget custom-html-widget">
<aside id="php_text-8"
class="widget php_text wow fadeInUp" data-wow-delay="0.3s">
<div class="textwidget widget-text">
<style type="text/css">#container-box-1{color:#526372;text-transform:uppercase;width:100%;font-size:16px;
line-height:50px;text-align:center}#flip-box-1{overflow:hidden;height:50px}#flip-box-1 div{height:50px}#flip-box-1>div>div{color:#fff;display:inline-block;text-align:center;height:50px;width:100%}#flip-box-1
div:first-child{animation:show 8s linear infinite}.flip-box-1-1{background-color:#FF7E40}.flip-box-1-2{background-color:#C166FF}.flip-box-1-3{background-color:#737373}.flip-box-1-4{background-color:#4ec7f3}
.flip-box-1-5{background-color:#42c58a}.flip-box-1-6{background-color:#F1617D}@keyframes
show{0%{margin-top:-300px}5%{margin-top:-250px}16.666%{margin-top:-250px}21.666%{margin-top:-200px}33.332%{margin-top:-200px}38.332%{margin-top:-150px}49.998%{margin-top:-150px}54.998%{margin-top:-100px}66.664%{margin-top:-100px}71.664%{margin-top:-50px}83.33%{margin-top:-50px}88.33%{margin-top:0px}99.996%{margin-top:0px}100%{margin-top:300px}}</style><div id="container-box-1">
<div class="container-box-1-1">坚持每天来逛逛,会让你</div>
<div id="flip-box-1"><div><div class="flip-box-1-1">生活也美好了!</div>
</div><div><div class="flip-box-1-2">心情也舒畅了!</div></div>
<div><div class="flip-box-1-3">走路也有劲了!</div></div><div>
<div class="flip-box-1-4">腿也不痛了!</div></div>
<div><div class="flip-box-1-5">腰也不酸了!</div></div>
<div><div class="flip-box-1-6">工作也轻松了!</div></div>
</div><div class="container-box-1-2">你好我也好,不要忘记哦!</div></div></div>
<div class="clear"></div>
</aside></div>
</section>
注:由于 4 个图标都采用图标阿里巴巴矢量图库,在贵站是无法显示的,所以我已进行删除。若需要请自行在合适的位置添加图标。
效果展示
2、美化版
<section id="custom_html-2" class="widget_text widget widget_custom_html mar16-b"> <meta charset="utf-8"> <!--<p align="center" class="widget-title l1 box-header">欢迎访问本站</p>--> <div class="textwidget custom-html-widget"> <aside id="php_text-8" class="widget php_text wow fadeInUp" data-wow-delay="0.3s"> <div class="textwidget widget-text"> <style type="text/css"> #container-box-1{color:#526372;text-transform:uppercase;width:100%;font-size:16px;line-height:50px;text-align:center;padding: 10px;background: linear-gradient(45deg, #C7F5FE 10%, #C7F5FE 40%, #FCC8F8 40%, #FCC8F8 60%, #EAB4F8 60%, #EAB4F8 65%, #F3F798 65%, #F3F798 90%);border-radius: var(--main-radius);} #flip-box-1{overflow:hidden;height:50px;border-radius:99px} #flip-box-1 div{height:50px} #flip-box-1>div>div{color:#fff;display:inline-block;text-align:center;height:50px;width:100%} #flip-box-1 div:first-child{animation:show 8s linear infinite} .flip-box-1-1{background-image:linear-gradient(to right,#fa709a 0,#fee140 100%)} .flip-box-1-2{background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);} .flip-box-1-3{background-image: linear-gradient(to right, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%);} .flip-box-1-4{background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%);} .flip-box-1-5{background-image: linear-gradient(to right, #74ebd5 0%, #9face6 100%);} .flip-box-1-6{background-image: linear-gradient(to top, #9795f0 0%, #fbc8d4 100%);} @keyframes show{0%{margin-top:-300px} 5%{margin-top:-250px} 16.666%{margin-top:-250px} 21.666%{margin-top:-200px} 33.332%{margin-top:-200px} 38.332%{margin-top:-150px} 49.998%{margin-top:-150px} 54.998%{margin-top:-100px} 66.664%{margin-top:-100px} 71.664%{margin-top:-50px} 83.33%{margin-top:-50px} 88.33%{margin-top:0} 99.996%{margin-top:0} 100%{margin-top:300px} } </style> <div id="container-box-1"> <div class="container-box-1-1"><svg class="icon" aria-hidden="true"><use xlink:href="#iconxiangwenbiaoqing"></use></svg> 坚持每天来逛逛,会让你 <svg class="icon" aria-hidden="true"><use xlink:href="#iconpaomeiyanbiaoqing"></use></svg></div> <div id="flip-box-1"><div><div class="flip-box-1-1">生活也美好了!</div> </div><div><div class="flip-box-1-2">心情也舒畅了!</div></div> <div><div class="flip-box-1-3">走路也有劲了!</div></div><div> <div class="flip-box-1-4">腿也不痛了!</div></div> <div><div class="flip-box-1-5">腰也不酸了!</div></div> <div><div class="flip-box-1-6">工作也轻松了!</div></div> </div><div class="container-box-1-2"><svg class="icon" aria-hidden="true"><use xlink:href="#iconkaixinbiaoqing"></use></svg> 你好我也好,不要忘记哦! <svg class="icon" aria-hidden="true"><use xlink:href="#icondaxiaobiaoqing"></use></svg></div></div></div> <div class="clear"></div> </aside></div> </section>
<section id="custom_html-2" class="widget_text widget widget_custom_html mar16-b">
<meta charset="utf-8">
<!--<p align="center" class="widget-title l1 box-header">欢迎访问本站</p>-->
<div class="textwidget custom-html-widget">
<aside id="php_text-8"
class="widget php_text wow fadeInUp" data-wow-delay="0.3s">
<div class="textwidget widget-text">
<style type="text/css">
#container-box-1{color:#526372;text-transform:uppercase;width:100%;font-size:16px;line-height:50px;text-align:center;padding: 10px;background: linear-gradient(45deg, #C7F5FE 10%, #C7F5FE 40%, #FCC8F8 40%, #FCC8F8 60%, #EAB4F8 60%, #EAB4F8 65%, #F3F798 65%, #F3F798 90%);border-radius: var(--main-radius);}
#flip-box-1{overflow:hidden;height:50px;border-radius:99px}
#flip-box-1 div{height:50px}
#flip-box-1>div>div{color:#fff;display:inline-block;text-align:center;height:50px;width:100%}
#flip-box-1 div:first-child{animation:show 8s linear infinite}
.flip-box-1-1{background-image:linear-gradient(to right,#fa709a 0,#fee140 100%)}
.flip-box-1-2{background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);}
.flip-box-1-3{background-image: linear-gradient(to right, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%);}
.flip-box-1-4{background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%);}
.flip-box-1-5{background-image: linear-gradient(to right, #74ebd5 0%, #9face6 100%);}
.flip-box-1-6{background-image: linear-gradient(to top, #9795f0 0%, #fbc8d4 100%);}
@keyframes show{0%{margin-top:-300px}
5%{margin-top:-250px}
16.666%{margin-top:-250px}
21.666%{margin-top:-200px}
33.332%{margin-top:-200px}
38.332%{margin-top:-150px}
49.998%{margin-top:-150px}
54.998%{margin-top:-100px}
66.664%{margin-top:-100px}
71.664%{margin-top:-50px}
83.33%{margin-top:-50px}
88.33%{margin-top:0}
99.996%{margin-top:0}
100%{margin-top:300px}
}
</style>
<div id="container-box-1">
<div class="container-box-1-1"><svg class="icon" aria-hidden="true"><use xlink:href="#iconxiangwenbiaoqing"></use></svg> 坚持每天来逛逛,会让你 <svg class="icon" aria-hidden="true"><use xlink:href="#iconpaomeiyanbiaoqing"></use></svg></div>
<div id="flip-box-1"><div><div class="flip-box-1-1">生活也美好了!</div>
</div><div><div class="flip-box-1-2">心情也舒畅了!</div></div>
<div><div class="flip-box-1-3">走路也有劲了!</div></div><div>
<div class="flip-box-1-4">腿也不痛了!</div></div>
<div><div class="flip-box-1-5">腰也不酸了!</div></div>
<div><div class="flip-box-1-6">工作也轻松了!</div></div>
</div><div class="container-box-1-2"><svg class="icon" aria-hidden="true"><use xlink:href="#iconkaixinbiaoqing"></use></svg> 你好我也好,不要忘记哦! <svg class="icon" aria-hidden="true"><use xlink:href="#icondaxiaobiaoqing"></use></svg></div></div></div>
<div class="clear"></div>
</aside></div>
</section>
效果展示
使用方法
- 1、在 zibll 主题目录下,themes/zibll/footer.php文件中的顶部添加下面添加下面的代码:
<!---网站数据库查询&页面加载耗时功能---> <center> <p> 本次数据库查询:<?php echo get_num_queries(); ?>次 页面加载耗时<?php timer_stop(3); ?> 秒</p> </center> <!---网站数据库查询&页面加载耗时功能--->
<!---网站数据库查询&页面加载耗时功能--->
<center>
<p> 本次数据库查询:<?php echo get_num_queries(); ?>次 页面加载耗时<?php timer_stop(3); ?> 秒</p>
</center>
<!---网站数据库查询&页面加载耗时功能--->
效果预览
使用教程
- 1.子比主题设置—>自定义代码—>自定义 CSS 样式:,添加以下 CSS 代码:
- 2.在代码 28 行 background: url()括号内填写你需要显示的图片链接
/*悬浮按钮美化开始*/ span.float-btn.more-btn.hover-show.nowave { margin-top: 0px } .float-right.round.position-bottom { background: #fff; border-radius: var(--main-radius); transition: 0s; right: 1px; bottom: 170px; border-radius: 20px 0 0 20px; box-shadow: -5px 3px 10px 0px rgb(5 5 5 / 15%) } .float-right.round .float-btn { border-radius: 8px 0px 0px 17px } .float-right .float-btn { background: #fff } .float-right.round.position-bottom::before { content: ''; width: 30px; height: 60px; background: url(填写你显示的图片链接); background-size: cover; display: block; margin: 5px 3px 0 7px; } .dark-theme .float-right.round.position-bottom { background: #414141; border: 1px solid #4a4a4a; transition: 0s } .dark-theme .float-right .float-btn { background: #414141 } .dark-theme .float-right.round.position-bottom a:hover { background: #505255; --this-color: var(--muted-2-color) } .dark-theme .float-right.round.position-bottom span:hover { background: #505255; --this-color: var(--muted-2-color) } span.newadd-btns.hover-show.float-btn.add-btn .hover-show-con.dropdown-menu.drop-newadd>a:hover { background-color: #d8d8d836; border-radius: 8px } a.float-btn.ontop.fade { display: none } /*悬浮按钮美化结束*/
/*悬浮按钮美化开始*/
span.float-btn.more-btn.hover-show.nowave {
margin-top: 0px
}
.float-right.round.position-bottom {
background: #fff;
border-radius: var(–main-radius);
transition: 0s;
right: 1px;
bottom: 170px;
border-radius: 20px 0 0 20px;
box-shadow: -5px 3px 10px 0px rgb(5 5 5 / 15%)
}
.float-right.round .float-btn {
border-radius: 8px 0px 0px 17px
}
.float-right .float-btn {
background: #fff
}
.float-right.round.position-bottom::before {
content: ”;
width: 30px;
height: 60px;
background: url(填写你显示的图片链接);
background-size: cover;
display: block;
margin: 5px 3px 0 7px;
}
.dark-theme .float-right.round.position-bottom {
background: #414141;
border: 1px solid #4a4a4a;
transition: 0s
}
.dark-theme .float-right .float-btn {
background: #414141
}
.dark-theme .float-right.round.position-bottom a:hover {
background: #505255;
–this-color: var(–muted-2-color)
}
.dark-theme .float-right.round.position-bottom span:hover {
background: #505255;
–this-color: var(–muted-2-color)
}
span.newadd-btns.hover-show.float-btn.add-btn .hover-show-con.dropdown-menu.drop-newadd>a:hover {
background-color: #d8d8d836;
border-radius: 8px
}
a.float-btn.ontop.fade {
display: none
}
/*悬浮按钮美化结束*/
效果预览
- 这个是两个小功能,鼠标移动到文章头图时会有动态效果以及首页文章列表鼠标移动悬停上浮效果
1.子比主题设置—>自定义代码—>自定义 CSS 样式:,添加以下 CSS 代码:
/*首页文章特色图片鼠标悬停效果开始*/ .item-thumbnail:before {content: '';position: absolute;top: 0;left: 0;right: 0;bottom: 0;background: rgba(0,0,0,0);transition: background .35s;border-radius: 8px;z-index: 2;max-width: 765px;margin: 0 auto;pointer-events:none;} .item-thumbnail:after {content: '';position: absolute;top: 50%;left: 50%;width: 50px;height: 50px;margin: -25px 0 0 -25px;background:url(https://files.imgdb.cn/static/images/11/bf/62e2205af54cd3f9378511bf.png);background-repeat: no-repeat;background-size: 100% 100%;z-index: 3;-webkit-transform: scale(2);transform: scale(2);transition: opacity .35s,-webkit-transform .35s;transition: transform .35s,opacity .35s;transition: transform .35s,opacity .35s,-webkit-transform .35s;opacity: 0;pointer-events:none;} .item-thumbnail:hover:before{background:rgba(0,0,0,.5)} .item-thumbnail:hover:after{-webkit-transform:scale(1);transform:scale(1);opacity:1} /*首页文章特色图片鼠标悬停效果结束*/
/*首页文章特色图片鼠标悬停效果开始*/
.item-thumbnail:before {content: '';position: absolute;top: 0;left: 0;right: 0;bottom: 0;background: rgba(0,0,0,0);transition: background .35s;border-radius: 8px;z-index: 2;max-width: 765px;margin: 0 auto;pointer-events:none;}
.item-thumbnail:after {content: '';position: absolute;top: 50%;left: 50%;width: 50px;height: 50px;margin: -25px 0 0 -25px;background:url(https://files.imgdb.cn/static/images/11/bf/62e2205af54cd3f9378511bf.png);background-repeat: no-repeat;background-size: 100% 100%;z-index: 3;-webkit-transform: scale(2);transform: scale(2);transition: opacity .35s,-webkit-transform .35s;transition: transform .35s,opacity .35s;transition: transform .35s,opacity .35s,-webkit-transform .35s;opacity: 0;pointer-events:none;}
.item-thumbnail:hover:before{background:rgba(0,0,0,.5)}
.item-thumbnail:hover:after{-webkit-transform:scale(1);transform:scale(1);opacity:1}
/*首页文章特色图片鼠标悬停效果结束*/
/*首页文章列表鼠标悬停上浮效果开始*/ .tab-content .posts-item:not(article):hover{opacity: 1;z-index: 99;border-radius: 20px;transform: translateY(-5px);box-shadow: 0 5px 10px rgba(0, 0, 0, .15);animation: index-link-active 1s cubic-bezier(0.315, 0.605, 0.375, 0.925) forwards;} @keyframes index-link-active { 0%{transform: perspective(2000px) rotateX(0) rotateY(0) translateZ(0);} 16%{transform: perspective(2000px) rotateX(10deg) rotateY(5deg) translateZ(32px);} 100%{transform: perspective(2000px) rotateX(0) rotateY(0) translateZ(65px);} } /*首页文章列表鼠标悬停上浮效果结束*/
/*首页文章列表鼠标悬停上浮效果开始*/
.tab-content .posts-item:not(article):hover{opacity: 1;z-index: 99;border-radius: 20px;transform: translateY(-5px);box-shadow: 0 5px 10px rgba(0, 0, 0, .15);animation: index-link-active 1s cubic-bezier(0.315, 0.605, 0.375, 0.925) forwards;}
@keyframes index-link-active {
0%{transform: perspective(2000px) rotateX(0) rotateY(0) translateZ(0);}
16%{transform: perspective(2000px) rotateX(10deg) rotateY(5deg) translateZ(32px);}
100%{transform: perspective(2000px) rotateX(0) rotateY(0) translateZ(65px);}
}
/*首页文章列表鼠标悬停上浮效果结束*/
- 这个功能其实很多朋友应该都有之前的那种樱花效果,但是用过的都知道那个樱花效果太妨碍阅读了,分享给大家一个优化版,减少了数量以及效果优化
安装
- 将下面的这段代码整合到新建 js 文件,命名 leaves.js,然后引用,就可以看到效果了,我就不上预览图了
- 默认效果是枫叶,如果想改成其他的可自行更换代码第三行中的文件图片矢量图,
<script src="你上传的文件路径地址/leaves.js"></script>
<script src="你上传的文件路径地址/leaves.js"></script>
var stop, staticx; var img = new Image(); img.src = "https://mx142.github.io/img/mapleleaf/mapleleaf.webp"; function Sakura(x, y, s, r, fn) { this.x = x; this.y = y; this.s = s; this.r = r; this.fn = fn } Sakura.prototype.draw = function(cxt) { cxt.save(); var xc = 20 * this.s / 2; cxt.translate(this.x, this.y); cxt.rotate(this.r); cxt.drawImage(img, 0, 0, 20 * this.s, 20 * this.s); cxt.restore() }; Sakura.prototype.update = function() { this.x = this.fn.x(this.x, this.y); this.y = this.fn.y(this.y, this.y); this.r = this.fn.r(this.r); if (this.x > window.innerWidth || this.x < 0 || this.y > window.innerHeight || this.y < 0) { this.r = getRandom("fnr"); if (Math.random() > 0.4) { this.x = getRandom("x"); this.y = 0; this.s = getRandom("s"); this.r = getRandom("r") } else { this.x = window.innerWidth; this.y = getRandom("y"); this.s = getRandom("s"); this.r = getRandom("r") } } }; SakuraList = function() { this.list = [] }; SakuraList.prototype.push = function(sakura) { this.list.push(sakura) }; SakuraList.prototype.update = function() { for (var i = 0, len = this.list.length; i < len; i++) { this.list[i].update() } }; SakuraList.prototype.draw = function(cxt) { for (var i = 0, len = this.list.length; i < len; i++) { this.list[i].draw(cxt) } }; SakuraList.prototype.get = function(i) { return this.list[i] }; SakuraList.prototype.size = function() { return this.list.length }; function getRandom(option) { var ret, random; switch (option) { case "x": ret = Math.random() * window.innerWidth; break; case "y": ret = Math.random() * window.innerHeight; break; case "s": ret = Math.random(); break; case "r": ret = Math.random() * 4; break; case "fnx": random = -0.5 + Math.random() * 1; ret = function(x, y) { return x + 0.5 * random - 1.7 }; break; case "fny": random = 1.5 + Math.random() * 0.7; ret = function(x, y) { return y + random }; break; case "fnr": random = Math.random() * 0.03; ret = function(r) { return r + random }; break } return ret } function startSakura() { requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame; var canvas = document.createElement("canvas"), cxt; staticx = true; canvas.height = window.innerHeight; canvas.width = window.innerWidth; canvas.setAttribute("style", "position: fixed;left: 0;top: 0;pointer-events: none;"); canvas.setAttribute("id", "canvas_sakura"); document.getElementsByTagName("body")[0].appendChild(canvas); cxt = canvas.getContext("2d"); var sakuraList = new SakuraList(); for (var i = 0; i < 50; i++) { var sakura, randomX, randomY, randomS, randomR, randomFnx, randomFny; randomX = getRandom("x"); randomY = getRandom("y"); randomR = getRandom("r"); randomS = getRandom("s"); randomFnx = getRandom("fnx"); randomFny = getRandom("fny"); randomFnR = getRandom("fnr"); sakura = new Sakura(randomX, randomY, randomS, randomR, { x: randomFnx, y: randomFny, r: randomFnR }); sakura.draw(cxt); sakuraList.push(sakura) } stop = requestAnimationFrame(function() { cxt.clearRect(0, 0, canvas.width, canvas.height); sakuraList.update(); sakuraList.draw(cxt); stop = requestAnimationFrame(arguments.callee) }) } window.onresize = function() { var canvasSnow = document.getElementById("canvas_snow") }; img.onload = function() { startSakura() }; function stopp() { if (staticx) { var child = document.getElementById("canvas_sakura"); child.parentNode.removeChild(child); window.cancelAnimationFrame(stop); staticx = false } else { startSakura() } };
var stop, staticx;
var img = new Image();
img.src = "https://mx142.github.io/img/mapleleaf/mapleleaf.webp";
function Sakura(x, y, s, r, fn) {
this.x = x;
this.y = y;
this.s = s;
this.r = r;
this.fn = fn
}
Sakura.prototype.draw = function(cxt) {
cxt.save();
var xc = 20 * this.s / 2;
cxt.translate(this.x, this.y);
cxt.rotate(this.r);
cxt.drawImage(img, 0, 0, 20 * this.s, 20 * this.s);
cxt.restore()
};
Sakura.prototype.update = function() {
this.x = this.fn.x(this.x, this.y);
this.y = this.fn.y(this.y, this.y);
this.r = this.fn.r(this.r);
if (this.x > window.innerWidth || this.x < 0 || this.y > window.innerHeight || this.y < 0) {
this.r = getRandom(“fnr”);
if (Math.random() > 0.4) {
this.x = getRandom(“x”);
this.y = 0;
this.s = getRandom(“s”);
this.r = getRandom(“r”)
} else {
this.x = window.innerWidth;
this.y = getRandom(“y”);
this.s = getRandom(“s”);
this.r = getRandom(“r”)
}
}
};
SakuraList = function() {
this.list = []
};
SakuraList.prototype.push = function(sakura) {
this.list.push(sakura)
};
SakuraList.prototype.update = function() {
for (var i = 0, len = this.list.length; i < len; i++) {
this.list[i].update()
}
};
SakuraList.prototype.draw = function(cxt) {
for (var i = 0, len = this.list.length; i < len; i++) {
this.list[i].draw(cxt)
}
};
SakuraList.prototype.get = function(i) {
return this.list[i]
};
SakuraList.prototype.size = function() {
return this.list.length
};
function getRandom(option) {
var ret, random;
switch (option) {
case “x”:
ret = Math.random() * window.innerWidth;
break;
case “y”:
ret = Math.random() * window.innerHeight;
break;
case “s”:
ret = Math.random();
break;
case “r”:
ret = Math.random() * 4;
break;
case “fnx”:
random = -0.5 + Math.random() * 1;
ret = function(x, y) {
return x + 0.5 * random – 1.7
};
break;
case “fny”:
random = 1.5 + Math.random() * 0.7;
ret = function(x, y) {
return y + random
};
break;
case “fnr”:
random = Math.random() * 0.03;
ret = function(r) {
return r + random
};
break
}
return ret
}
function startSakura() {
requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame;
var canvas = document.createElement(“canvas”),
cxt;
staticx = true;
canvas.height = window.innerHeight;
canvas.width = window.innerWidth;
canvas.setAttribute(“style”, “position: fixed;left: 0;top: 0;pointer-events: none;”);
canvas.setAttribute(“id”, “canvas_sakura”);
document.getElementsByTagName(“body”)[0].appendChild(canvas);
cxt = canvas.getContext(“2d”);
var sakuraList = new SakuraList();
for (var i = 0; i < 50; i++) {
var sakura, randomX, randomY, randomS, randomR, randomFnx, randomFny;
randomX = getRandom(“x”);
randomY = getRandom(“y”);
randomR = getRandom(“r”);
randomS = getRandom(“s”);
randomFnx = getRandom(“fnx”);
randomFny = getRandom(“fny”);
randomFnR = getRandom(“fnr”);
sakura = new Sakura(randomX, randomY, randomS, randomR, {
x: randomFnx,
y: randomFny,
r: randomFnR
});
sakura.draw(cxt);
sakuraList.push(sakura)
}
stop = requestAnimationFrame(function() {
cxt.clearRect(0, 0, canvas.width, canvas.height);
sakuraList.update();
sakuraList.draw(cxt);
stop = requestAnimationFrame(arguments.callee)
})
}
window.onresize = function() {
var canvasSnow = document.getElementById(“canvas_snow”)
};
img.onload = function() {
startSakura()
};
function stopp() {
if (staticx) {
var child = document.getElementById(“canvas_sakura”);
child.parentNode.removeChild(child);
window.cancelAnimationFrame(stop);
staticx = false
} else {
startSakura()
}
};
- 1、将下面的代码添加在网站页脚底部或者在 wp 后台添加小工具,效果展示是一样的我是添加在小工具的
- 2、添加路径:在后台—》外观—》小工具—》自定义 HTML—》 选择你需要放的位置
- 3、我是添加在文章侧边栏
- 4、修改代码中的链接以及文字改为自己的
<div class="textwidget"><div class="attentionus"><span class="zhan-widget-link zhan-link-z1"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span><br /> <span class="zhan-widget-link zhan-link-z2"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span><br /> <span class="zhan-widget-link zhan-link-z3"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span><br /> <span class="zhan-widget-link zhan-link-z4"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span><br /> <span class="zhan-widget-link zhan-link-z5"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span></div> <style type="text/css"> .zhan-widget-link{position:relative;margin-bottom:-10px !important;position:relative;display:block;font-size:13px;background:#fff;color:#525252;line-height:40px;margin-left:-10px;padding:0 14px;border:1px solid #DDD;border-radius:2px;width:auto}span.zhan-widget-link.zhan-link-z1 {margin-top: -10px;}.zhan-widget-link-count i{margin-right:9px;font-size:17px;vertical-align:middle}.zhan-widget-link-title{position:absolute;top:-1px;right:-14px !important;bottom:-1px;width:100px;text-align:center;background:rgba(255,255,255,.08);transition:width .3s;border-radius:0 3px 3px 0}.zhan-widget-link:hover .zhan-widget-link-title{width:116px}.zhan-widget-link a{position:absolute;top:0;left:0;right:0;bottom:0}.zhan-link-z1{border-color:rgba(236,61,81,.39)}.zhan-link-z1 i{color:#FFF;margin-right:3px}.zhan-link-z1 .zhan-widget-link-title{background-color:#ec3d51;color:#fff}.zhan-link-z2{border-color:rgba(18,170,232,.39)}.zhan-link-z2 i{color:#FFF;margin-right:3px}.zhan-link-z2 .zhan-widget-link-title{background-color:#12aae8;color:#fff}.zhan-link-z3{border-color:rgba(221,7,208,.39)}.zhan-link-z3 i{color:#FFF;margin-right:3px}.zhan-link-z3 .zhan-widget-link-title{background-color:#dd07d0;color:#fff}.zhan-link-z4{border-color:rgba(249,82,16,.39)}.zhan-link-z4 i{color:#FFF;margin-right:3px}.zhan-link-z4 .zhan-widget-link-title{background-color:#f95210;color:#fff}.zhan-link-z5{border-color:rgba(25,152,114,.39)}.zhan-link-z5 i{color:#FFF;margin-right:3px}.zhan-link-z5 .zhan-widget-link-title{background-color:#199872;color:#fff}</style> </div>
<div class="textwidget"><div class="attentionus"><span class="zhan-widget-link zhan-link-z1"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span><br />
<span class="zhan-widget-link zhan-link-z2"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span><br />
<span class="zhan-widget-link zhan-link-z3"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span><br />
<span class="zhan-widget-link zhan-link-z4"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span><br />
<span class="zhan-widget-link zhan-link-z5"> <span class="zhan-widget-link-count">介绍</span> <a href="链接" target="_blank" rel="noopener"><span class="zhan-widget-link-title">名称</span> </a></span></div>
<style type="text/css">
.zhan-widget-link{position:relative;margin-bottom:-10px !important;position:relative;display:block;font-size:13px;background:#fff;color:#525252;line-height:40px;margin-left:-10px;padding:0 14px;border:1px solid #DDD;border-radius:2px;width:auto}span.zhan-widget-link.zhan-link-z1 {margin-top: -10px;}.zhan-widget-link-count i{margin-right:9px;font-size:17px;vertical-align:middle}.zhan-widget-link-title{position:absolute;top:-1px;right:-14px !important;bottom:-1px;width:100px;text-align:center;background:rgba(255,255,255,.08);transition:width .3s;border-radius:0 3px 3px 0}.zhan-widget-link:hover .zhan-widget-link-title{width:116px}.zhan-widget-link a{position:absolute;top:0;left:0;right:0;bottom:0}.zhan-link-z1{border-color:rgba(236,61,81,.39)}.zhan-link-z1 i{color:#FFF;margin-right:3px}.zhan-link-z1 .zhan-widget-link-title{background-color:#ec3d51;color:#fff}.zhan-link-z2{border-color:rgba(18,170,232,.39)}.zhan-link-z2 i{color:#FFF;margin-right:3px}.zhan-link-z2 .zhan-widget-link-title{background-color:#12aae8;color:#fff}.zhan-link-z3{border-color:rgba(221,7,208,.39)}.zhan-link-z3 i{color:#FFF;margin-right:3px}.zhan-link-z3 .zhan-widget-link-title{background-color:#dd07d0;color:#fff}.zhan-link-z4{border-color:rgba(249,82,16,.39)}.zhan-link-z4 i{color:#FFF;margin-right:3px}.zhan-link-z4 .zhan-widget-link-title{background-color:#f95210;color:#fff}.zhan-link-z5{border-color:rgba(25,152,114,.39)}.zhan-link-z5 i{color:#FFF;margin-right:3px}.zhan-link-z5 .zhan-widget-link-title{background-color:#199872;color:#fff}</style>
</div>
效果预览
效果预览
添加教程
后台添加[自定义HTML小工具]把下面的代码填进去
<div class="textwidget custom-html-widget"><canvas id="canvas" style="width:100%;" width="820" height="250"></canvas> <script src="https://mx142.github.io/js/particletime/clock.js"></script></div>
<div class="textwidget custom-html-widget"><canvas id="canvas" style="width:100%;" width="820" height="250"></canvas>
<script src="https://mx142.github.io/js/particletime/clock.js"></script></div>
效果预览
2024年
03月
添加教程
<style> </style> <div class="wiiuii-suiji-main"> <div class="wiiuii-suiji-header"> <div class="xingyu-dt-ty"> <span class="xingyu-dt-day wiiuiiDay"></span> <p class="xingyu-sj-date"> <span class="wiiuiiYear"></span> <span class="wiiuiiMonth"></span> </p> </div> <div class="xingyu-sjzt-ty"> <span class="xingyu-yiyin"></span> </div> </div> <div class="xingyu-sj-qhbtn"> <span id="xingyu-qh-btn"><i class="fa fa-paper-plane" aria-hidden="true"></i> 换一句</span> </div> <div class="xingyu-sjtitle-ty"> <span>——更多教程,关注博客——</span> </div> </div> <script type="text/javascript" src="https://mx142.github.io/js/rqgsy/yiyin-img.js"></script>
<style>
</style>
<div class=”wiiuii-suiji-main”>
<div class=”wiiuii-suiji-header”>
<div class=”xingyu-dt-ty”>
<span class=”xingyu-dt-day wiiuiiDay”></span>
<p class=”xingyu-sj-date”>
<span class=”wiiuiiYear”></span>
<span class=”wiiuiiMonth”></span>
</p>
</div>
<div class=”xingyu-sjzt-ty”>
<span class=”xingyu-yiyin”></span>
</div>
</div>
<div class=”xingyu-sj-qhbtn”>
<span id=”xingyu-qh-btn”><i class=”fa fa-paper-plane” aria-hidden=”true”></i> 换一句</span>
</div>
<div class=”xingyu-sjtitle-ty”>
<span>——更多教程,关注博客——</span>
</div>
</div>
<script type=”text/javascript” src=”https://mx142.github.io/js/rqgsy/yiyin-img.js”></script>
后台添加[自定义HTML小工具]
这里就不在说如何添加自定义HTML小工具了,把它添加到侧边,然后把下面的代码放进去,然后保存
关于yiyin-img.JS文件
可以自己修改背景图和一言,代码放到下面,自己创建一个JS文件然后复制进去,自己修改后调用,如果觉得麻烦用自带的。
[重要]:一言修改或者添加在“wiiuiiYiYan”这里面,背景图修改或者添加在“wiiuiiYiYanBg”里面。
/** * 日期 古诗一言 * */ var wiiuiiYiYan = [ '休对故人思故国,且将新火试新茶。诗酒趁年华。——宋苏轼《望江南》', '山中何事?松花酿酒,春水煎茶。——元张可久《人月圆》', '最是人间留不住,朱颜辞镜花辞树。——清·王国维《蝶恋花》', '正是江南好风景,落花时节又逢君。——唐·杜甫《江南逢李龟年》', '醉后不知天在水,满船清梦压星河。——元·唐温如《题龙阳县青草湖》', '纸屏石枕竹方床,手倦抛书午梦长。——宋蔡确《夏日登车盖亭》', '曾是惊鸿照影来。——宋陆游《沈园二首》', '人生天地间,忽如远行客。——汉佚名《古诗十九首》', '直道相思了无益,未妨惆怅是清狂。——唐·李商隐《无题》', '秋风生渭水,落叶满长安。——唐·贾岛《忆江上吴处士》', '一愿郎君千岁,二愿妾身常健。——唐冯延巳《长命女》', '雾失楼台,月迷津渡。桃源望断无寻处。——宋秦观《踏莎行郴州旅舍》', '独立小楼风满袖,平林新月人归后。——南唐冯延巳《鹊踏枝》', '晓看天色暮看云,行也思君,坐也思君。——明唐寅《一剪梅》', '叹息老来交旧尽,睡来谁共午瓯茶。——宋陆游《幽居初夏》', '客散酒醒深夜后,更持红烛赏残花。——唐李商隐《花下醉》', '柴门闻犬吠,风雪夜归人。——唐·刘长卿《逢雪宿芙蓉山主人》', '庭院深深深几许,杨柳堆烟,帘幕无重数。——宋欧阳修《蝶恋花》', '有约不来过夜半,闲敲棋子落灯花。——宋赵师秀《约客》', '满目山河空念远,落花风雨更伤春。不如怜取眼前人。——宋晏殊《浣溪沙》' ] var wiiuiiYiYanBg = [ 'https://mx142.github.io/img/rqgsy/1.webp', 'https://mx142.github.io/img/rqgsy/2.webp', 'https://mx142.github.io/img/rqgsy/3.webp', 'https://mx142.github.io/img/rqgsy/4.webp', 'https://mx142.github.io/img/rqgsy/5.webp', 'https://mx142.github.io/img/rqgsy/6.webp', 'https://mx142.github.io/img/rqgsy/7.webp', 'https://mx142.github.io/img/rqgsy/8.webp', 'https://mx142.github.io/img/rqgsy/9.webp', 'https://mx142.github.io/img/rqgsy/10.webp', 'https://mx142.github.io/img/rqgsy/11.webp' ] eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('6 9=2.3(".j-I-J"),k=9.l.l,7=K L,4=7.M()+1,b=7.N();2.3(".O").5=7.P()+"\\Q";10>4?2.3(".4").5="0"+4+"\\m":2.3(".4").5=4+"\\m";10>4&&(2.3(".b").5="0"+b);k.o.p="0";6 q=2.3("#d-R-S"),e=2.3(".d-r");f g(){6 a=8.s(8.t()*u.v);e.5=w[8.s(8.t()*w.v)];9.o.T="U("+u[a]+")";}g();q.H=f(){g()};e.H=f(){6 a=2.3(".d-r").1e.1f("\\1g")[0];1h("x://1i.1j.y/1k.1l?1m="+a)};',62,85,'||document|querySelector|wiiuiiMonth|innerHTML|var|date|Math|wiiuiiYiMain||wiiuiiDay||xingyu|wiiuiiYiYinTextBox|function|wiiuiiRanYiYin|calc|1px|wiiuii|wiuiSjMain|parentNode|u6708||style|padding|wiiuiiYyRanBtn|yiyin|floor|random|wiiuiiYiYanBg|length|wiiuiiYiYan|https|cn|212121|40|323232|60|008F95|70|14FFEC|5px|onclick|suiji|main|new|Date|getMonth|getDate|wiiuiiYear|getFullYear|u5e74|qh|btn|backgroundImage|url|console|log|u661f|u8bed|u7684||u5c0f|u6728|u5c4b|www|color|fff|background|linear|gradient|55deg|100|border|radius|textContent|split|u3002|open|so|gushiwen|search|aspx|value'.split('|'),0,{}))
/**
*
日期 古诗一言
*
*/
var wiiuiiYiYan = [
'休对故人思故国,且将新火试新茶。诗酒趁年华。——宋苏轼《望江南》',
'山中何事?松花酿酒,春水煎茶。——元张可久《人月圆》',
'最是人间留不住,朱颜辞镜花辞树。——清·王国维《蝶恋花》',
'正是江南好风景,落花时节又逢君。——唐·杜甫《江南逢李龟年》',
'醉后不知天在水,满船清梦压星河。——元·唐温如《题龙阳县青草湖》',
'纸屏石枕竹方床,手倦抛书午梦长。——宋蔡确《夏日登车盖亭》',
'曾是惊鸿照影来。——宋陆游《沈园二首》',
'人生天地间,忽如远行客。——汉佚名《古诗十九首》',
'直道相思了无益,未妨惆怅是清狂。——唐·李商隐《无题》',
'秋风生渭水,落叶满长安。——唐·贾岛《忆江上吴处士》',
'一愿郎君千岁,二愿妾身常健。——唐冯延巳《长命女》',
'雾失楼台,月迷津渡。桃源望断无寻处。——宋秦观《踏莎行郴州旅舍》',
'独立小楼风满袖,平林新月人归后。——南唐冯延巳《鹊踏枝》',
'晓看天色暮看云,行也思君,坐也思君。——明唐寅《一剪梅》',
'叹息老来交旧尽,睡来谁共午瓯茶。——宋陆游《幽居初夏》',
'客散酒醒深夜后,更持红烛赏残花。——唐李商隐《花下醉》',
'柴门闻犬吠,风雪夜归人。——唐·刘长卿《逢雪宿芙蓉山主人》',
'庭院深深深几许,杨柳堆烟,帘幕无重数。——宋欧阳修《蝶恋花》',
'有约不来过夜半,闲敲棋子落灯花。——宋赵师秀《约客》',
'满目山河空念远,落花风雨更伤春。不如怜取眼前人。——宋晏殊《浣溪沙》'
]
var wiiuiiYiYanBg = [
'https://mx142.github.io/img/rqgsy/1.webp',
'https://mx142.github.io/img/rqgsy/2.webp',
'https://mx142.github.io/img/rqgsy/3.webp',
'https://mx142.github.io/img/rqgsy/4.webp',
'https://mx142.github.io/img/rqgsy/5.webp',
'https://mx142.github.io/img/rqgsy/6.webp',
'https://mx142.github.io/img/rqgsy/7.webp',
'https://mx142.github.io/img/rqgsy/8.webp',
'https://mx142.github.io/img/rqgsy/9.webp',
'https://mx142.github.io/img/rqgsy/10.webp',
'https://mx142.github.io/img/rqgsy/11.webp'
]
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('6 9=2.3(".j-I-J"),k=9.l.l,7=K L,4=7.M()+1,b=7.N();2.3(".O").5=7.P()+"\\Q";10>4?2.3(".4").5="0"+4+"\\m":2.3(".4").5=4+"\\m";10>4&&(2.3(".b").5="0"+b);k.o.p="0";6 q=2.3("#d-R-S"),e=2.3(".d-r");f g(){6 a=8.s(8.t()*u.v);e.5=w[8.s(8.t()*w.v)];9.o.T="U("+u[a]+")";}g();q.H=f(){g()};e.H=f(){6 a=2.3(".d-r").1e.1f("\\1g")[0];1h("x://1i.1j.y/1k.1l?1m="+a)};',62,85,'||document|querySelector|wiiuiiMonth|innerHTML|var|date|Math|wiiuiiYiMain||wiiuiiDay||xingyu|wiiuiiYiYinTextBox|function|wiiuiiRanYiYin|calc|1px|wiiuii|wiuiSjMain|parentNode|u6708||style|padding|wiiuiiYyRanBtn|yiyin|floor|random|wiiuiiYiYanBg|length|wiiuiiYiYan|https|cn|212121|40|323232|60|008F95|70|14FFEC|5px|onclick|suiji|main|new|Date|getMonth|getDate|wiiuiiYear|getFullYear|u5e74|qh|btn|backgroundImage|url|console|log|u661f|u8bed|u7684||u5c0f|u6728|u5c4b|www|color|fff|background|linear|gradient|55deg|100|border|radius|textContent|split|u3002|open|so|gushiwen|search|aspx|value'.split('|'),0,{}))
效果预览
添加教程
把下面代码放到小工具的html里面即可
PS:下面链接是SSL的,如果你网站没加SSL是调用不起来的
<iframe src="https://mx142.github.io/sidebarspacesmallwatch/index.html" width="290" height="290" frameborder="no"></iframe>
<iframe src="https://mx142.github.io/sidebarspacesmallwatch/index.html" width="290" height="290" frameborder="no"></iframe>
想调用自己的html网站看下面教程
- 第一步
把HTML源代码下载到服务器里面
wget -rck -np https://mx142.github.io/sidebarspacesmallwatch/index.html
wget -rck -np https://mx142.github.io/sidebarspacesmallwatch/index.html
- 第二步
然后用代码调用,下面的代码里的链接改成你的链接
<iframe src="改成你的链接" width="290" height="290" frameborder="no"></iframe>
<iframe src="改成你的链接" width="290" height="290" frameborder="no"></iframe>
- 第三步
把上面的代码放到WordPress后台–>小工具–>自定义html–>首页-侧边栏
效果预览
添加教程
小工具HTML代码
把下面复制到WordPress后台–>小工具–>选择html代码–>放到你需要放的位置
<div class="textwidget custom-html-widget"><div class="widget" style="top: 0px; visibility: visible; animation-name: fadeInUp;padding: 0px;"> <div class="widget_product"> <img title="zibll子比主题" src="https://mx142.github.io/img/sidebarpromotonwidget/14-0.webp"> <div class="product_content"> <div class="product_info"> <h2>Zibll-子比主题-本站同款</h2> <ul> <li><i class="fa fa-check"></i> 搭建网站从一个优秀的主题开始!</li> <li><i class="fa fa-check"></i> 一次购买包永久免费更新</li> <li><i class="fa fa-check"></i> 强大的模板群为你解决主题问题</li> <li><i class="fa fa-check"></i> 通过下方链接购买 <span class="but c-yellow">立减10</span> 元!</li> </ul> </div> <div class="price_sale"> <strong><small>¥</small>399</strong> <h2>官方统一售价</h2> </div> <a class="btn" href="https://wp.magiclee.cn/?golink=aHR0cHM6Ly93d3cud3dydS5jbi8/Z29saW5rPWFIUjBjSE02THk5M2QzY3VlbWxpYkd3dVkyOXRQM0psWmowek1ESTE=" target="_blank" rel="noopener">立即购买 - zibll</a> </div> </div> </div></div>
<div class="textwidget custom-html-widget"><div class="widget" style="top: 0px; visibility: visible; animation-name: fadeInUp;padding: 0px;">
<div class="widget_product">
<img title=”zibll子比主题” src=”https://mx142.github.io/img/sidebarpromotonwidget/14-0.webp”>
<div class=”product_content”>
<div class=”product_info”>
<h2>Zibll-子比主题-本站同款</h2>
<ul>
<li><i class=”fa fa-check”></i> 搭建网站从一个优秀的主题开始!</li>
<li><i class=”fa fa-check”></i> 一次购买包永久免费更新</li>
<li><i class=”fa fa-check”></i> 强大的模板群为你解决主题问题</li>
<li><i class=”fa fa-check”></i> 通过下方链接购买 <span class=”but c-yellow”>立减10</span> 元!</li>
</ul>
</div>
<div class=”price_sale”>
<strong><small>¥</small>399</strong>
<h2>官方统一售价</h2>
</div>
<a class=”btn” href=”https://www.wwru.cn/?golink=aHR0cHM6Ly93d3cuemlibGwuY29tP3JlZj0zMDI1″ target=”_blank” rel=”noopener”>立即购买 – zibll</a>
</div>
</div>
</div></div>
CSS代码
把下面代码复制到主题后台–>自定义代码–>自定义CSS样式
/*侧边栏主题推荐开始*/ .widget { clear: both; position: relative; margin-bottom: 20px; overflow: hidden; } .widget_product { background: #fff; background-color:transparent;/*透明色*/ } .product_content { padding: 15px; } .product_info h2 { font-size: 20px; margin: 0; font-weight: bold; padding: 5px 0 10px 0; } .widget ul { zoom: 1; list-style: none; padding: 0; margin: 0; } .product_info>ul>li { font-size: 13px; margin-bottom: 28px; list-style: none; } .price_sale { border-top: 1px solid #eee; padding: 10px 0px; } .price_sale strong { float: right; font-size: 20px; line-height: 1; font-weight: 100; } small, .small { font-size: 85%; } .price_sale h2 { margin: 0; font-size: 14px; color: #999; line-height: 20px; } .product_content>.btn { top: 5px; text-align: center; text-decoration: none; cursor: pointer; width: 100%; background: linear-gradient(-125deg,#54e38e 0%, #41c7Af 100%); box-shadow: 0 3px 10px -1px #41c7Af!important; color: #ffffff; } /*侧边栏主题推荐结束*/
/*侧边栏主题推荐开始*/
.widget {
clear: both;
position: relative;
margin-bottom: 20px;
overflow: hidden;
}
.widget_product {
background: #fff;
background-color:transparent;/*透明色*/
}
.product_content {
padding: 15px;
}
.product_info h2 {
font-size: 20px;
margin: 0;
font-weight: bold;
padding: 5px 0 10px 0;
}
.widget ul {
zoom: 1;
list-style: none;
padding: 0;
margin: 0;
}
.product_info>ul>li {
font-size: 13px;
margin-bottom: 28px;
list-style: none;
}
.price_sale {
border-top: 1px solid #eee;
padding: 10px 0px;
}
.price_sale strong {
float: right;
font-size: 20px;
line-height: 1;
font-weight: 100;
}
small, .small {
font-size: 85%;
}
.price_sale h2 {
margin: 0;
font-size: 14px;
color: #999;
line-height: 20px;
}
.product_content>.btn {
top: 5px;
text-align: center;
text-decoration: none;
cursor: pointer;
width: 100%;
background: linear-gradient(-125deg,#54e38e 0%, #41c7Af 100%);
box-shadow: 0 3px 10px -1px #41c7Af!important;
color: #ffffff;
}
/*侧边栏主题推荐结束*/
效果预览
添加教程
把下面代码放到小工具的html里面即可
PS:下面链接是SSL的,如果你网站没加SSL是调用不起来的
<iframe src="https://mx142.github.io/smallclock/index.html" width="290" height="290" frameborder="no" style="px;filter:alpha(opacity=50);opacity:100;"></iframe>
<iframe src="https://mx142.github.io/smallclock/index.html" width="290" height="290" frameborder="no" style="px;filter:alpha(opacity=50);opacity:100;"></iframe>
想调用自己的HTML网站看下面教程
- 第一步把HTML源代码下载到服务器里面
wget -rck -np https://mx142.github.io/smallclock/index.html
wget -rck -np https://mx142.github.io/smallclock/index.html
- 第二步
然后用代码调用,下面的链接改成你的链接
<iframe src="改成你的链接" width="290" height="290" frameborder="no"></iframe>
- 第三步
把上面的代码放到WordPress后台–>小工具–>自定义html–>首页-侧边栏
效果预览
添加教程
首先把下面的代码复制然后在 wordpress 程序的主题小工具中添加自定义 HTML代码。
路径:WordPress 后台——外观——小工具——自定义 HTML——复制代码粘贴代码进去——首页-侧边栏
- 第一步:添加小工具-自定义HTML代码:
<div class="searchs"><div class="tit"><strong>百度一下</strong></div><mip-form method="get" url="https://www.baidu.com/s" class="mip-element mip-layout-container"><form action="https://www.baidu.com/s" method="GET" target="_blank"><input type="text" name="wd" validatetarget="q" validatetype="must" placeholder="请输入搜索词" value="织音博客"><div target="q">关键词不能为空</div><input type="submit" value="搜索"></form></mip-form></div>
<div class="searchs"><div class="tit"><strong>百度一下</strong></div><mip-form method="get" url="https://www.baidu.com/s" class="mip-element mip-layout-container"><form action="https://www.baidu.com/s" method="GET" target="_blank"><input type="text" name="wd" validatetarget="q" validatetype="must" placeholder="请输入搜索词" value="织音博客"><div target="q">关键词不能为空</div><input type="submit" value="搜索"></form></mip-form></div>
- 第二步:在模板的自定义CSS样式中添加如下代码:
/*百度一下开始*/.searchs {background-color: #fff;border: 1px solid #eaeaea;padding: 15px;overflow: hidden;transition: all 0.3s;border-radius: 4px;position: relative;margin: 0px 0px 15px 0px;}.mip-layout-container, .mip-layout-fixed-height {margin: 0px 0px 0px 0px;display: block;position: relative;}mip-form form {position: relative;}.searchs input[type="text"] {border: #45B6F7 1px solid;border-radius: 4px;width: calc( 100% - 2px );}mip-form input[type='text'], mip-form input[type='input'], mip-form input[type='datetime'], mip-form input[type='email'], mip-form input[type='number'], mip-form input[type='tel'], mip-form input[type='url'] {padding-right: 30px;}.searchs input {outline: none;}mip-form input, mip-form textarea, mip-form select {border: 1px solid #f1f1f1;padding: 6px;display: block;box-sizing: border-box;-webkit-box-sizing: border-box;resize: none;font-size: 16px;}mip-form div {display: none;color: #ec1f5c;font-size: 12px;text-align: left;padding: 0 10% 0 3%;}.searchs input[type="submit"] {position: absolute;right: 2px;top: 2px;background-color: #45B6F7;color: #fff;font-size: 13px;margin: 1px;height: 31px;line-height: 31px;padding: 0 10px;font-family: "èé…é‘";}mip-form input[type='submit'] {border: 1px solid #f1f1f1;border-radius: 5px;color: #333;background-color: #d8d7d7;}.searchs input {outline: none;}.tit {background-color: #FF5E52;position: relative;top: -15px;display: inline-block;color: #fff;padding: 4px 15px;font-size: 14px;}.tit strong {font-weight: normal;}.tit {background-color: #FF5E52;position: relative;top: -15px;display: inline-block;color: #fff;padding: 4px 15px;font-size: 14px;}/*百度一下结束*/
/*百度一下开始*/.searchs {background-color: #fff;border: 1px solid #eaeaea;padding: 15px;overflow: hidden;transition: all 0.3s;border-radius: 4px;position: relative;margin: 0px 0px 15px 0px;}.mip-layout-container, .mip-layout-fixed-height {margin: 0px 0px 0px 0px;display: block;position: relative;}mip-form form {position: relative;}.searchs input[type="text"] {border: #45B6F7 1px solid;border-radius: 4px;width: calc( 100% - 2px );}mip-form input[type='text'], mip-form input[type='input'], mip-form input[type='datetime'], mip-form input[type='email'], mip-form input[type='number'], mip-form input[type='tel'], mip-form input[type='url'] {padding-right: 30px;}.searchs input {outline: none;}mip-form input, mip-form textarea, mip-form select {border: 1px solid #f1f1f1;padding: 6px;display: block;box-sizing: border-box;-webkit-box-sizing: border-box;resize: none;font-size: 16px;}mip-form div {display: none;color: #ec1f5c;font-size: 12px;text-align: left;padding: 0 10% 0 3%;}.searchs input[type="submit"] {position: absolute;right: 2px;top: 2px;background-color: #45B6F7;color: #fff;font-size: 13px;margin: 1px;height: 31px;line-height: 31px;padding: 0 10px;font-family: "èé…é‘";}mip-form input[type='submit'] {border: 1px solid #f1f1f1;border-radius: 5px;color: #333;background-color: #d8d7d7;}.searchs input {outline: none;}.tit {background-color: #FF5E52;position: relative;top: -15px;display: inline-block;color: #fff;padding: 4px 15px;font-size: 14px;}.tit strong {font-weight: normal;}.tit {background-color: #FF5E52;position: relative;top: -15px;display: inline-block;color: #fff;padding: 4px 15px;font-size: 14px;}/*百度一下结束*/
效果预览
添加教程
把下面的代码放在站点后台 >>外观
>> 小工具
>> html代码
然后把小工具添加到指定侧边栏中即可。
<html > <head> <style type="text/css"> .se-kl{width:190px;height:275px;background-color:#e83632;margin:auto;position:relative}.se-cn{position:absolute;top:42px;left:0;width:100%;text-align:center;font-size:34px;color:#fff}.se-en{position:absolute;top:90px;left:0;width:100%;text-align:center;font-size:20px;color:rgba(255,255,255,.5)}.se-io{width:20px;height:33px;position:absolute;background:url(https://img.wiiuii.cn/img/seckill.png) no-repeat;background-position:-32.5px 0;background-size:52.5px 40px;left:85px;top:126px;display:block}.se-info{position:absolute;top:170px;text-align:center;width:100%;font-size:16px;color:#fff}.se-count{position:absolute;top:212px;left:30px;height:40px}.se-day{display:none}.se-hour,.se-min,.se-sec{position:relative;background-color:#2f3430;width:40px;height:40px;float:left;text-align:center;line-height:40px;margin-right:5px}.se-txt{font-size:20px;font-weight:700;color:#fff}.se-txt:before{content:"";display:block;position:absolute;top:50%;left:0;width:100%;height:1px;background-color:#e83632} </style> </head> <body> <div class="se-kl"> <div class="se-cn">倒计时</div> <div class="se-en">COUNT DOWN</div> <i class="se-io"></i> <div class="se-info">距离结束还剩</div> <div class="se-count"> <div class="se-day"></div> <div class="se-hour"><span class="se-txt">00</span></div> <div class="se-min"><span class="se-txt">00</span></div> <div class="se-sec"><span class="se-txt">00</span></div> </div> </div> <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var oDate = new Date(); var nowTime = oDate.getTime(); //现在的毫秒数 oDate.setDate(oDate.getDate() + 1); // 设定截止时间为第二天 var targetDate = new Date(oDate.toLocaleDateString()); run(targetDate); }); function run(enddate) { getDate(enddate); setInterval("getDate('" + enddate + "')", 500); } function getDate(enddate) { var oDate = new Date(); //获取日期对象 var nowTime = oDate.getTime(); //现在的毫秒数 var enddate = new Date(enddate); var targetTime = enddate.getTime(); // 截止时间的毫秒数 var second = Math.floor((targetTime - nowTime) / 1000); //截止时间距离现在的秒数 var day = Math.floor(second / 24 * 60 * 60); //整数部分代表的是天;一天有24*60*60=86400秒 ; second = second % 86400; //余数代表剩下的秒数; var hour = Math.floor(second / 3600); //整数部分代表小时; second %= 3600; //余数代表 剩下的秒数; var minute = Math.floor(second / 60); second %= 60; var spanH = $('.se-txt')[0]; var spanM = $('.se-txt')[1]; var spanS = $('.se-txt')[2]; spanH.innerHTML = tow(hour); spanM.innerHTML = tow(minute); spanS.innerHTML = tow(second); } function tow(n) { return n >= 0 && n < 10 ? '0' + n : '' + n; } </script> </body> </html>
<html >
<head>
<style type="text/css">
.se-kl{width:190px;height:275px;background-color:#e83632;margin:auto;position:relative}.se-cn{position:absolute;top:42px;left:0;width:100%;text-align:center;font-size:34px;color:#fff}.se-en{position:absolute;top:90px;left:0;width:100%;text-align:center;font-size:20px;color:rgba(255,255,255,.5)}.se-io{width:20px;height:33px;position:absolute;background:url(https://img.wiiuii.cn/img/seckill.png) no-repeat;background-position:-32.5px 0;background-size:52.5px 40px;left:85px;top:126px;display:block}.se-info{position:absolute;top:170px;text-align:center;width:100%;font-size:16px;color:#fff}.se-count{position:absolute;top:212px;left:30px;height:40px}.se-day{display:none}.se-hour,.se-min,.se-sec{position:relative;background-color:#2f3430;width:40px;height:40px;float:left;text-align:center;line-height:40px;margin-right:5px}.se-txt{font-size:20px;font-weight:700;color:#fff}.se-txt:before{content:"";display:block;position:absolute;top:50%;left:0;width:100%;height:1px;background-color:#e83632}
</style>
</head>
<body>
<div class="se-kl">
<div class="se-cn">倒计时</div>
<div class="se-en">COUNT DOWN</div>
<i class="se-io"></i>
<div class="se-info">距离结束还剩</div>
<div class="se-count">
<div class="se-day"></div>
<div class="se-hour"><span class="se-txt">00</span></div>
<div class="se-min"><span class="se-txt">00</span></div>
<div class="se-sec"><span class="se-txt">00</span></div>
</div>
</div>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var oDate = new Date();
var nowTime = oDate.getTime(); //现在的毫秒数
oDate.setDate(oDate.getDate() + 1); // 设定截止时间为第二天
var targetDate = new Date(oDate.toLocaleDateString());
run(targetDate);
});
function run(enddate) {
getDate(enddate);
setInterval("getDate('" + enddate + "')", 500);
}
function getDate(enddate) {
var oDate = new Date(); //获取日期对象
var nowTime = oDate.getTime(); //现在的毫秒数
var enddate = new Date(enddate);
var targetTime = enddate.getTime(); // 截止时间的毫秒数
var second = Math.floor((targetTime - nowTime) / 1000); //截止时间距离现在的秒数
var day = Math.floor(second / 24 * 60 * 60); //整数部分代表的是天;一天有24*60*60=86400秒 ;
second = second % 86400; //余数代表剩下的秒数;
var hour = Math.floor(second / 3600); //整数部分代表小时;
second %= 3600; //余数代表 剩下的秒数;
var minute = Math.floor(second / 60);
second %= 60;
var spanH = $('.se-txt')[0];
var spanM = $('.se-txt')[1];
var spanS = $('.se-txt')[2];
spanH.innerHTML = tow(hour);
spanM.innerHTML = tow(minute);
spanS.innerHTML = tow(second);
}
function tow(n) {
return n >= 0 && n < 10 ? '0' + n : '' + n;
}
</script>
</body>
</html>
效果预览
添加教程
把下面代码展开复制粘贴到wp后台—》外观—》小工具—》自定义HTML里面
<!-- 恋爱计时 --> <ul class="joe_header__slideout-count"> <div id="lovexhj" style="width: 100%; height: 100%; text-align: center; font-size: 1rem;"> <div id="lovexhjImage" style="width: 220px; margin: 0 auto;"> <!-- 左边的头像 --> <img src="https://q1.qlogo.cn/g?b=qq&nk=你的QQ号&s=640" alt="love" style="width: 60px; border-radius: 50%;"> <!-- 中间的图片 --> <img src="https://atbk.oss-cn-shanghai.aliyuncs.com/image/aotian/love.gif" alt="love" style="width: 60px; border-radius: 50%;"> <!-- 右边的头像 --> <img src="https://q1.qlogo.cn/g?b=qq&nk=你对象的QQ号&s=640" alt="love" style="width: 60px; border-radius: 50%;"> </div> <p id="loveSitetime" style="font-size: 1.0rem;"></p> <script language=javascript> function loveSitetime() { window.setTimeout("loveSitetime()", 1000); var seconds = 1000 var minutes = seconds * 60 var hours = minutes * 60 var days = hours * 24 var years = days * 365 var today = new Date() var todayYear = today.getFullYear() var todayMonth = today.getMonth() + 1 var todayDate = today.getDate() var todayHour = today.getHours() var todayMinute = today.getMinutes() var todaySecond = today.getSeconds() // 时间设置 var t1 = Date.UTC(2021, 04, 05, 21, 00, 00) var t2 = Date.UTC(todayYear, todayMonth, todayDate, todayHour, todayMinute, todaySecond) var diff = t2 - t1 var diffYears = Math.floor(diff / years) var diffDays = Math.floor((diff / days) - diffYears * 365) var diffHours = Math.floor((diff - (diffYears * 365 + diffDays) * days) / hours) var diffMinutes = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours) / minutes) var diffSeconds = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours - diffMinutes * minutes) / seconds) document.getElementById("loveSitetime").innerHTML = "我们相恋了:</br>" + diffYears + "年" + diffDays + "天" + diffHours + "时" + diffMinutes + "分" + diffSeconds + "秒啦</br>" } loveSitetime() </script> </div> </ul>
<!-- 恋爱计时 -->
<ul class="joe_header__slideout-count">
<div id="lovexhj" style="width: 100%; height: 100%; text-align: center; font-size: 1rem;">
<div id="lovexhjImage" style="width: 220px; margin: 0 auto;">
<!-- 左边的头像 -->
<img src="https://q1.qlogo.cn/g?b=qq&nk=你的QQ号&s=640" alt="love"
style="width: 60px; border-radius: 50%;">
<!-- 中间的图片 -->
<img src="https://atbk.oss-cn-shanghai.aliyuncs.com/image/aotian/love.gif" alt="love"
style="width: 60px; border-radius: 50%;">
<!-- 右边的头像 -->
<img src="https://q1.qlogo.cn/g?b=qq&nk=你对象的QQ号&s=640" alt="love"
style="width: 60px; border-radius: 50%;">
</div>
<p id="loveSitetime" style="font-size: 1.0rem;"></p>
<script language=javascript>
function loveSitetime() {
window.setTimeout("loveSitetime()", 1000);
var seconds = 1000
var minutes = seconds * 60
var hours = minutes * 60
var days = hours * 24
var years = days * 365
var today = new Date()
var todayYear = today.getFullYear()
var todayMonth = today.getMonth() + 1
var todayDate = today.getDate()
var todayHour = today.getHours()
var todayMinute = today.getMinutes()
var todaySecond = today.getSeconds()
// 时间设置
var t1 = Date.UTC(2021, 04, 05, 21, 00, 00)
var t2 = Date.UTC(todayYear, todayMonth, todayDate, todayHour, todayMinute, todaySecond)
var diff = t2 - t1
var diffYears = Math.floor(diff / years)
var diffDays = Math.floor((diff / days) - diffYears * 365)
var diffHours = Math.floor((diff - (diffYears * 365 + diffDays) * days) / hours)
var diffMinutes = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours) / minutes)
var diffSeconds = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours -
diffMinutes * minutes) / seconds)
document.getElementById("loveSitetime").innerHTML = "我们相恋了:</br>" + diffYears + "年" + diffDays + "天" +
diffHours + "时" + diffMinutes + "分" + diffSeconds + "秒啦</br>"
}
loveSitetime()
</script>
</div>
</ul>
修改代码
下面图片的红框改成你QQ号和你对象的QQ号
下面红框里面的改成你在一起的时间2021是年,4是月,5是日,21是小时,00是分钟,00是秒。
效果预览
- 移动端
- PC端
添加教程
- 1.在子比主题的主题目录下,header.php底部添加以下函数代码:
<!--统计信息函数--> <script type="text/javascript" > <?php //用户总数 $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");echo "var tj_jstext="."'$users'"; ?> </script> <script type="text/javascript" > <?php /* * WordPress获取今日发布文章数量 */ function nd_get_24h_post_count(){ $today = getdate(); $query = new WP_Query( 'year=' . $today["year"] . '&monthnum=' . $today["mon"] . '&day=' . $today["mday"]); $postsNumber = $query->found_posts; return $postsNumber; } $post_24h = nd_get_24h_post_count(); echo "var tj_24h="."'$post_24h'"; ?> </script> <script type="text/javascript" > <?php /* * WordPress整站文章访问计数 */ function nd_get_all_view(){ global $wpdb; $count=0; $views= $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key='views'"); foreach($views as $key=>$value){ $meta_value=$value->meta_value; if($meta_value!=' '){ $count+=(int)$meta_value; } }return $count; } $post_view = nd_get_all_view(); echo "var tj_view="."'$post_view'"; ?> </script> <script type="text/javascript" > <?php //日志总数 $count_posts = wp_count_posts(); $published_posts =$count_posts->publish; echo "var tj_rzzs="."'$published_posts'"; ?> </script> <script type="text/javascript" > <?php //稳定运行 $wdyx_time = floor((time()-strtotime("2020-3-28"))/86400); echo "var tj_wdyx="."'$wdyx_time'"; ?> </script>
<!--统计信息函数-->
<script type="text/javascript" >
<?php
//用户总数
$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");echo "var tj_jstext="."'$users'";
?>
</script>
<script type="text/javascript" >
<?php
/*
* WordPress获取今日发布文章数量
*/
function nd_get_24h_post_count(){
$today = getdate();
$query = new WP_Query( 'year=' . $today["year"] . '&monthnum=' . $today["mon"] . '&day=' . $today["mday"]);
$postsNumber = $query->found_posts;
return $postsNumber;
}
$post_24h = nd_get_24h_post_count();
echo "var tj_24h="."'$post_24h'";
?>
</script>
<script type="text/javascript" >
<?php
/*
* WordPress整站文章访问计数
*/
function nd_get_all_view(){
global $wpdb;
$count=0;
$views= $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key='views'");
foreach($views as $key=>$value){
$meta_value=$value->meta_value;
if($meta_value!=' '){
$count+=(int)$meta_value;
}
}return $count;
}
$post_view = nd_get_all_view();
echo "var tj_view="."'$post_view'";
?>
</script>
<script type="text/javascript" >
<?php
//日志总数
$count_posts = wp_count_posts();
$published_posts =$count_posts->publish;
echo "var tj_rzzs="."'$published_posts'";
?>
</script>
<script type="text/javascript" >
<?php
//稳定运行
$wdyx_time = floor((time()-strtotime("2020-3-28"))/86400);
echo "var tj_wdyx="."'$wdyx_time'";
?>
</script>
- 修改版PHP代码:
<!--调用信息代码--> <!--底部统计用的代码--> <script type="text/javascript" > <?php //用户总数 $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");echo "var tj_jstext="."'$users'"; ?> </script> <script type="text/javascript" > <?php /* * WordPress获取今日发布文章数量 */ function nd_get_24h_post_count(){ $today = getdate(); $query = new WP_Query( 'year=' . $today["year"] . '&monthnum=' . $today["mon"] . '&day=' . $today["mday"]); $postsNumber = $query->found_posts; return $postsNumber; } $post_24h = nd_get_24h_post_count(); echo "var tj_24h="."'$post_24h'"; ?> </script> <script type="text/javascript" > <?php /* * WordPress整站文章访问计数 */ function nd_get_all_view(){ global $wpdb; $count=0; $views= $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key='views'"); foreach($views as $key=>$value){ $meta_value=$value->meta_value; if($meta_value!=' '){ $count+=(int)$meta_value; } }return $count; } $post_view = nd_get_all_view(); echo "var tj_view="."'$post_view'"; ?> </script> <script type="text/javascript" > <?php //日志总数 $count_posts = wp_count_posts(); $published_posts =$count_posts->publish; echo "var tj_rzzs="."'$published_posts'"; ?> </script> <script type="text/javascript" > <?php //稳定运行 $wdyx_time = floor((time()-strtotime("2020-04-29"))/86400); echo "var tj_wdyx="."'$wdyx_time'"; ?> </script> <!--调用信息代码结束-->
<!--调用信息代码-->
<!--底部统计用的代码-->
<script type="text/javascript" >
<?php
//用户总数
$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");echo "var tj_jstext="."'$users'";
?>
</script>
<script type="text/javascript" >
<?php
/*
* WordPress获取今日发布文章数量
*/
function nd_get_24h_post_count(){
$today = getdate();
$query = new WP_Query( 'year=' . $today["year"] . '&monthnum=' . $today["mon"] . '&day=' . $today["mday"]);
$postsNumber = $query->found_posts;
return $postsNumber;
}
$post_24h = nd_get_24h_post_count();
echo "var tj_24h="."'$post_24h'";
?>
</script>
<script type="text/javascript" >
<?php
/*
* WordPress整站文章访问计数
*/
function nd_get_all_view(){
global $wpdb;
$count=0;
$views= $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key='views'");
foreach($views as $key=>$value){
$meta_value=$value->meta_value;
if($meta_value!=' '){
$count+=(int)$meta_value;
}
}return $count;
}
$post_view = nd_get_all_view();
echo "var tj_view="."'$post_view'";
?>
</script>
<script type="text/javascript" >
<?php
//日志总数
$count_posts = wp_count_posts();
$published_posts =$count_posts->publish;
echo "var tj_rzzs="."'$published_posts'";
?>
</script>
<script type="text/javascript" >
<?php
//稳定运行
$wdyx_time = floor((time()-strtotime("2020-04-29"))/86400);
echo "var tj_wdyx="."'$wdyx_time'";
?>
</script>
<!--调用信息代码结束-->
注:函数运行日期2020-3-28改为你自己网站运行的日期。
- 2.在后台–>外观–>小工具–>自定义HTML,把自定义HTML放到合适的版块里(子比主题放在首页-底部全宽度),然后把下面代码复制粘贴进去,即可在前台显示。
<!--信息统计开始--> <div id="nuandao"> <div class="siteCount"> <div class="wrapper"> <ul> <li> <span> <script type="text/javascript" > document.write(tj_jstext); </script> </span> <b>用户总数</b> </li> <li> <span><script type="text/javascript" > document.write(tj_rzzs); </script></span> <b>文章总数</b> </li> <li> <span><script type="text/javascript" > document.write(tj_view); </script></span> <b>浏览总数</b> </li> <li> <span></span> <span> <script type="text/javascript" > document.write(tj_24h); </script> </span> <b>今日发布</b> </li> <li> <span><script type="text/javascript" > document.write(tj_wdyx); </script></span> <b>稳定运行</b> </li> </ul> <div class="join-vip"> <a href="/" target="_blank" style="background-image: linear-gradient(to right, #D279EE, #F8C390); text-align:center;" >立即加入</a> <p>加入Mx's Blog——专注于网络方面的学习知识分享!</p> </div> </div> </div> </div> <style type="text/css"> body{padding: 0px; margin: 0px;} *, *::before, *::after{box-sizing: border-box;} ol, ul{list-style: none;} a{color: inherit; text-decoration: none; vertical-align: top;}/*背景图*/#nuandao .siteCount{position: relative; padding: 60px 0; background: url(https://mx142.github.io/img/bottomstatisticsmodule/bottomstatisticsmodule.webp) center center / cover no-repeat fixed;}#nuandao .siteCount .cover{height: 100%; width: 100%; background: rgba(0, 0, 0, 0.6); position: absolute; top: 0; left: 0;}/*内容*/#nuandao .siteCount .wrapper{position: relative; z-index: 10; width: 1400px; max-width: 100%; margin: 0 auto;}#nuandao .siteCount ul{display: flex;}#nuandao .siteCount ul li{width: 20%; color: #fff; text-align: center;}/*模块*/#nuandao .siteCount ul li span{font-size: 48px; font-family: Arial;}#nuandao .siteCount ul li b{display: block; font-weight: normal; font-size: 14px;}/*按钮*/#nuandao .siteCount .join-vip{text-align: center; color: #fff; margin-top: 30px;}#nuandao .siteCount .join-vip a{display: inline-block; border: 0; border-radius: 5px; transition: all 0.3s; padding: 10px 30px; font-size: 15px; letter-spacing: 0.5px; background-color: var(--primary-color); background-image: -webkit-gradient( linear, left top, right top, from(#006eff), to(#13adff) ); background-image: -webkit-linear-gradient(left, #006eff, #13adff); background-image: -o-linear-gradient(left, #006eff 0, #13adff 100%); background-image: linear-gradient(90deg, #006eff, #13adff); -webkit-box-shadow: 0 5px 10px 0 rgba(16, 110, 253, 0.3); box-shadow: 0 5px 10px 0 rgba(16, 110, 253, 0.3); color: #fff;}#nuandao .siteCount .join-vip p{margin-top: 15px; font-size: 14px; color: rgba(255, 255, 255, 0.8); letter-spacing: 0.5px; font-family: Arial;}@media screen and (max-width: 768px){#nuandao .siteCount ul li span{font-size: 20px; font-family: Arial;}} </style> <!--信息统计结束-->
<!--信息统计开始-->
<div id="nuandao">
<div class="siteCount">
<div class="wrapper">
<ul>
<li>
<span>
<script type="text/javascript" >
document.write(tj_jstext);
</script>
</span>
<b>用户总数</b>
</li>
<li>
<span><script type="text/javascript" >
document.write(tj_rzzs);
</script></span>
<b>文章总数</b>
</li>
<li>
<span><script type="text/javascript" >
document.write(tj_view);
</script></span>
<b>浏览总数</b>
</li>
<li>
<span></span>
<span>
<script type="text/javascript" >
document.write(tj_24h);
</script>
</span>
<b>今日发布</b>
</li>
<li>
<span><script type="text/javascript" >
document.write(tj_wdyx);
</script></span>
<b>稳定运行</b>
</li>
</ul>
<div class="join-vip">
<a href="/" target="_blank" style="background-image: linear-gradient(to right, #D279EE, #F8C390); text-align:center;" >立即加入</a>
<p>加入Mx's Blog——专注于网络方面的学习知识分享!</p>
</div>
</div>
</div>
</div>
<style type="text/css">
body{padding: 0px; margin: 0px;} *, *::before, *::after{box-sizing: border-box;} ol, ul{list-style: none;} a{color: inherit; text-decoration: none; vertical-align: top;}/*背景图*/#nuandao .siteCount{position: relative; padding: 60px 0; background: url(https://mx142.github.io/img/bottomstatisticsmodule/bottomstatisticsmodule.webp) center center / cover no-repeat fixed;}#nuandao .siteCount .cover{height: 100%; width: 100%; background: rgba(0, 0, 0, 0.6); position: absolute; top: 0; left: 0;}/*内容*/#nuandao .siteCount .wrapper{position: relative; z-index: 10; width: 1400px; max-width: 100%; margin: 0 auto;}#nuandao .siteCount ul{display: flex;}#nuandao .siteCount ul li{width: 20%; color: #fff; text-align: center;}/*模块*/#nuandao .siteCount ul li span{font-size: 48px; font-family: Arial;}#nuandao .siteCount ul li b{display: block; font-weight: normal; font-size: 14px;}/*按钮*/#nuandao .siteCount .join-vip{text-align: center; color: #fff; margin-top: 30px;}#nuandao .siteCount .join-vip a{display: inline-block; border: 0; border-radius: 5px; transition: all 0.3s; padding: 10px 30px; font-size: 15px; letter-spacing: 0.5px; background-color: var(--primary-color); background-image: -webkit-gradient( linear, left top, right top, from(#006eff), to(#13adff) ); background-image: -webkit-linear-gradient(left, #006eff, #13adff); background-image: -o-linear-gradient(left, #006eff 0, #13adff 100%); background-image: linear-gradient(90deg, #006eff, #13adff); -webkit-box-shadow: 0 5px 10px 0 rgba(16, 110, 253, 0.3); box-shadow: 0 5px 10px 0 rgba(16, 110, 253, 0.3); color: #fff;}#nuandao .siteCount .join-vip p{margin-top: 15px; font-size: 14px; color: rgba(255, 255, 255, 0.8); letter-spacing: 0.5px; font-family: Arial;}@media screen and (max-width: 768px){#nuandao .siteCount ul li span{font-size: 20px; font-family: Arial;}}
</style>
<!--信息统计结束-->
- 使用的修改版本:(图标是阿里巴巴矢量图库,自己弄图标,然后修改<svg>标签里面的代码即可,背景图片自己修改或者下载到本地)
<!--信息统计开始--> <div id="nuandao" style="box-shadow: 0 0 10px var(--main-shadow);"> <div class="siteCount"> <div class="wrapper"> <div class="p-wh"> <ul> <li> <p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-bussiness-man"></use></svg></p> <span><script type="text/javascript" > document.write(tj_jstext); </script></span> <p>友链总数</p> </li> <li> <p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-copy"></use></svg></p> <span><script type="text/javascript" > document.write(tj_rzzs); </script></span> <p>文章总数</p> </li> <li> <p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-atm"></use></svg></p> <span><script type="text/javascript" > document.write(tj_view); </script></span> <p>浏览总数</p> </li> <li> <p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-editor"></use></svg></p> <span></span> <span><script type="text/javascript" > document.write(tj_24h); </script></span> <p>今日发布</p> </li> <li> <p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-certified-supplier"></use></svg></p> <span><script type="text/javascript" > document.write(tj_wdyx); </script></span> <p>稳定运行</p> </li> </ul> </div> <div class="join"> <p style="text-align:center">Mx's Blog——专注于网络方面的学习知识分享!<br><br>By:Mxblog站长</p> </div> </div> </div> </div> <style type="text/css"> /*背景图*/#nuandao .siteCount{position: relative; padding: 60px 0; background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),url(https://mx142.github.io/img/bottomstatisticsmodule/bottomstatisticsmodule.webp) center center / cover no-repeat fixed;/*border-radius:8px;*/border-radius: var(--main-radius);}#nuandao .siteCount .cover{height: 100%; width: 100%; background: rgba(0, 0, 0, 0.3); position: absolute; top: 0; left: 0;} /*内容*/#nuandao .siteCount .wrapper{position: relative; z-index: 10; width: 100%; max-width: 100%; margin: 0 auto;}#nuandao .siteCount ul{display: flex;}#nuandao .siteCount ul li{width: 20%; color: #fff; text-align: center;} /*模块*/#nuandao .siteCount ul li span{font-size: 48px; font-family: Arial;}@media screen and (max-width: 768px){#nuandao .siteCount ul li span{font-size: 20px; font-family: Arial;}}#nuandao .p-wh{font-weight:700;} /*底部文本p标签*/.join{padding-top: 20px;font-size: 15px;color: #FFF;letter-spacing: 0.5px;font-weight: 600;} @media screen and (max-width: 768px){#nuandao .siteCount{position: relative; padding: 30px 0;border-radius:8px;}#nuandao .siteCount .cover{height: 100%; width: 100%; background: rgba(0, 0, 0, 0.3); position: absolute; top: 0; left: 0;}} </style> <script> //document.getElementById("nuandao").parentNode.parentNode.style.backgroundColor="transparent" document.getElementById("nuandao").parentNode.parentNode.style.padding=0 </script> <!--信息统计结束-->
<!--信息统计开始-->
<div id="nuandao" style="box-shadow: 0 0 10px var(--main-shadow);">
<div class="siteCount">
<div class="wrapper">
<div class="p-wh">
<ul>
<li>
<p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-bussiness-man"></use></svg></p>
<span><script type="text/javascript" >
document.write(tj_jstext);
</script></span>
<p>友链总数</p>
</li>
<li>
<p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-copy"></use></svg></p>
<span><script type="text/javascript" >
document.write(tj_rzzs);
</script></span>
<p>文章总数</p>
</li>
<li>
<p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-atm"></use></svg></p>
<span><script type="text/javascript" >
document.write(tj_view);
</script></span>
<p>浏览总数</p>
</li>
<li>
<p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-editor"></use></svg></p>
<span></span>
<span><script type="text/javascript" >
document.write(tj_24h);
</script></span>
<p>今日发布</p>
</li>
<li>
<p><svg class="icon fa-2x" aria-hidden="true"><use xlink:href="#icon-certified-supplier"></use></svg></p>
<span><script type="text/javascript" >
document.write(tj_wdyx);
</script></span>
<p>稳定运行</p>
</li>
</ul>
</div>
<div class="join">
<p style="text-align:center">Mx's Blog——专注于网络方面的学习知识分享!<br><br>By:Mxblog站长</p>
</div>
</div>
</div>
</div>
<style type="text/css">
/*背景图*/#nuandao .siteCount{position: relative; padding: 60px 0; background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),url(https://mx142.github.io/img/bottomstatisticsmodule/bottomstatisticsmodule.webp) center center / cover no-repeat fixed;/*border-radius:8px;*/border-radius: var(--main-radius);}#nuandao .siteCount .cover{height: 100%; width: 100%; background: rgba(0, 0, 0, 0.3); position: absolute; top: 0; left: 0;}
/*内容*/#nuandao .siteCount .wrapper{position: relative; z-index: 10; width: 100%; max-width: 100%; margin: 0 auto;}#nuandao .siteCount ul{display: flex;}#nuandao .siteCount ul li{width: 20%; color: #fff; text-align: center;}
/*模块*/#nuandao .siteCount ul li span{font-size: 48px; font-family: Arial;}@media screen and (max-width: 768px){#nuandao .siteCount ul li span{font-size: 20px; font-family: Arial;}}#nuandao .p-wh{font-weight:700;}
/*底部文本p标签*/.join{padding-top: 20px;font-size: 15px;color: #FFF;letter-spacing: 0.5px;font-weight: 600;}
@media screen and (max-width: 768px){#nuandao .siteCount{position: relative; padding: 30px 0;border-radius:8px;}#nuandao .siteCount .cover{height: 100%; width: 100%; background: rgba(0, 0, 0, 0.3); position: absolute; top: 0; left: 0;}}
</style>
<script>
//document.getElementById("nuandao").parentNode.parentNode.style.backgroundColor="transparent"
document.getElementById("nuandao").parentNode.parentNode.style.padding=0
</script>
<!--信息统计结束-->
效果预览
效果预览
Mx的小工具
Mx推荐,安全有保障
立即进入
添加教程
只需在站点后台 >>外观
>> 小工具
>> html代码
然后把小工具添加到指定侧边栏中即可。
- 可以用来做侧边栏的广告、领取福利等等。
<a class="ads" href="填写你的链接" target="Mx工具" style="border-radius:5px;"> <h4>Mx的小工具</h4> <h5>Mx推荐,安全有保障</h5> <span class="ads-btn ads-btn-outline">立即进入</span></a> <style> .ads{display:block; padding:40px 15px; text-align:center; color:#fff!important; background:#ff5719; background-image:-webkit-linear-gradient(135deg,#bbafe7,#5368d9); background-image:linear-gradient(135deg,#bbafe7,#5368d9)}.ads h4{margin:0; font-size:22px; font-weight:bold}.ads h5{margin:10px 0 0; font-size:14px; font-weight:bold}.ads.ads-btn{margin-top:20px; font-weight:bold}.ads.ads-btn:hover{color:#ff5719}.ads-btn{display:inline-block; font-weight:normal; margin-top:10px; color:#666; text-align:center; vertical-align:top; user-select:none; border:none; padding:0 36px; line-height:38px; font-size:14px; border-radius:10px; outline:0; -webkit-transition:all 0.3s ease-in-out; -moz-transition:all 0.3s ease-in-out; transition:all 0.3s ease-in-out}.ads-btn:hover,.btn:focus,.btn.focus{outline:0; text-decoration:none}.ads-btn:active,.btn.active{outline:0; box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.ads-btn-outline{line-height:36px; color:#fff; background-color:transparent; border:1px solid#fff}.ads-btn-outline:hover,.btn-outline:focus,.btn-outline.focus{color:#343a3c; background-color:#fff} </style>
<a class="ads" href="填写你的链接" target="Mx工具" style="border-radius:5px;">
<h4>Mx的小工具</h4>
<h5>Mx推荐,安全有保障</h5>
<span class="ads-btn ads-btn-outline">立即进入</span></a>
<style>
.ads{display:block; padding:40px 15px; text-align:center; color:#fff!important; background:#ff5719; background-image:-webkit-linear-gradient(135deg,#bbafe7,#5368d9); background-image:linear-gradient(135deg,#bbafe7,#5368d9)}.ads h4{margin:0; font-size:22px; font-weight:bold}.ads h5{margin:10px 0 0; font-size:14px; font-weight:bold}.ads.ads-btn{margin-top:20px; font-weight:bold}.ads.ads-btn:hover{color:#ff5719}.ads-btn{display:inline-block; font-weight:normal; margin-top:10px; color:#666; text-align:center; vertical-align:top; user-select:none; border:none; padding:0 36px; line-height:38px; font-size:14px; border-radius:10px; outline:0; -webkit-transition:all 0.3s ease-in-out; -moz-transition:all 0.3s ease-in-out; transition:all 0.3s ease-in-out}.ads-btn:hover,.btn:focus,.btn.focus{outline:0; text-decoration:none}.ads-btn:active,.btn.active{outline:0; box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.ads-btn-outline{line-height:36px; color:#fff; background-color:transparent; border:1px solid#fff}.ads-btn-outline:hover,.btn-outline:focus,.btn-outline.focus{color:#343a3c; background-color:#fff}
</style>
- 说明:如果只是使用的话,CSS可无需修改,只需修改文本和跳转的网址即可。不需要圆边的话删除style=”border-radius:5px;”即可。
效果预览
100%
100%
100%
100%
添加教程
- 第一步:创建自定义HTML小工具
- 第二步:把下面的代码添加进去
<style type="text/css"> .time-schedule-main{/*background-color: white;*/border-radius: 8px;display: flex; justify-content: space-evenly; align-items: center;}.today-schedule,.toweek-schedule,.tomonth-schedule,.toyear-schedule{display: inline-block;width: 50px;height: 100px;background-color: white;border: 1px solid #eee;border-radius: 99px;}.wiiuii-schedule-item{position: relative;width: 100%;height: 100%;overflow: hidden;border-radius: 99px;}.today-item,.toweek-item,.tomonth-item,.toyear-item{position: absolute;background-image: linear-gradient(to right, #a18cd1 0%, #fbc2eb 100%);width: 100%;height: 109%;bottom: 0;transition: all 1s;}.schedule-info{display: flex;color: #ff5991;position: absolute;margin: auto;top: 0;left: 0;right: 0;bottom: 0;flex-direction: column;align-items: center;justify-content: center;}.schedule-tilte{font-size: 12px;font-weight: 700;}.time-schedule-main img{background-repeat: no-repeat;max-width:unset !important;max-height:unset !important;width: 200px;height: 10px;top: 0;left: 0;position: absolute;animation: wiiuii_move_wave 2s linear infinite;-webkit-animation: wiiuii_move_wave 2s linear infinite;}@-webkit-keyframes wiiuii_move_wave{0%{-webkit-transform: translateX(0)}50%{-webkit-transform: translateX(-25%)}100%{-webkit-transform: translateX(-50%)}}@keyframes wiiuii_move_wave{0%{transform: translateX(0)}50%{transform: translateX(-25%)}100%{transform: translateX(-50%)}} /* 今日剩余背景颜色 */ .today-item { background-image: linear-gradient(to right, #a18cd1 0%, #fbc2eb 100%); } /* 本周剩余背景颜色 */ .toweek-item { background-image: linear-gradient(to right, #ff9a9e 0%, #fad0c4 100%); } /* 本月剩余背景颜色 */ .tomonth-item { background-image: linear-gradient(to right, #fbc2eb 0%, #a6c1ee 100%); } /* 今年剩余背景颜色 */ .toyear-item { background-image: linear-gradient(to right, #ffecd2 0%, #fcb69f 100%); } </style> <div class="time-schedule-main"> <div class="today-schedule"> <div class="wiiuii-schedule-item"> <div class="today-item"> <img src="https://s4.ax1x.com/2022/02/06/HuOUv6.png"> </div> <div class="schedule-info"> <span class="schedule-tilte">今日剩余</span> <span class="today-num">100%</span> </div> </div> </div> <div class="toweek-schedule"> <div class="wiiuii-schedule-item"> <div class="toweek-item"> <img src="https://s4.ax1x.com/2022/02/06/HuOUv6.png"> </div> <div class="schedule-info"> <span class="schedule-tilte">本周剩余</span> <span class="toweek-num">100%</span> </div> </div> </div> <div class="tomonth-schedule"> <div class="wiiuii-schedule-item"> <div class="tomonth-item"> <img src="https://s4.ax1x.com/2022/02/06/HuOUv6.png"> </div> <div class="schedule-info"> <span class="schedule-tilte">本月剩余</span> <span class="tomonth-num">100%</span> </div> </div> </div> <div class="toyear-schedule"> <div class="wiiuii-schedule-item"> <div class="toyear-item"> <img src="https://s4.ax1x.com/2022/02/06/HuOUv6.png"> </div> <div class="schedule-info"> <span class="schedule-tilte">本年剩余</span> <span class="toyear-num">100%</span> </div> </div> </div> </div> <script type="text/javascript"> eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(t(){$.K({p:t(){h a=u v,e=L*a.M()+q*a.N()+a.O(),c=e/9,b=(3-3*c).5(1);c=(6-6*c).5(2);$(".w-i").j(b+"%");$(".w-k").l("m",c+"%");b=a.P();0===b&&(b=7);c=(e+9*(b-1))/Q;b=(3-3*c).5(1);c=(6-6*c).5(2);$(".x-i").j(b+"%");$(".x-k").l("m",c+"%");b=a.R();c=a.S();a=a.y();h d=(u v(b,c+1,0)).y();d=(e+9*(a-1))/(9*d);h f=(3-3*d).5(1);(6-6*d).5(2);$(".z-i").j(f+"%");$(".z-k").l("m",f+"%");d=0;f=[8,0==b%4&&0!=b%3||0==b%A?T:U,8,o,8,o,8,8,o,8,o,8];V(h g=0;g<c;g++)d+=f[g];a=(e+9*(d+a-1))/(9*(0==b%4&&0!=b%3||0==b%A?W:X));e=(3-3*a).5(1);a=(6-6*a).5(2);$(".B-i").j(e+"%");$(".B-k").l("m",a+"%")}});$.p();Y($.p,Z);10.11("\\n %c \\12\\13\\14\\C\\15\\16[\\17\\18\\19\\1a\\C\\1b\\1c] - 1d://1e.1f.1g","1h:#1i; 1j: 1k-1l(1m, #D 0%, #D E%, #F r(E% + s), #F q%, #G r(q% + s), #G H%, #I r(H% + s), #I 3%);1n:J; 1o-1p: J;")});',62,88,'|||100||toFixed|109||31|86400||||||||var|num|text|item|css|height||30|wiiuiiSchedule|60|calc|1px|function|new|Date|today|toweek|getDate|tomonth|400|toyear|u5c0f|212121|40|323232|008F95|70|14FFEC|5px|extend|3600|getHours|getMinutes|getSeconds|getDay|604800|getFullYear|getMonth|29|28|for|366|365|setInterval|2E3|console|log|u661f|u8bed|u7684|u6728|u5c4b|u65f6|u95f4|u8fdb|u5ea6|u5de5|u5177|https|www|wiiuii|cn|color|fff|background|linear|gradient|55deg|padding|border|radius'.split('|'),0,{})) </script>
<style type="text/css">
.time-schedule-main{/*background-color: white;*/border-radius: 8px;display: flex; justify-content: space-evenly; align-items: center;}.today-schedule,.toweek-schedule,.tomonth-schedule,.toyear-schedule{display: inline-block;width: 50px;height: 100px;background-color: white;border: 1px solid #eee;border-radius: 99px;}.wiiuii-schedule-item{position: relative;width: 100%;height: 100%;overflow: hidden;border-radius: 99px;}.today-item,.toweek-item,.tomonth-item,.toyear-item{position: absolute;background-image: linear-gradient(to right, #a18cd1 0%, #fbc2eb 100%);width: 100%;height: 109%;bottom: 0;transition: all 1s;}.schedule-info{display: flex;color: #ff5991;position: absolute;margin: auto;top: 0;left: 0;right: 0;bottom: 0;flex-direction: column;align-items: center;justify-content: center;}.schedule-tilte{font-size: 12px;font-weight: 700;}.time-schedule-main img{background-repeat: no-repeat;max-width:unset !important;max-height:unset !important;width: 200px;height: 10px;top: 0;left: 0;position: absolute;animation: wiiuii_move_wave 2s linear infinite;-webkit-animation: wiiuii_move_wave 2s linear infinite;}@-webkit-keyframes wiiuii_move_wave{0%{-webkit-transform: translateX(0)}50%{-webkit-transform: translateX(-25%)}100%{-webkit-transform: translateX(-50%)}}@keyframes wiiuii_move_wave{0%{transform: translateX(0)}50%{transform: translateX(-25%)}100%{transform: translateX(-50%)}}
/* 今日剩余背景颜色 */
.today-item {
background-image: linear-gradient(to right, #a18cd1 0%, #fbc2eb 100%);
}
/* 本周剩余背景颜色 */
.toweek-item {
background-image: linear-gradient(to right, #ff9a9e 0%, #fad0c4 100%);
}
/* 本月剩余背景颜色 */
.tomonth-item {
background-image: linear-gradient(to right, #fbc2eb 0%, #a6c1ee 100%);
}
/* 今年剩余背景颜色 */
.toyear-item {
background-image: linear-gradient(to right, #ffecd2 0%, #fcb69f 100%);
}
</style>
<div class="time-schedule-main">
<div class="today-schedule">
<div class="wiiuii-schedule-item">
<div class="today-item">
<img src="https://s4.ax1x.com/2022/02/06/HuOUv6.png">
</div>
<div class="schedule-info">
<span class="schedule-tilte">今日剩余</span>
<span class="today-num">100%</span>
</div>
</div>
</div>
<div class="toweek-schedule">
<div class="wiiuii-schedule-item">
<div class="toweek-item">
<img src="https://s4.ax1x.com/2022/02/06/HuOUv6.png">
</div>
<div class="schedule-info">
<span class="schedule-tilte">本周剩余</span>
<span class="toweek-num">100%</span>
</div>
</div>
</div>
<div class="tomonth-schedule">
<div class="wiiuii-schedule-item">
<div class="tomonth-item">
<img src="https://s4.ax1x.com/2022/02/06/HuOUv6.png">
</div>
<div class="schedule-info">
<span class="schedule-tilte">本月剩余</span>
<span class="tomonth-num">100%</span>
</div>
</div>
</div>
<div class="toyear-schedule">
<div class="wiiuii-schedule-item">
<div class="toyear-item">
<img src="https://s4.ax1x.com/2022/02/06/HuOUv6.png">
</div>
<div class="schedule-info">
<span class="schedule-tilte">本年剩余</span>
<span class="toyear-num">100%</span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(t(){$.K({p:t(){h a=u v,e=L*a.M()+q*a.N()+a.O(),c=e/9,b=(3-3*c).5(1);c=(6-6*c).5(2);$(".w-i").j(b+"%");$(".w-k").l("m",c+"%");b=a.P();0===b&&(b=7);c=(e+9*(b-1))/Q;b=(3-3*c).5(1);c=(6-6*c).5(2);$(".x-i").j(b+"%");$(".x-k").l("m",c+"%");b=a.R();c=a.S();a=a.y();h d=(u v(b,c+1,0)).y();d=(e+9*(a-1))/(9*d);h f=(3-3*d).5(1);(6-6*d).5(2);$(".z-i").j(f+"%");$(".z-k").l("m",f+"%");d=0;f=[8,0==b%4&&0!=b%3||0==b%A?T:U,8,o,8,o,8,8,o,8,o,8];V(h g=0;g<c;g++)d+=f[g];a=(e+9*(d+a-1))/(9*(0==b%4&&0!=b%3||0==b%A?W:X));e=(3-3*a).5(1);a=(6-6*a).5(2);$(".B-i").j(e+"%");$(".B-k").l("m",a+"%")}});$.p();Y($.p,Z);10.11("\\n %c \\12\\13\\14\\C\\15\\16[\\17\\18\\19\\1a\\C\\1b\\1c] - 1d://1e.1f.1g","1h:#1i; 1j: 1k-1l(1m, #D 0%, #D E%, #F r(E% + s), #F q%, #G r(q% + s), #G H%, #I r(H% + s), #I 3%);1n:J; 1o-1p: J;")});',62,88,'|||100||toFixed|109||31|86400||||||||var|num|text|item|css|height||30|wiiuiiSchedule|60|calc|1px|function|new|Date|today|toweek|getDate|tomonth|400|toyear|u5c0f|212121|40|323232|008F95|70|14FFEC|5px|extend|3600|getHours|getMinutes|getSeconds|getDay|604800|getFullYear|getMonth|29|28|for|366|365|setInterval|2E3|console|log|u661f|u8bed|u7684|u6728|u5c4b|u65f6|u95f4|u8fdb|u5ea6|u5de5|u5177|https|www|wiiuii|cn|color|fff|background|linear|gradient|55deg|padding|border|radius'.split('|'),0,{}))
</script>
效果预览
2021
2020
添加教程
- 代码添加到自定义HTML
<html> <head> <style type="text/css"> .point-time { content: ""; position: absolute; width: 13px; height: 13px; top: 17px; left: 20%; background: #1c87bf; margin-left: -4px; border-radius: 50%; box-shadow: 0 0 0 5px #fff; } .text-red { color: #f6393f; } .text-blue { color: #1c87bf; } .text-green { color: #95c91e; } .text-yellow { color: #ffb902; } .text-purple { color: #d32d93; } .point-red { background-color: #f6393f; } .point-blue { background-color: #1c87bf; } .point-green { background-color: #95c91e; } .point-yellow { background-color: #ffb902; } .point-purple { background-color: #d32d93; } .content article { position: relative; } .content article > h3 { width: 15%; height: 20px; line-height: 20px; text-align: right; font-size: 1.4em; color: #1d1d1d; padding: 10px 0 20px; } .content article section { padding: 0 0 17px; position: relative; } .content article section:before { content: ""; width: 5px; top: 17px; bottom: -17px; left: 20%; background: #e6e6e6; position: absolute; } .content article section:last-child:before { display: none; } .content article section time { width: 15%; display: block; position: absolute; } .content article section time > span { display: block; text-align: right; } .content article section aside { color: #3a3a38; margin-left: 25%; padding-bottom: 15px; } .content article section .brief { color: #9f9f9f; } </style> </head> <body> <div class="content"> <article> <h3><span class="text-yellow">2021</span></h3> <section> <span class="point-time point-yellow"></span> <time datetime="2021-04"> <span>4月05号</span> </time> <aside> <p class="things"><span class="text-yellow">哈哈哈</span></p> <p class="brief"><span class="text-green">Mx博客</span></p> </aside> </section> <section> <span class="point-time point-yellow"></span> <time datetime="2021-03"> <span>3月24号</span> </time> <aside> <p class="things"><span class="text-yellow">嘿嘿</span></p> <p class="brief"><span class="text-green">Mx博客</span></p> </aside> </section> <section> <span class="point-time point-yellow"></span> <time datetime="2021-02"> <span>2月24号</span> </time> <aside> <p class="things"><span class="text-yellow">嘻嘻</span></p> <p class="brief"><span class="text-green">Mx博客</span></p> </aside> </section> <section> <span class="point-time point-yellow"></span> <time datetime="2021-02"> <span>2月10号</span> </time> <aside> <p class="things"><span class="text-yellow">哈哈</span></p> <p class="brief"><span class="text-green">Mx博客</span></p> </aside> </section> </article> <!--分隔符--> <article> <h3><span class="text-green">2020</span></h3> <section> <span class="point-time point-green"></span> <time datetime="2020-10"> <span>10月14号</span> </time> <aside> <p class="things"><span class="text-green">高兴</span></p> <p class="brief"><span class="text-yellow">Mx博客</span></p> </aside> </section> <section> <span class="point-time point-green"></span> <time datetime="2020-09"> <span>9月03号</span> </time> <aside> <p class="things"><span class="text-green">快乐</span></p> <p class="brief"><span class="text-yellow">Mx博客</span></p> </aside> </section> <section> <span class="point-time point-green"></span> <time datetime="2020-09"> <span>9月03号</span> </time> <aside> <p class="things"><span class="text-green">开心</span></p> <p class="brief"><span class="text-yellow">Mx博客</span></p> </aside> </section> </div> </body> </html>
<html>
<head>
<style type="text/css">
.point-time {
content: "";
position: absolute;
width: 13px;
height: 13px;
top: 17px;
left: 20%;
background: #1c87bf;
margin-left: -4px;
border-radius: 50%;
box-shadow: 0 0 0 5px #fff;
}
.text-red {
color: #f6393f;
}
.text-blue {
color: #1c87bf;
}
.text-green {
color: #95c91e;
}
.text-yellow {
color: #ffb902;
}
.text-purple {
color: #d32d93;
}
.point-red {
background-color: #f6393f;
}
.point-blue {
background-color: #1c87bf;
}
.point-green {
background-color: #95c91e;
}
.point-yellow {
background-color: #ffb902;
}
.point-purple {
background-color: #d32d93;
}
.content article {
position: relative;
}
.content article > h3 {
width: 15%;
height: 20px;
line-height: 20px;
text-align: right;
font-size: 1.4em;
color: #1d1d1d;
padding: 10px 0 20px;
}
.content article section {
padding: 0 0 17px;
position: relative;
}
.content article section:before {
content: "";
width: 5px;
top: 17px;
bottom: -17px;
left: 20%;
background: #e6e6e6;
position: absolute;
}
.content article section:last-child:before {
display: none;
}
.content article section time {
width: 15%;
display: block;
position: absolute;
}
.content article section time > span {
display: block;
text-align: right;
}
.content article section aside {
color: #3a3a38;
margin-left: 25%;
padding-bottom: 15px;
}
.content article section .brief {
color: #9f9f9f;
}
</style>
</head>
<body>
<div class="content">
<article>
<h3><span class="text-yellow">2021</span></h3>
<section>
<span class="point-time point-yellow"></span>
<time datetime="2021-04">
<span>4月05号</span>
</time>
<aside>
<p class="things"><span class="text-yellow">哈哈哈</span></p>
<p class="brief"><span class="text-green">Mx博客</span></p>
</aside>
</section>
<section>
<span class="point-time point-yellow"></span>
<time datetime="2021-03">
<span>3月24号</span>
</time>
<aside>
<p class="things"><span class="text-yellow">嘿嘿</span></p>
<p class="brief"><span class="text-green">Mx博客</span></p>
</aside>
</section>
<section>
<span class="point-time point-yellow"></span>
<time datetime="2021-02">
<span>2月24号</span>
</time>
<aside>
<p class="things"><span class="text-yellow">嘻嘻</span></p>
<p class="brief"><span class="text-green">Mx博客</span></p>
</aside>
</section>
<section>
<span class="point-time point-yellow"></span>
<time datetime="2021-02">
<span>2月10号</span>
</time>
<aside>
<p class="things"><span class="text-yellow">哈哈</span></p>
<p class="brief"><span class="text-green">Mx博客</span></p>
</aside>
</section>
</article>
<!--分隔符-->
<article>
<h3><span class="text-green">2020</span></h3>
<section>
<span class="point-time point-green"></span>
<time datetime="2020-10">
<span>10月14号</span>
</time>
<aside>
<p class="things"><span class="text-green">高兴</span></p>
<p class="brief"><span class="text-yellow">Mx博客</span></p>
</aside>
</section>
<section>
<span class="point-time point-green"></span>
<time datetime="2020-09">
<span>9月03号</span>
</time>
<aside>
<p class="things"><span class="text-green">快乐</span></p>
<p class="brief"><span class="text-yellow">Mx博客</span></p>
</aside>
</section>
<section>
<span class="point-time point-green"></span>
<time datetime="2020-09">
<span>9月03号</span>
</time>
<aside>
<p class="things"><span class="text-green">开心</span></p>
<p class="brief"><span class="text-yellow">Mx博客</span></p>
</aside>
</section>
</div>
</body>
</html>
效果预览
添加教程
- 在主题设置—》自定义CSS样式,添加下面的CSS代码:
- 说明:图片可以直接用自带也可以自己保存,图片大小(162 X 75的图片)。
/*<a href="https://mx142.github.io/img/comment/comment.webp"><b style="color:#0388d1">评论</b></a>背景图*/ textarea#comment {background-color:transparent;background:linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)),url(改成你的背景图链接) right 10px bottom 10px no-repeat;-moz-transition:ease-in-out 0.45s;-webkit-transition:ease-in-out 0.45s;-o-transition:ease-in-out 0.45s;-ms-transition:ease-in-out 0.45s;transition:ease-in-out 0.45s;} textarea#comment:focus {background-position-y:789px;-moz-transition:ease-in-out 0.45s;-webkit-transition:ease-in-out 0.45s;-o-transition:ease-in-out 0.45s;-ms-transition:ease-in-out 0.45s;transition:ease-in-out 0.45s;}
/*<a href="https://mx142.github.io/img/comment/comment.webp"><b style="color:#0388d1">评论</b></a>背景图*/
textarea#comment {background-color:transparent;background:linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)),url(改成你的背景图链接) right 10px bottom 10px no-repeat;-moz-transition:ease-in-out 0.45s;-webkit-transition:ease-in-out 0.45s;-o-transition:ease-in-out 0.45s;-ms-transition:ease-in-out 0.45s;transition:ease-in-out 0.45s;}
textarea#comment:focus {background-position-y:789px;-moz-transition:ease-in-out 0.45s;-webkit-transition:ease-in-out 0.45s;-o-transition:ease-in-out 0.45s;-ms-transition:ease-in-out 0.45s;transition:ease-in-out 0.45s;}
添加教程
- 将以下代码添加到主题文件CSS样式即可。
@font-face{ font-family: 'zti'; src: url('文件直链.tff'); src: url('文件直链.eot'); src: url('文件直链.svg'); src: url('文件直链.woff'); src: url('文件直链.woff2'); } body{ font-family:'zti'; }
@font-face{
font-family: 'zti';
src: url('文件直链.tff');
src: url('文件直链.eot');
src: url('文件直链.svg');
src: url('文件直链.woff');
src: url('文件直链.woff2');
}
body{
font-family:'zti';
}
效果预览
- 图片效果
- 纯色效果
添加教程
- 图片教程
- 把下面背景图代码放到主题下的css里面,是子比主题就放到后台的css里面就可以,把下面代码的图片链接改成你需要的背景图或者用自带的背景图
/***日间主题模式***/ body { background-image: url("https://mx142.github.io/img/backdropic/backdropic.webp");/**这里改为你自己的图片地址**/ background-position-x: center; background-position-y: center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; } /***夜间主题模式***/ .dark-theme { background-position-x: center; background-position-y: center; background-repeat: no-repeat; background-attachment: fixed; background-image: url("https://mx142.github.io/img/backdropic/backdropic.webp");/**这里改为你自己的图片地址**/ background-size: cover; }
/***日间主题模式***/
body {
background-image: url("https://mx142.github.io/img/backdropic/backdropic.webp");/**这里改为你自己的图片地址**/
background-position-x: center;
background-position-y: center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
/***夜间主题模式***/
.dark-theme {
background-position-x: center;
background-position-y: center;
background-repeat: no-repeat;
background-attachment: fixed;
background-image: url("https://mx142.github.io/img/backdropic/backdropic.webp");/**这里改为你自己的图片地址**/
background-size: cover;
}
- 纯色教程
- 把下面背景图代码放到主题下的css里面,是子比主题就放到后台的css里面就可以了,把下面代码的颜色改成你需要的就行了。
/*背景色*/body {background: -webkit-linear-gradient(0deg,#ffdee9c4 0%,#b5fffc8f 100%); background-color: #FFDEE9;}
/*背景色*/body {background: -webkit-linear-gradient(0deg,#ffdee9c4 0%,#b5fffc8f 100%); background-color: #FFDEE9;}
效果预览
添加教程
- 把以下代码添加到自定义HTML
<div id="chakhsu"></div> <script> var chakhsu = function (r) { function t() { return b[Math.floor(Math.random() * b.length)] } function e() { return String.fromCharCode(94 * Math.random() + 33) } function n(r) { for (var n = document.createDocumentFragment(), i = 0; r > i; i++) { var l = document.createElement("span"); l.textContent = e(), l.style.color = t(), n.appendChild(l) } return n } function i() { var t = o[c.skillI]; c.step ? c.step-- : (c.step = g, c.prefixP < l.length ? (c.prefixP >= 0 && (c.text += l[c.prefixP]), c.prefixP++) : "forward" === c.direction ? c.skillP < t.length ? (c.text += t[c.skillP], c.skillP++) : c.delay ? c.delay-- : (c.direction = "backward", c.delay = a) : c.skillP > 0 ? (c.text = c.text.slice(0, -1), c.skillP--) : (c.skillI = (c.skillI + 1) % o.length, c.direction = "forward")), r.textContent = c.text, r.appendChild(n(c.prefixP < l.length ? Math.min(s, s + c.prefixP) : Math.min(s, t.length - c.skillP))), setTimeout(i, d) } /*以下内容自定义修改*/ var l = "Mx博客,", o = ["www.wwru.cn", ].map(function (r) { return r + "" }), a = 2, g = 1, s = 5, d = 75, b = ["rgb(110,64,170)", "rgb(150,61,179)", "rgb(191,60,175)", "rgb(228,65,157)", "rgb(254,75,131)", "rgb(255,94,99)", "rgb(255,120,71)", "rgb(251,150,51)", "rgb(226,183,47)", "rgb(198,214,60)", "rgb(175,240,91)", "rgb(127,246,88)", "rgb(82,246,103)", "rgb(48,239,130)", "rgb(29,223,163)", "rgb(26,199,194)", "rgb(35,171,216)", "rgb(54,140,225)", "rgb(76,110,219)", "rgb(96,84,200)"], c = {text: "", prefixP: -s, skillI: 0, skillP: 0, direction: "forward", delay: a, step: g}; i() }; chakhsu(document.getElementById('chakhsu')); </script> <div>
<div id="chakhsu"></div>
<script>
var chakhsu = function (r) {
function t() {
return b[Math.floor(Math.random() * b.length)]
}
function e() {
return String.fromCharCode(94 * Math.random() + 33)
}
function n(r) {
for (var n = document.createDocumentFragment(), i = 0; r > i; i++) {
var l = document.createElement("span");
l.textContent = e(), l.style.color = t(), n.appendChild(l)
}
return n
}
function i() {
var t = o[c.skillI];
c.step ? c.step-- : (c.step = g, c.prefixP < l.length ? (c.prefixP >= 0 && (c.text += l[c.prefixP]), c.prefixP++) : "forward" === c.direction ? c.skillP < t.length ? (c.text += t[c.skillP], c.skillP++) : c.delay ? c.delay-- : (c.direction = "backward", c.delay = a) : c.skillP > 0 ? (c.text = c.text.slice(0, -1), c.skillP--) : (c.skillI = (c.skillI + 1) % o.length, c.direction = "forward")), r.textContent = c.text, r.appendChild(n(c.prefixP < l.length ? Math.min(s, s + c.prefixP) : Math.min(s, t.length - c.skillP))), setTimeout(i, d)
}
/*以下内容自定义修改*/
var l = "Mx博客,",
o = ["www.wwru.cn", ].map(function (r) {
return r + ""
}), a = 2, g = 1, s = 5, d = 75,
b = ["rgb(110,64,170)", "rgb(150,61,179)", "rgb(191,60,175)", "rgb(228,65,157)", "rgb(254,75,131)", "rgb(255,94,99)", "rgb(255,120,71)", "rgb(251,150,51)", "rgb(226,183,47)", "rgb(198,214,60)", "rgb(175,240,91)", "rgb(127,246,88)", "rgb(82,246,103)", "rgb(48,239,130)", "rgb(29,223,163)", "rgb(26,199,194)", "rgb(35,171,216)", "rgb(54,140,225)", "rgb(76,110,219)", "rgb(96,84,200)"],
c = {text: "", prefixP: -s, skillI: 0, skillP: 0, direction: "forward", delay: a, step: g};
i()
};
chakhsu(document.getElementById('chakhsu'));
</script>
<div>
效果预览
本站勉强运行: 1271天20小时42分42秒
添加教程
- 把以下代码添加到自定义HTML
<span id="runtime_span"></span> <script type="text/javascript">function show_runtime(){window.setTimeout("show_runtime()",1000);X=new Date("09/30/2020 15:10:00"); Y=new Date();T=(Y.getTime()-X.getTime());M=24*60*60*1000; a=T/M;A=Math.floor(a);b=(a-A)*24;B=Math.floor(b);c=(b-B)*60;C=Math.floor((b-B)*60);D=Math.floor((c-C)*60); runtime_span.innerHTML="本站勉强运行: "+A+"天"+B+"小时"+C+"分"+D+"秒"}show_runtime();</script>
<span id="runtime_span"></span>
<script type="text/javascript">function show_runtime(){window.setTimeout("show_runtime()",1000);X=new
Date("09/30/2020 15:10:00");
Y=new Date();T=(Y.getTime()-X.getTime());M=24*60*60*1000;
a=T/M;A=Math.floor(a);b=(a-A)*24;B=Math.floor(b);c=(b-B)*60;C=Math.floor((b-B)*60);D=Math.floor((c-C)*60);
runtime_span.innerHTML="本站勉强运行: "+A+"天"+B+"小时"+C+"分"+D+"秒"}show_runtime();</script>
效果预览
添加教程
- 将以下CSS代码放置子比主题设置->全局&功能->自定义CSS样式中即可
/* *复制提取码功能 */ .but-download .badg { position: relative; cursor:pointer; } .but-download .badg::after { position: absolute; content: " "; width: 0; height: 0; top: -11px; left: 50%; -webkit-transform: translateX(-50%); -moz-transform: translateX(-50%); -ms-transform: translateX(-50%); -o-transform: translateX(-50%); transform: translateX(-50%); border-top: 10px solid rgb(236, 235, 235); border-left: 5px solid transparent; border-right: 5px solid transparent; -webkit-transition: .3s; -o-transition: .3s; -moz-transition: .3s; transition: .3s; opacity: 0; } .but-download .badg::before { content: attr(data-before); position: absolute; width: 100px; height: 31px; top: -40px; left: 50%; -webkit-transform: translateX(-50%); -moz-transform: translateX(-50%); -ms-transform: translateX(-50%); -o-transform: translateX(-50%); transform: translateX(-50%); font-size: 14px; line-height: 31px; border-radius: 4px; color: #6c6a6a; background-color: rgb(236, 235, 235); text-align: center; -webkit-transition: .3s; -o-transition: .3s; -moz-transition: .3s; transition: .3s; opacity: 0; } .but-download .badg:hover::after, .but-download .badg:hover::before { opacity: 1; }
/*
*复制提取码功能
*/
.but-download .badg {
position: relative;
cursor:pointer;
}
.but-download .badg::after {
position: absolute;
content: " ";
width: 0;
height: 0;
top: -11px;
left: 50%;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
transform: translateX(-50%);
border-top: 10px solid rgb(236, 235, 235);
border-left: 5px solid transparent;
border-right: 5px solid transparent;
-webkit-transition: .3s;
-o-transition: .3s;
-moz-transition: .3s;
transition: .3s;
opacity: 0;
}
.but-download .badg::before {
content: attr(data-before);
position: absolute;
width: 100px;
height: 31px;
top: -40px;
left: 50%;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
transform: translateX(-50%);
font-size: 14px;
line-height: 31px;
border-radius: 4px;
color: #6c6a6a;
background-color: rgb(236, 235, 235);
text-align: center;
-webkit-transition: .3s;
-o-transition: .3s;
-moz-transition: .3s;
transition: .3s;
opacity: 0;
}
.but-download .badg:hover::after,
.but-download .badg:hover::before {
opacity: 1;
}
- 将以下JavaScript代码放置子比主题设置->全局&功能->自定义javascript代码中即可
/* *复制提取码功能 */ if(document.querySelectorAll(".but-download .badg")!=undefined){ const reg = /[a-zA-z0-9]/ig; const copy1 = document.querySelectorAll(".but-download .badg"); for (let i = 0; i < copy1.length; i++) { copy1[i].index = i; copy1[i].setAttribute("data-before", "点击复制"); copy1[i].addEventListener("click", copyOperation); copy1[i].addEventListener("mouseout", copyOk); } function copyOperation() { var oInput = document.createElement("input"); let text = this.innerText; text = text.match(reg).join(""); oInput.value = text; document.body.appendChild(oInput); oInput.select(); document.execCommand("Copy"); oInput.className = "oInput"; oInput.style.display = "none"; this.setAttribute("data-before", "已复制"); } function copyOk() { setTimeout(() => { this.setAttribute("data-before", "点击复制"); }, 300) } }
/*
*复制提取码功能
*/
if(document.querySelectorAll(".but-download .badg")!=undefined){
const reg = /[a-zA-z0-9]/ig;
const copy1 = document.querySelectorAll(".but-download .badg");
for (let i = 0; i < copy1.length; i++) {
copy1[i].index = i;
copy1[i].setAttribute("data-before", "点击复制");
copy1[i].addEventListener("click", copyOperation);
copy1[i].addEventListener("mouseout", copyOk);
}
function copyOperation() {
var oInput = document.createElement("input");
let text = this.innerText;
text = text.match(reg).join("");
oInput.value = text;
document.body.appendChild(oInput);
oInput.select();
document.execCommand("Copy");
oInput.className = "oInput";
oInput.style.display = "none";
this.setAttribute("data-before", "已复制");
}
function copyOk() {
setTimeout(() => {
this.setAttribute("data-before", "点击复制");
}, 300)
}
}
效果预览
欢迎来到Mx's Blog——专注于网络方面的学习知识分享!
添加教程
- 网站后台—>外观—>小工具—>自定义HTML,然后添加到合适位置即可。
<!--跑马灯公告--> <style> #nr{font-size:20px; margin: 0; background: -webkit-linear-gradient(left, #ffffff, #ff0000 6.25%, #ff7d00 12.5%, #ffff00 18.75%, #00ff00 25%, #00ffff 31.25%, #0000ff 37.5%, #ff00ff 43.75%, #ffff00 50%, #ff0000 56.25%, #ff7d00 62.5%, #ffff00 68.75%, #00ff00 75%, #00ffff 81.25%, #0000ff 87.5%, #ff00ff 93.75%, #ffff00 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-size: 200% 100%; animation: masked-animation 2s infinite linear;} @keyframes masked-animation{0%{background-position: 0 0;} 100%{background-position: -100%, 0;} } </style> <div style="background-color:#333;border-radius:25px;box-shadow:0px 0px 5px #f200ff;padding:5px;margin-bottom:0px;"> <marquee> <b id="nr">欢迎来到Mx's Blog——专注于网络方面的学习知识分享!</b> </marquee> </div>
<!--跑马灯公告-->
<style>
#nr{font-size:20px; margin: 0; background: -webkit-linear-gradient(left, #ffffff, #ff0000 6.25%, #ff7d00 12.5%, #ffff00 18.75%, #00ff00 25%, #00ffff 31.25%, #0000ff 37.5%, #ff00ff 43.75%, #ffff00 50%, #ff0000 56.25%, #ff7d00 62.5%, #ffff00 68.75%, #00ff00 75%, #00ffff 81.25%, #0000ff 87.5%, #ff00ff 93.75%, #ffff00 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-size: 200% 100%; animation: masked-animation 2s infinite linear;} @keyframes masked-animation{0%{background-position: 0 0;} 100%{background-position: -100%, 0;} }
</style>
<div style="background-color:#333;border-radius:25px;box-shadow:0px 0px 5px #f200ff;padding:5px;margin-bottom:0px;">
<marquee>
<b id="nr">欢迎来到Mx's Blog——专注于网络方面的学习知识分享!</b> </marquee>
</div>
添加教程
- CSS代码:
/*进度条加载显示*/ #percentageCounter{position:fixed; left:0; top:0; height:3px; z-index:99999; background-image: linear-gradient(to right, #339933,#FF6666);border-radius:5px;}
/*进度条加载显示*/
#percentageCounter{position:fixed; left:0; top:0; height:3px; z-index:99999; background-image: linear-gradient(to right, #339933,#FF6666);border-radius:5px;}
- javascript代码:
//进度条加载显示 $(window).scroll(function() { var a = $(window).scrollTop(), c = $(document).height(), b = $(window).height(); scrollPercent = a / (c - b) * 100; scrollPercent = scrollPercent.toFixed(1); $("#percentageCounter").css({ width: scrollPercent + "%" }); }).trigger("scroll");
//进度条加载显示
$(window).scroll(function() {
var a = $(window).scrollTop(),
c = $(document).height(),
b = $(window).height();
scrollPercent = a / (c - b) * 100;
scrollPercent = scrollPercent.toFixed(1);
$("#percentageCounter").css({
width: scrollPercent + "%"
});
}).trigger("scroll");
- 在主题目录header.php中,添加以下代码,放在body标签下(最后一行)
<div id="percentageCounter"></div>
<div id="percentageCounter"></div>
效果预览
添加教程
- 注意:回到顶部悬挂猫咪只能电脑端显示,需要手机端显示,自己修改CSS代码。
- 1、保存回到顶部悬挂猫咪的JS+CSS
- CSS代码