📢:岁月的年轮,碾过一年的疲惫。生活的空白,期待填充的色彩。辞旧迎新,翻过时间折皱。痴迷往返,满怀新年憧憬。一声祝福,一曲心语,愿你幸福平安。
Ad

[joe主题]给你的joe主题添加一个自定义设置

Ashores
2023-07-17 / 1评论 / 122 阅读
温馨提示:
本文最后更新于2023年07月17日,已超过306天没有更新,若内容或图片失效,请留言反馈。
scimg Ad



目录
  • 创建custom.php文件
  • 引入custom.php文件
  • 添加后台显示自定义设置代码

创建custom.php

登录自己的宝塔面板,找到自己的网站目录:usr/themes/Joe/public/,找到public文件夹后点击创建空白文件,名称为: custom.php ,创建好之后我们还要打开创建好的这个文件,在里面添加一个 <?php ?> php代码的头部引用,就像这样:

lk66f10o.png

弄完后保存即可,然后我们进行下一步.


引入custom.php文件

完成第一步之后我回到joe主题的根目录找到: functions.php 这个php文件,进去之后,在这个文件的末尾添加引入custom.php的代码:

放置引入代码完成后我们进行下一步操作.


添加后台显示 自定义设置 代码

将下列代码也是放在joe主题的functions.php文件里面,具体位置就是下面图中显示的样子:

添加完成之后,还要在usr/themes/Joe/assets/css和js中分别创建custom.min.css和custom.min.js


custom.min.css代码如下:

html{--reading: #faf9de}html[data-night=night] body{--reading: #424242}html[data-night=night] body::before{filter:brightness(0.2)}html[data-night=night] body img:not(.owo_image,.shang,.user_logo),html[data-night=night] body .joe_detail__leaving-list .item,html[data-night=night] body .js_ad,html[data-night=night] body .a-js-ad,html[data-night=night] body .joe_detail__friends-item{filter:brightness(0.6)}html .joe_header__above-logo{overflow:hidden}html .joe_header__above-logo::before{content:"";position:absolute;top:-50px;left:-15px;width:250px;height:25px;background-image:linear-gradient(rgba(255, 255, 255, 0), var(--background));opacity:.8;transform:rotate(-45deg);-webkit-animation:flashlights 1s ease-in 1s infinite;animation:flashlights 1.5s ease-in 1s infinite}@-webkit-keyframes flashlights{0%{left:-100px;top:0}to{left:120px;top:100px}}@keyframes flashlights{0%{left:-100px;top:0}to{left:120px;top:100px}}@media(max-width: 1200px){.joe_header__above-search{display:none}.joe_header__above-searchicon{display:block}.joe_header__below-sign .joe_dropdown__link span{display:none}}.js_ad{margin-top:10px;position:relative;border-radius:var(--radius-wrap);box-shadow:var(--box-shadow);overflow:hidden;height:120px}@media(max-width: 768px){.js_ad{height:100px}}.Reward{text-align:center;margin-left:30px;color:var(--minor);font-size:12px}.Reward .footer_flex{width:42px;height:42px;background-color:#f56c6c;border-radius:50%;position:relative;z-index:10;display:flex;justify-content:center;align-items:center;margin-bottom:8px}.Reward .footer_flex:hover{background-color:var(--theme);cursor:pointer}.Reward .footer_flex:hover .flex_rows{display:block}.Reward .footer_flex .flex_rows{box-shadow:0px 1px 4px 2px var(--theme);cursor:auto;height:200px;width:170px;position:absolute;top:-215px;background:var(--background);display:none;border-radius:8px}.Reward .footer_flex .flex_rows::after{content:"";position:absolute;bottom:-16px;left:0;right:0;margin:auto;width:0px;border:18px solid transparent;border-bottom:none;border-top-color:var(--background);filter:drop-shadow(0px 4px 2px var(--theme))}.Reward .footer_flex .flex_rows .flex-footer{overflow:hidden;margin:10px;position:relative;width:150px;height:180px}.Reward .footer_flex .flex_rows .flex-footer .RewardImg{width:900px;position:absolute;left:0}.Reward .footer_flex .flex_rows .flex-footer .RewardImg li{float:left;overflow:hidden}.Reward .footer_flex .flex_rows .flex-footer .RewardImg li img{width:150px;border-radius:2px}.Reward .footer_flex .flex_rows .flex-footer .RewardBtn{display:inline-flex;border-radius:5px;position:absolute;border:1px solid var(--classC);bottom:0px;left:0}.Reward .footer_flex .flex_rows .flex-footer .RewardBtn li:nth-of-type(n + 2){border-left:1px solid var(--classC)}.Reward .footer_flex .flex_rows .flex-footer .RewardBtn li div{height:20px;font-size:12px;color:var(--routine);padding:2px;border-radius:2px}.Reward .footer_flex .flex_rows .flex-footer .RewardBtn li:hover{cursor:pointer}.imgUpload_btn{margin:-10px auto 5px;text-align:right}.imgUpload_btn span{cursor:pointer;margin-right:5px}.top-social{position:relative;padding-top:10px;display:flex;flex-wrap:wrap;justify-content:space-around}.top-social li{width:50px;text-align:center;position:relative;height:32px}.top-social li a{height:100%}.top-social li div{height:100%}.top-social li img{height:100%}.top-social li .WeChatInner{display:none;position:absolute;box-shadow:0px 1px 4px 2px var(--theme);border-radius:var(--radius-wrap);transition:.7s all ease;background:var(--background);-webkit-transition:.7s all ease;top:-180px;left:-50px;transform:translate3d(0, 16px, 0);width:150px;height:150px;z-index:20}.top-social li .WeChatInner::before{content:"";position:absolute;bottom:-16px;left:0;right:0;margin:auto;display:inline-block;width:0px;border:18px solid transparent;border-bottom:none;border-top-color:var(--background);filter:drop-shadow(0px 4px 2px var(--theme))}.top-social li .WeChatInner img{border-radius:2px;width:140px;height:auto;margin:5px;background:none}.top-social li:hover .WeChatInner{display:block}.pe-social{width:100%;background:var(--background);border-radius:var(--radius-wrap);padding:10px 15px;box-shadow:var(--box-shadow);margin-bottom:15px}.joe_comment__respond-form .body .text{background:var(--background);border-radius:var(--radius-inner);padding:5px}.joe_comment__respond-form .foot{justify-content:flex-start}.joe_comment__respond-form .foot .joe_owo__contain{position:static}.joe_comment__respond-form .foot .joe_owo__contain .box{position:absolute;bottom:100%;margin-bottom:6px;left:0px;padding-top:5px;border:1px solid rgba(0,0,0,.15);border-color:transparent;box-shadow:0 0 10px 8px rgba(116,116,116,.08)}.joe_comment__respond-form .foot .comment_box{cursor:pointer;text-align:center;color:var(--routine);height:26px;line-height:26px;background:var(--background);opacity:.85;border-radius:13px;width:70px;margin-left:5px}.joe_comment__respond-form .foot .comment_box:hover{background:var(--theme);color:#fff}.joe_comment__respond-form .foot .comment_box .dropdown-menu{cursor:default;position:absolute;top:auto;bottom:100%;margin-bottom:6px;z-index:10;display:none;min-width:160px;padding:5px 0;font-size:14px;text-align:left;list-style:none;background-color:var(--background);color:var(--minor);background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-color:transparent;border-radius:4px;box-shadow:0 0 10px 8px rgba(116,116,116,.08)}.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-image,.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-code{width:250px;padding:8px 10px}.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-image p,.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-code p{margin:0 0 10px}.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-image p textarea,.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-code p textarea{resize:vertical}.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-image .form-control,.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-code .form-control{display:block;width:100%;padding:6px 12px;font-size:14px;line-height:1.42857143;border:1px solid #ccc;border-radius:4px;border-color:transparent;background:var(--classD);color:#4e5358;max-height:200px;min-height:90px;box-shadow:none;transition:border-color ease-in-out .15s,background ease-in-out .15s,box-shadow ease-in-out .15s,opacity ease-in-out .3s}.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-image .text-right,.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-code .text-right{text-align:right}.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-image .text-right .error,.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-code .text-right .error{float:left;color:var(--theme);-webkit-animation:5s ease-in-out 0s infinite normal none running shaked;animation:5s ease-in-out 0s infinite normal none running shaked}.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-image .text-right .but,.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-code .text-right .but{border-radius:4px;display:inline-block;line-height:1.44;background:var(--theme);color:#fff;padding:.3em 1em}.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-image .text-right .but:hover,.joe_comment__respond-form .foot .comment_box .dropdown-menu .dropdown-code .text-right .but:hover{-webkit-animation:5s ease-in-out 0s infinite normal none running shaked;animation:5s ease-in-out 0s infinite normal none running shaked}.joe_comment__respond-form .foot .press-down{background:var(--theme) !important;color:#fff !important}@media(max-width: 768px){.joe_comment__respond-form .foot .title{display:none}.joe_comment__respond-form .foot .owo .seat,.joe_comment__respond-form .foot .comment_box{width:26px}}.HeaderImg{position:relative;width:100%;height:15rem;display:flex;margin-left:auto;margin-right:auto;justify-content:center;align-items:center;flex-direction:column}.HeaderImg.minImg{width:82.5rem;height:25rem}.HeaderImg img{-o-object-fit:cover;object-fit:cover}.HeaderImg .infomation{position:absolute;line-height:2}.HeaderImg .infomation .title{font-size:2rem;font-weight:700;color:#fff;text-align:center;text-shadow:0 .1875rem .3125rem #1c1f21;letter-spacing:.5rem}.HeaderImg .infomation .desctitle{display:flex;align-items:center;justify-content:center;text-align:center;color:#f3f3f3;font-size:1rem;padding:0 1rem;text-shadow:0 .1875rem .3125rem #1c1f21}.HeaderImg .infomation .desctitle h1{font-size:1rem}.HeaderImg .infomation .desctitle h1.post_h{font-size:1.5rem}.HeaderImg .HeaderImg_arrow{opacity:1;cursor:pointer;margin-top:1.5rem;position:absolute;left:50%;bottom:20%;width:40px;height:40px;margin-left:-20px}.HeaderImg .HeaderImg_arrow .HeaderImg_arrow__bou{transform:translateX(-50%);transition-delay:5s;-webkit-animation-duration:4s;animation-duration:4s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;transform-origin:center bottom;-webkit-animation-name:go_down_animation;animation-name:go_down_animation;-webkit-animation-timing-function:cubic-bezier(0.28, 0.84, 0.42, 1);animation-timing-function:cubic-bezier(0.28, 0.84, 0.42, 1)}@-webkit-keyframes go_down_animation{0%{transform:scale(1, 1) translateY(0px)}10%{transform:scale(1.1, 0.9) translateY(0px)}30%{transform:scale(0.9, 1.1) translateY(-30px)}50%{transform:scale(1.05, 0.95) translateY(0px)}57%{transform:scale(1, 1) translateY(-7px)}64%{transform:scale(1, 1) translateY(0px)}100%{transform:scale(1, 1) translateY(0px)}}@keyframes go_down_animation{0%{transform:scale(1, 1) translateY(0px)}10%{transform:scale(1.1, 0.9) translateY(0px)}30%{transform:scale(0.9, 1.1) translateY(-30px)}50%{transform:scale(1.05, 0.95) translateY(0px)}57%{transform:scale(1, 1) translateY(-7px)}64%{transform:scale(1, 1) translateY(0px)}100%{transform:scale(1, 1) translateY(0px)}}.HeaderImg .HeaderImg_bottom{width:100%;position:absolute;left:0;bottom:-5px}.HeaderImg .HeaderImg_bottom .waves-svg{width:100%;height:6rem}.HeaderImg .HeaderImg_bottom .waves-svg .parallax>use{-webkit-animation:move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;animation:move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite}.HeaderImg .HeaderImg_bottom .waves-svg .parallax>use:first-child{-webkit-animation-delay:-2s;animation-delay:-2s;-webkit-animation-duration:7s;animation-duration:7s;fill:var(--background);opacity:.9}.HeaderImg .HeaderImg_bottom .waves-svg .parallax>use:nth-child(2){-webkit-animation-delay:-3s;animation-delay:-3s;-webkit-animation-duration:10s;animation-duration:10s;fill:var(--background);opacity:.8}.HeaderImg .HeaderImg_bottom .waves-svg .parallax>use:nth-child(3){-webkit-animation-delay:-4s;animation-delay:-4s;-webkit-animation-duration:13s;animation-duration:13s;fill:var(--background);opacity:.9}.HeaderImg .HeaderImg_bottom .waves-svg .parallax>use:nth-child(4){-webkit-animation-delay:-5s;animation-delay:-5s;-webkit-animation-duration:20s;animation-duration:20s;fill:var(--background)}@-webkit-keyframes move-forever{0%{transform:translate3d(-90px, 0, 0)}to{transform:translate3d(85px, 0, 0)}}@keyframes move-forever{0%{transform:translate3d(-90px, 0, 0)}to{transform:translate3d(85px, 0, 0)}}.HeaderImg:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKUlEQVQImU3IMREAIAgAwJfNkQCEsH8cijjpMf6vnXlQaIiJFx+omEBfmqIEZLe2jzcAAAAASUVORK5CYII=)}@media(max-width: 768px){.HeaderImg{height:15rem;margin-top:0}.HeaderImg.minImg{width:100%;height:15rem}.HeaderImg .infomation .title{font-size:1.2rem}.HeaderImg .infomation .desctitle h1.post_h{font-size:1rem}.HeaderImg .HeaderImg_bottom .waves-svg{height:3rem}}.joe_aside.inactive{display:none}.joe_main{position:relative}@media(max-width: 768px){.joe-stretch{display:none}}.joe-stretch{height:100%;position:absolute;top:0;right:0;padding:40px 0}.joe-stretch .contain{position:-webkit-sticky;position:sticky;transition:top .5s;-webkit-animation:swingIconSet 2s infinite linear alternate;animation:swingIconSet 2s infinite linear alternate;z-index:333}@-webkit-keyframes swingIconSet{0%{transform:rotate(-30deg)}100%{transform:rotate(30deg)}}@keyframes swingIconSet{0%{transform:rotate(-30deg)}100%{transform:rotate(30deg)}}.joe-stretch .contain::before{content:"";position:absolute;top:0;left:0;width:10px;height:25px;border-top:2px solid var(--minor);border-right:2px solid var(--minor);transition:border .35s}.joe-stretch .contain svg{position:absolute;top:25px;left:-3px;width:24px;height:24px;fill:var(--minor);cursor:pointer;transition:fill .35s}.joe-stretch .contain:hover{-webkit-animation-play-state:paused;animation-play-state:paused}.joe-stretch .contain:hover svg{fill:var(--theme)}.joe-stretch .contain:hover::before{border-color:var(--theme)}.joe-stretch.active{display:block}.joe_action_item.read_book{visibility:hidden;transform:scale(0)}.joe_action_item.read_book.active{visibility:visible;transform:scale(1)}.joe_action_item.read_book svg{transform:scale(0);opacity:0;transition:transform .85s,opacity .85s}.joe_action_item.read_book svg.active{transform:scale(1);opacity:1}.joe_action_item.directory{display:none;transform:scale(0)}.joe_action_item.directory.active{display:inline-flex;transform:scale(1)}.joe_action_item.directory svg{transform:scale(0);opacity:0;transition:transform .85s,opacity .85s}.joe_action_item.directory svg.active{transform:scale(1);opacity:1}.joe_action_item.directory .tree{opacity:0;width:15rem;height:20rem;overflow:auto;position:absolute;z-index:-10;background:var(--background);border-radius:var(--radius-wrap);box-shadow:var(--box-shadow);-webkit-animation:rebox .5s forwards;animation:rebox .5s forwards;cursor:default}@-webkit-keyframes rebox{0%{transform:scale(1);opacity:1;transform:translateY(0px);right:45px;bottom:0}100%{transform:scale(0);opacity:0;width:0;height:0}}@keyframes rebox{0%{transform:scale(1);opacity:1;transform:translateY(0px);right:45px;bottom:0}100%{transform:scale(0);opacity:0;width:0;height:0}}.joe_action_item.directory .tree.active{-webkit-animation:box .5s forwards;animation:box .5s forwards}@-webkit-keyframes box{0%{transform:scale(0);opacity:0;width:0;height:0}100%{transform:scale(1);opacity:1;transform:translateY(0px);right:45px;bottom:0}}@keyframes box{0%{transform:scale(0);opacity:0;width:0;height:0}100%{transform:scale(1);opacity:1;transform:translateY(0px);right:45px;bottom:0}}.joe_action_item.directory .tree .title{font-size:16px;border-bottom:1px solid var(--routine);color:var(--routine);position:sticky;position:-webkit-sticky;padding:5px 10px;top:0;font-weight:bold}.joe_action_item.directory .tree .text{padding:5px 10px;overflow-y:auto;overflow-x:hidden;height:85%;white-space:nowrap;text-overflow:ellipsis}.joe_action_item.directory .tree .text a{text-decoration:none;color:var(--minor);font-size:15px;line-height:1.8;cursor:pointer}.joe_action_item.directory .tree .text a:hover{color:var(--theme);border-bottom:1px solid var(--theme)}.joe_detail__count-information .meta .item .icon{fill:var(--minor);margin:0 5px}

custom.min.js代码如下:

document.addEventListener("DOMContentLoaded",function(){if($(".Reward").length){let e=document.querySelector(".RewardImg"),t=document.querySelectorAll(".RewardImg li img"),o=document.querySelectorAll(".RewardBtn li"),a=document.querySelectorAll(".RewardBtn li div");for(let n=0;n<a.length;n++){e.style.width=150*t.length+"px";let i=0;a[0].style.backgroundColor="var(--theme)",a[0].style.color="#fff",o[n].style.width=1/a.length*(150-(a.length+1))+"px",a[n].num=n,a[n].onclick=function(){i=this.num;for(let e=0;e<a.length;e++)a[e].style.backgroundColor="",a[e].style.color="";a[i].style.backgroundColor="var(--theme)",a[i].style.color="#fff",e.style.left=-150*i+"px"}}}if($(".WeChat").length){$WeChatA=$(".WeChatA");let e=$WeChatA.get(0).outerHTML;e=e.replace(/^<a/,"<div"),e=e.replace(/\/a>$/,"/div>"),$WeChatA.replaceWith(e),$(".WeChat").mouseenter(function(){$(".WeChat").append('<div class="WeChatInner"><img src="javascript:;" /></div>'),$(".WeChatInner img").attr("src",$(".WeChatA").attr("href"))}),$(".WeChat").mouseleave(function(){$(".WeChatInner").remove()})}if($(".Comment_Citation").length){function e(){let e=Joe.CITATION,t=/(https?:\/\/[^\s]+)/g;t.test(e)?$.ajax({url:e,dataType:"text",success:e=>$(".joe_comment__respond-form .body textarea").val(e)}):$(".joe_comment__respond-form .body textarea").val(e)}e(),$(".Comment_Citation").click(function(){e()})}if($(".Comment_ImageUrl").length&&($(".Comment_ImageUrl").click(function(e){e.stopPropagation(),$(".Comment_ImageUrl .dropdown-menu").slideToggle("fast",function(){$(".Comment_ImageUrl .comment_box").toggleClass("press-down")}),$(".dropdown-image .text-right span").text(""),$(".dropdown-image textarea").val("")}),$(document).click(function(){$(".Comment_ImageUrl .dropdown-menu").stop().slideUp("fast"),$(".Comment_ImageUrl .comment_box").removeClass("press-down")}),$(".Comment_ImageUrl .dropdown-menu").on("click",function(e){e&&e.stopPropagation?e.stopPropagation():window.event&&(window.event.cancelBubble=!0)}),$(".dropdown-image [type='submit']").click(function(){let e=$(this).parents(".dropdown-image").find("textarea"),t=e.val(),o=$(".joe_comment__respond-form .body textarea").val(),a=/\http[s]{0,1}:\/\/.([^<>"]*)(\.(jpg|jpeg|png|gif|webp))/;a.test(t)?(t="[img="+t+"]\n",$(".joe_comment__respond-form .body textarea").val(o+t),$(".Comment_ImageUrl .dropdown-menu").stop().slideUp("fast"),$(".Comment_ImageUrl .comment_box").toggleClass("press-down"),t=e.val("")):($(".dropdown-image .text-right span").addClass("error"),$(".dropdown-image .text-right span").text("格式错误!"))})),$(".Comment_Code").length&&($(".Comment_Code").click(function(e){e.stopPropagation(),$(".Comment_Code .dropdown-menu").slideToggle("fast",function(){$(".Comment_Code .comment_box").toggleClass("press-down")}),$(".dropdown-code .text-right span").text(""),$(".dropdown-code textarea").val("")}),$(document).click(function(){$(".Comment_Code .dropdown-menu").stop().slideUp("fast"),$(".Comment_Code .comment_box").removeClass("press-down")}),$(".Comment_Code .dropdown-menu").on("click",function(e){e&&e.stopPropagation?e.stopPropagation():window.event&&(window.event.cancelBubble=!0)}),$(".dropdown-code [type='submit']").click(function(){let e=$(this).parents(".dropdown-code").find("textarea"),t=e.val(),o=$(".joe_comment__respond-form .body textarea").val();""==t?($(".dropdown-code .text-right span").addClass("error"),$(".dropdown-code .text-right span").text("请输入内容!")):(t="[code]\n"+t+"\n[/code]\n",$(".joe_comment__respond-form .body textarea").val(o+t),$(".Comment_Code .dropdown-menu").stop().slideUp("fast"),$(".Comment_Code .comment_box").toggleClass("press-down"),t=e.val(""))})),$(".comment-list .substance img:not(img.owo_image)").each(function(){$(this).attr("data-src")?$(this).wrap($(`<span style="display: block;" data-fancybox="Joe" href="${$(this).attr("data-src")}"></span>`)):$(this).wrap($(`<span style="display: block;" data-fancybox="Joe" href="${$(this).attr("src")}"></span>`))}),$(".comment-list__item").length){let e=$(".joe_comment > ol.comment-list").children(".comment-list__item"),t='<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8885993286780110"crossorigin="anonymous"></script><ins class="adsbygoogle"style="display:block" data-ad-format="fluid"data-ad-layout-key="-g8-h+6z-cm-d" data-ad-client="ca-pub-8885993286780110" data-ad-slot="5758522083"></ins> <script>(adsbygoogle = window.adsbygoogle || []).push({});</script>';for(let o=0;o<e.length;o++)o%4==3&&$("<li class='js_ad' style='margin-bottom:10px'>"+t+"</li>").insertAfter(e[o])}if($(".joe-stretch").length&&($(".joe-stretch .contain").css("top",$(".joe_header").height()+40),$(".joe-stretch").on("click",function(){$(".joe_aside").toggleClass("inactive")})),$(".read_book").length&&($(".joe_post").length&&($(".joe_action_item.read_book").addClass("active"),$(".joe_action_item.read_book .icon-1").addClass("active")),$(".joe_action_item.read_book").on("click",function(){$(".joe_action_item.read_book svg").hasClass("icon-1 active")?($(".joe_header").css("display","none"),$(".HeaderImg").css("display","none"),$(".joe_aside").css("display","none"),$(".joe_detail").css("backgroundColor","var(--reading)"),$(".joe_detail__related").css("display","none"),$(".joe_comment").css("display","none"),$(".joe_footer").css("display","none"),$(".joe-stretch").css("display","none"),$(".joe_detail__article").css("font-size","20px")):($(".joe_header").removeAttr("style"),$(".HeaderImg").removeAttr("style"),$(".joe_aside").removeAttr("style"),$(".joe_detail").removeAttr("style"),$(".joe_detail__related").removeAttr("style"),$(".joe_comment").removeAttr("style"),$(".joe_footer").removeAttr("style"),$(".joe-stretch").removeAttr("style"),$(".joe-stretch").removeAttr("style"),$(".joe_detail__article").removeAttr("style")),$(".joe_action_item.read_book .icon-1").toggleClass("active"),$(".joe_action_item.read_book .icon-2").toggleClass("active")})),$(".joe_post").length&&$(".joe_detail__article").find("h2,h3,h4,h5,h6").length){$("body").outerWidth()>=768?($(".joe_action_item.directory").addClass("active"),$(".joe_action_item.directory .icon-2").addClass("active"),$(".joe_action_item.directory .tree").addClass("active")):($(".joe_action_item.directory").addClass("active"),$(".joe_action_item.directory .icon-1").addClass("active"));let e=$(".joe_detail__article").find("*"),t=0;for(let o=0;o<e.length;o++)if("h"==e[o].localName.charAt(0)&&!isNaN(e[o].localName.charAt(1))){e[o].setAttribute("id","t"+t);let a=parseInt(e[o].localName.charAt(1))-2;for(;a--&&!(a<0);)$(".directory .tree .text").append("&emsp;");$(".directory .tree .text").append("<a href='#t"+t+"'>"+$(e[o]).text()+"</a></br>"),t++}$(".joe_action_item.directory").on("click",function(){$(".joe_action_item.directory .tree").toggleClass("active"),$(".joe_action_item.directory .icon-1").toggleClass("active"),$(".joe_action_item.directory .icon-2").toggleClass("active")}),$(".directory .tree").on("click",function(e){e&&e.stopPropagation?e.stopPropagation():window.event&&(window.event.cancelBubble=!0)}),$(".directory .tree a").bind("click touch",function(){$("html,body").animate({scrollTop:$($(this).attr("href")).offset().top-65},1e3)})}$(".HeaderImg_arrow").length&&$(".HeaderImg_arrow").on("click",function(){$("body").outerWidth()>=768&&window.scrollTo({top:300,behavior:"smooth"})})});{function loveSiteTime(e,t){window.setTimeout(function(){loveSiteTime(e,t)},1e3);let o=1e3,a=60*o,n=60*a,i=24*n,r=365*i,s=new Date,l=s.getFullYear(),d=s.getMonth()+1,c=s.getDate(),m=s.getHours(),p=s.getMinutes(),_=s.getSeconds(),g=Date.UTC(2019,10,19,21,0,0);t&&(g=Date.UTC(t.split("-")[0],t.split("-")[1],t.split("-")[2],t.split("-")[3],t.split("-")[4],t.split("-")[5]));let h=Date.UTC(l,d,c,m,p,_),f=h-g,u=Math.floor(f/r),C=Math.floor(f/i-365*u),y=Math.floor((f-(365*u+C)*i)/n),v=Math.floor((f-(365*u+C)*i-y*n)/a),w=Math.floor((f-(365*u+C)*i-y*n-v*a)/o);$("#loveSiteTime4Aside")&&$("#loveSiteTime4Aside").html(e+"</br>"+u+"年"+C+"天"+y+"时"+v+"分"+w+"秒啦</br>"),$("#loveSiteTime4Header")&&$("#loveSiteTime4Header").html(e+"</br>"+u+"年"+C+"天"+y+"时"+v+"分"+w+"秒啦</br>")}}

创建文件完成代码的粘贴之后,下面要去public文件夹中找到include.php文件,在相应的位置引入刚才创建的css和js文件,引入代码:(css代码在前面) <link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/custom.min.css'); ?>">
(js代码在后面): <script src="<?php $this->options->themeUrl('assets/js/custom.min.js'); ?>"></script>

lk67fnyi.png

lk67iees.png


结语

完成上述操作之后,即可在后台看到自定义设置的功能,具体的图片看前言里面的,具体的功能我就不展示了,自己操作吧,这样的好处就是以后只用改custom.php就行,其他的文件代码改动也不会太大,添加后台开关的代码都可以放在custom.php里面.现在快去试试吧.

9
adLINK

评论

博主关闭了所有页面的评论
2021-©Reach-笔记堡
[博主 4月29日 在线]|耗时:67 ms
建站时间:
chuansuo|520
本站总访问量 58185 次|点击量58185次
gonganicp滇公网安备 53062802000014号|滇ICP备2021001616号
本站点由慈云数据提供高防CDN强劲加速!
Ad