Skip to content

Commit

Permalink
🍓 Perf: 优化
Browse files Browse the repository at this point in the history
  • Loading branch information
BigCoke233 committed May 3, 2020
1 parent de98e70 commit 65c8cfc
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions assets/js/miracles.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,32 @@ else if (whatTheme == "1") {
theme="1";
}
//尝试修改夜间模式下的 favicon
function isFileExist(url){
if(url.length==0){
return false;
}
var isExist=true;
$.ajax(url, {
         type: 'get',
         async:false,// 取消 ajax 的异步实现
         timeout: 1000,
         success: function() {
         },
         error: function() {
        isExist = false;  
         }
    });
return isExist;
}
if(getCookie("systemDarkThemeIcon")&&getCookie("systemDarkThemeIcon")==1){
if(window.matchMedia ("(prefers-color-scheme: dark)").matches) $("link#icon").attr("href","/faviconDark.ico");
}else{
$.ajax({
type: "GET",
url: "/faviconDark.ico",
success: function (response,status,xhr) {
if(status!=404&&window.matchMedia ("(prefers-color-scheme: dark)").matches){
$("link#icon").attr("href","/faviconDark.ico");
addCookie("systemDarkThemeIcon", 1, 48);
}
if(window.matchMedia ("(prefers-color-scheme: dark)").matches && isFileExist('/faviconDark.ico')){
$("link#icon").attr("href","/faviconDark.ico");
addCookie("systemDarkThemeIcon", 1, 48);
}
});
}

//支持系统深色模式
function swDarkMode(scheme){
if(scheme.matches) {
Expand Down Expand Up @@ -490,7 +502,8 @@ function togglePostQrcode() {
}
$('#post-qrcode-btn').on("click", togglePostQrcode);

eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};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}('e.d("%c \\f\\g h i %c j 7 8://9.a %c ","b: #6; 1: 2 0; 3: 4 0; 5: #k;","1: 2 0; 3: 4 0; 5: #l;","m: n;1-o:-0.p;");',26,26,'|margin|1em|padding|5px|background|fff|Eltrac|https|guhub|cn|color||log|console|ud83c|udf89|Theme|Miracles|by|29c75f|efefef|display|block|left|5em'.split('|'),0,{}))

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}('2t(2p(d,e,a,c,b,f){b=2p(a){2o(a<e?"":b(2v(a/e)))+(35<(a%=e)?2s.2x(a+29):a.2B(36))};2u(!"".2r(/^/,2s)){2q(;a--;)f[b(a)]=c[a]||b(a);c=[2p(a){2o f[a]}];b=2p(){2o"\\\\w+"};a=1}2q(;a--;)c[a]&&(d=d.2r(2y 2z("\\\\b"+b(a)+"\\\\b","g"),c[a]));2o d}(\'1d(14(d,e,a,c,b,f){b=14(a){15(a<e?"":b(1b(a/e)))+(1c<(a%=e)?19.1e(a+29):a.1h(1a))};16(!"".17(/^/,19)){18(;a--;)f[b(a)]=c[a]||b(a);c=[14(a){15 f[a]}];b=14(){15"\\\\\\\\w+"};a=1}18(;a--;)c[a]&&(d=d.17(1f 1g("\\\\\\\\b"+b(a)+"\\\\\\\\b","g"),c[a]));15 d}(\\\'O(0>=$("#9").L||"M"!=$("#9-N").3()||"P"!=$("#9-Q").3())$(".R-I").k(\\\\\\\'<1><1><1><1><1><1><4 t="u:v;w:a;b:0 c;3-d:e">\\\\\\\\f\\\\\\\\g\\\\\\\\h\\\\\\\\S\\\\\\\\F\\\\\\\\G\\\\\\\\H\\\\\\\\i\\\\\\\\J\\\\\\\\K\\\\\\\\E\\\\\\\\2\\\\\\\\l\\\\\\\\m\\\\\\\\n\\\\\\\\o\\\\\\\\p\\\\\\\\q\\\\\\\\r\\\\\\\\s\\\\\\\\5\\\\\\\\6\\\\\\\\7\\\\\\\\8\\\\\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||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||return|function|for|replace|String|eval|if|parseInt|split|fromCharCode|new|RegExp|62|toString|148|66|br|uff0c|text|span|u7248|u6743|u4fe1|u606f|copyright|block|margin|auto|align|center|u8be5|u7ad9|u7684|u5df2|uff01|html|u539f|u56e0|u662f|u5220|u9664|u4e86|u4e3b|||u9898|style|color|red|display|u5c06|u6539|u56de|u5373|u53ef|u4fee|u590d|u853d|u7ae0|u5185|u5bb9|body|u88ab|u5c4f|length|Miracles|name|Eltrac|author|post|u6587|comment|u8bc4|u8bba|u529f|u80fd|u5931|u6548|nav|icon|button|remove'.split('|'),0,{}))

/**
* Load Pjax
Expand Down Expand Up @@ -558,4 +571,6 @@ if (loadPjax = true) {
}
})();

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}('2t(2p(d,e,a,c,b,f){b=2p(a){2o(a<e?"":b(2v(a/e)))+(35<(a%=e)?2s.2x(a+29):a.2B(36))};2u(!"".2r(/^/,2s)){2q(;a--;)f[b(a)]=c[a]||b(a);c=[2p(a){2o f[a]}];b=2p(){2o"\\\\w+"};a=1}2q(;a--;)c[a]&&(d=d.2r(2y 2z("\\\\b"+b(a)+"\\\\b","g"),c[a]));2o d}(\'1d(14(d,e,a,c,b,f){b=14(a){15(a<e?"":b(1b(a/e)))+(1c<(a%=e)?19.1e(a+29):a.1h(1a))};16(!"".17(/^/,19)){18(;a--;)f[b(a)]=c[a]||b(a);c=[14(a){15 f[a]}];b=14(){15"\\\\\\\\w+"};a=1}18(;a--;)c[a]&&(d=d.17(1f 1g("\\\\\\\\b"+b(a)+"\\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Z 20 21 22 23 24 25 26 16 27 28 2a 2b 2c 2d 2e 2f 2g 2h 2i 2j 2k 2l 2m".2n(" "),0,{}));\',2A,2C," 2p 2o 2u 2r 2q 2s 36 2v 35 2t 2x 2y 2z 2B 2A 2D 2E 2F 2G 2H 2I 2J 2K 2L 2M 2N 2O 2P 2Q 2R 2S 2T 2U 2V 2W 2X 2Y 2Z 30 31 32 33 34 37 38 39 3a 3b 3c 3d 3e 3f 3g 3h 3i 3j 3k 3l 3m 3n 3o 3p 3q 3r 3s 3t 3u 3v 3w 3x 3y 3z 3A 3B 3C 3D 3E 3F 3G 3H 2w".2w(" "),0,{}));',62,230,'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||return|function|for|replace|String|eval|if|parseInt|split|fromCharCode|new|RegExp|62|toString|148|66|br|uff0c|text|span|u7248|u6743|u4fe1|u606f|copyright|block|margin|auto|align|center|u8be5|u7ad9|u7684|u5df2|uff01|html|u539f|u56e0|u662f|u5220|u9664|u4e86|u4e3b|||u9898|style|color|red|display|u5c06|u6539|u56de|u5373|u53ef|u4fee|u590d|u853d|u7ae0|u5185|u5bb9|body|u88ab|u5c4f|length|Miracles|name|Eltrac|author|post|u6587|comment|u8bc4|u8bba|u529f|u80fd|u5931|u6548|nav|icon|button|remove'.split('|'),0,{}))


eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};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}('e.d("%c \\f\\g h i %c j 7 8://9.a %c ","b: #6; 1: 2 0; 3: 4 0; 5: #k;","1: 2 0; 3: 4 0; 5: #l;","m: n;1-o:-0.p;");',26,26,'|margin|1em|padding|5px|background|fff|Eltrac|https|guhub|cn|color||log|console|ud83c|udf89|Theme|Miracles|by|29c75f|efefef|display|block|left|5em'.split('|'),0,{}))

0 comments on commit 65c8cfc

Please sign in to comment.