From 93eb457c33dd886aa89cb3e736a0d144e0ef41c6 Mon Sep 17 00:00:00 2001
From: Mashiro
Date: Sat, 11 Jan 2020 22:57:25 +0800
Subject: [PATCH 01/14] Update 11.third-part-functions.js
---
cdn/js/src/11.third-part-functions.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cdn/js/src/11.third-part-functions.js b/cdn/js/src/11.third-part-functions.js
index 0461ba3..0ee8c88 100644
--- a/cdn/js/src/11.third-part-functions.js
+++ b/cdn/js/src/11.third-part-functions.js
@@ -8,7 +8,7 @@ function get_gravatar(email, size) {
var size = size || 80;
- return 'https://gravatar.shino.cc/avatar/' + MD5(email) + '.jpg?s=' + size + '&d=mm';
+ return 'https://gravatar.2heng.xin/avatar/' + MD5(email) + '.jpg?s=' + size + '&d=mm';
}
// sync css
From 376efe91a21accae7090aeb8314f2f5531d5e58a Mon Sep 17 00:00:00 2001
From: Mashiro
Date: Sat, 11 Jan 2020 22:59:40 +0800
Subject: [PATCH 02/14] Update lib.js
---
cdn/js/lib.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cdn/js/lib.js b/cdn/js/lib.js
index 59b07ef..39e37ec 100755
--- a/cdn/js/lib.js
+++ b/cdn/js/lib.js
@@ -29,7 +29,7 @@ div.textContent=element.value.substring(0,position);if(element.nodeName==='INPUT
div.textContent=div.textContent.replace(/\s/g,"\u00a0");var span=document.createElement('span');span.textContent=element.value.substring(position)||'.';div.appendChild(span);var coordinates={top:span.offsetTop+parseInt(computed['borderTopWidth']),left:span.offsetLeft+parseInt(computed['borderLeftWidth'])};if(debug){span.style.backgroundColor='#aaa';}else{document.body.removeChild(div);}
return coordinates;}
if(typeof module!="undefined"&&typeof module.exports!="undefined"){module.exports=getCaretCoordinates;}else{window.getCaretCoordinates=getCaretCoordinates;}}());})
-])});;!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("APlayer",[],t):"object"==typeof exports?exports.APlayer=t():e.APlayer=t()}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=41)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=/mobile/i.test(window.navigator.userAgent),a={secondToTime:function(e){var t=Math.floor(e/3600),n=Math.floor((e-3600*t)/60),i=Math.floor(e-3600*t-60*n);return(t>0?[t,n,i]:[n,i]).map(function(e){return e<10?"0"+e:""+e}).join(":")},getElementViewLeft:function(e){var t=e.offsetLeft,n=e.offsetParent,i=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==n&&n!==e;)t+=n.offsetLeft,n=n.offsetParent;else for(;null!==n;)t+=n.offsetLeft,n=n.offsetParent;return t-i},getElementViewTop:function(e,t){for(var n,i=e.offsetTop,a=e.offsetParent;null!==a;)i+=a.offsetTop,a=a.offsetParent;return n=document.body.scrollTop+document.documentElement.scrollTop,t?i:i-n},isMobile:i,storage:{set:function(e,t){localStorage.setItem(e,t)},get:function(e){return localStorage.getItem(e)}},nameMap:{dragStart:i?"touchstart":"mousedown",dragMove:i?"touchmove":"mousemove",dragEnd:i?"touchend":"mouseup"},randomOrder:function(e){return function(e){for(var t=e.length-1;t>=0;t--){var n=Math.floor(Math.random()*(t+1)),i=e[n];e[n]=e[t],e[t]=i}return e}([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t\n \n ',t+=r(n+s),t+='\n ',t+=r(e.name),t+='\n ',t+=r(e.artist),t+="\n\n"}),t}},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=g(n(33)),a=g(n(32)),r=g(n(31)),o=g(n(30)),s=g(n(29)),l=g(n(28)),u=g(n(27)),c=g(n(26)),p=g(n(25)),d=g(n(24)),h=g(n(23)),y=g(n(22)),f=g(n(21)),v=g(n(20)),m=g(n(19));function g(e){return e&&e.__esModule?e:{default:e}}var w={play:i.default,pause:a.default,volumeUp:r.default,volumeDown:o.default,volumeOff:s.default,orderRandom:l.default,orderList:u.default,menu:c.default,loopAll:p.default,loopOne:d.default,loopNone:h.default,loading:y.default,right:f.default,skip:v.default,lrc:m.default};t.default=w},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";var i,a,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};void 0===(a="function"==typeof(i=function(){if("object"===("undefined"==typeof window?"undefined":r(window))&&void 0!==document.querySelectorAll&&void 0!==window.pageYOffset&&void 0!==history.pushState){var e=function(e,t,n,i){return n>i?t:e+(t-e)*((a=n/i)<.5?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1);var a},t=function(t,n,i,a){n=n||500;var r=(a=a||window).scrollTop||window.pageYOffset;if("number"==typeof t)var o=parseInt(t);else var o=function(e,t){return"HTML"===e.nodeName?-t:e.getBoundingClientRect().top+t}(t,r);var s=Date.now(),l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,15)};!function u(){var c=Date.now()-s;a!==window?a.scrollTop=e(r,o,c,n):window.scroll(0,e(r,o,c,n)),c>n?"function"==typeof i&&i(t):l(u)}()},n=function(e){if(!e.defaultPrevented){e.preventDefault(),location.hash!==this.hash&&window.history.pushState(null,null,this.hash);var n=document.getElementById(this.hash.substring(1));if(!n)return;t(n,500,function(e){location.replace("#"+e.id)})}};return document.addEventListener("DOMContentLoaded",function(){for(var e,t=document.querySelectorAll('a[href^="#"]:not([href="#"])'),i=t.length;e=t[--i];)e.addEventListener("click",n,!1)}),t}})?i.call(t,n,t,e):i)||(e.exports=a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1),n=0===this.audios.length;this.player.template.listOl.innerHTML+=(0,a.default)({theme:this.player.options.theme,audio:e,index:this.audios.length+1}),this.audios=this.audios.concat(e),t&&this.audios.length>1&&this.player.container.classList.add("aplayer-withlist"),this.player.randomOrder=r.default.randomOrder(this.audios.length),this.player.template.listCurs=this.player.container.querySelectorAll(".aplayer-list-cur"),this.player.template.listCurs[this.audios.length-1].style.backgroundColor=e.theme||this.player.options.theme,n&&("random"===this.player.options.order?this.switch(this.player.randomOrder[0]):this.switch(0))}},{key:"remove",value:function(e){if(this.player.events.trigger("listremove",{index:e}),this.audios[e])if(this.audios.length>1){var t=this.player.container.querySelectorAll(".aplayer-list li");t[e].remove(),this.audios.splice(e,1),this.player.lrc&&this.player.lrc.remove(e),e===this.index&&(this.audios[e]?this.switch(e):this.switch(e-1)),this.index>e&&this.index--;for(var n=e;nt&&!e.player.audio.paused&&(e.player.container.classList.remove("aplayer-loading"),i=!1),t=n)},100)}},{key:"enable",value:function(e){this["enable"+e+"Checker"]=!0,"fps"===e&&this.initfpsChecker()}},{key:"disable",value:function(e){this["enable"+e+"Checker"]=!1}},{key:"destroy",value:function(){var e=this;this.types.forEach(function(t){e["enable"+t+"Checker"]=!1,e[t+"Checker"]&&clearInterval(e[t+"Checker"])})}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1?"one"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop?(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll):"all"===e.player.options.loop&&(e.player.options.loop="one",e.player.template.loop.innerHTML=r.default.loopOne):"one"===e.player.options.loop||"all"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop&&(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll)})}},{key:"initMenuButton",value:function(){var e=this;this.player.template.menu.addEventListener("click",function(){e.player.list.toggle()})}},{key:"initMiniSwitcher",value:function(){var e=this;this.player.template.miniSwitcher.addEventListener("click",function(){e.player.setMode("mini"===e.player.mode?"normal":"mini")})}},{key:"initSkipButton",value:function(){var e=this;this.player.template.skipBackButton.addEventListener("click",function(){e.player.skipBack()}),this.player.template.skipForwardButton.addEventListener("click",function(){e.player.skipForward()}),this.player.template.skipPlayButton.addEventListener("click",function(){e.player.toggle()})}},{key:"initLrcButton",value:function(){var e=this;this.player.template.lrcButton.addEventListener("click",function(){e.player.template.lrcButton.classList.contains("aplayer-icon-lrc-inactivity")?(e.player.template.lrcButton.classList.remove("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.show()):(e.player.template.lrcButton.classList.add("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.hide())})}}]),e}();t.default=s},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";e=e||{};var t="",n=i.$each,a=e.lyrics,r=(e.$value,e.$index,i.$escape);return n(a,function(e,n){t+="\n ",t+=r(e[1]),t+="
\n"}),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:this.player.audio.currentTime;if(this.index>this.current.length-1||e=this.current[this.index+1][0])for(var t=0;t=this.current[t][0]&&(!this.current[t+1]||e=200&&n.status<300||304===n.status?t.parsed[e]=t.parse(n.responseText):(t.player.notice("LRC file request fails: status "+n.status),t.parsed[e]=[["00:00","Not available"]]),t.container.innerHTML=(0,o.default)({lyrics:t.parsed[e]}),t.update(0),t.current=t.parsed[e])};var i=this.player.list.audios[e].lrc;n.open("get",i,!0),n.send(null)}else this.player.list.audios[e].lrc?this.parsed[e]=this.parse(this.player.list.audios[e].lrc):this.parsed[e]=[["00:00","Not available"]];this.container.innerHTML=(0,o.default)({lyrics:this.parsed[e]}),this.update(0),this.current=this.parsed[e]}},{key:"parse",value:function(e){if(e){for(var t=(e=e.replace(/([^\]^\n])\[/g,function(e,t){return t+"\n["})).split("\n"),n=[],i=t.length,a=0;a/g,"").replace(/^\s+|\s+$/g,"");if(r)for(var s=r.length,l=0;l]/;a.$escape=function(e){return function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i="",a=void 0,o=void 0,s=void 0;for(a=n.index,o=0;a\n \n ",l(n(1)(u({theme:a.theme,audio:a.audio,index:1}))),t+='\n
\n\n\n
\n
\n
\n No audio\n \n
\n
\n
\n
\n
\n
\n \n ',t+=s.loading,t+='\n \n
\n
\n
\n
\n
\n 00:00 / 00:00\n \n
\n ',t+=s.skip,t+='\n \n
\n ',t+=s.play,t+='\n \n
\n ',t+=s.skip,t+='\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n\n'):(t+='\n\n
\n
\n
\n No audio\n \n
\n
\n
\n
\n
\n
\n
\n \n ',t+=s.loading,t+='\n \n
\n
\n
\n
\n
\n 00:00 / 00:00\n \n
\n ',t+=s.skip,t+='\n \n
\n ',t+=s.play,t+='\n \n
\n ',t+=s.skip,t+='\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n\n
\n ",l(n(1)(u({theme:a.theme,audio:a.audio,index:1}))),t+="\n
\n
\n"),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n'},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t,n){"use strict";var i,a,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(i===setTimeout)return setTimeout(e,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(e){i=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var u,c=[],p=!1,d=-1;function h(){p&&u&&(p=!1,u.length?c=u.concat(c):d=-1,c.length&&y())}function y(){if(!p){var e=l(h);p=!0;for(var t=c.length;t;){for(u=c,c=[];++d1)for(var n=1;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(35),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=setTimeout;function a(){}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,r._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void l(t.promise,e)}s(t.promise,i)}else(1===e._state?s:l)(t.promise,e._value)})):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":n(t))||"function"==typeof t)){var i=t.then;if(t instanceof r)return e._state=3,e._value=t,void u(e);if("function"==typeof i)return void c((a=i,o=t,function(){a.apply(o,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){l(e,t)}var a,o}function l(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&r._immediateFn(function(){e._handled||r._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t1&&this.container.classList.add("aplayer-withlist"),r.default.isMobile&&this.container.classList.add("aplayer-mobile"),this.arrow=this.container.offsetWidth<=300,this.arrow&&this.container.classList.add("aplayer-arrow"),this.container=this.options.container,2===this.options.lrcType||!0===this.options.lrcType)for(var n=this.container.getElementsByClassName("aplayer-lrc-content"),i=0;i1?(e.notice("An audio error has occurred, player will skip forward in 2 seconds."),t=setTimeout(function(){e.skipForward(),e.paused||e.play()},2e3)):1===e.list.audios.length&&e.notice("An audio error has occurred.")}),this.events.on("listswitch",function(){t&&clearTimeout(t)}),this.on("ended",function(){"none"===e.options.loop?"list"===e.options.order?e.list.index0&&void 0!==arguments[0]?arguments[0]:this.list.audios[this.list.index].theme||this.options.theme,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.list.index;(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&this.list.audios[t]&&(this.list.audios[t].theme=e),this.template.listCurs[t]&&(this.template.listCurs[t].style.backgroundColor=e),t===this.list.index&&(this.template.pic.style.backgroundColor=e,this.template.played.style.background=e,this.template.thumb.style.background=e,this.template.volume.style.background=e)}},{key:"seek",value:function(e){e=Math.max(e,0),e=Math.min(e,this.duration),this.audio.currentTime=e,this.bar.set("played",e/this.duration,"width"),this.template.ptime.innerHTML=r.default.secondToTime(e)}},{key:"setUIPlaying",value:function(){var e=this;if(this.paused&&(this.paused=!1,this.template.button.classList.remove("aplayer-play"),this.template.button.classList.add("aplayer-pause"),this.template.button.innerHTML="",setTimeout(function(){e.template.button.innerHTML=o.default.pause},100),this.template.skipPlayButton.innerHTML=o.default.pause),this.timer.enable("loading"),this.options.mutex)for(var t=0;t=.95?this.template.volumeButton.innerHTML=o.default.volumeUp:this.volume()>0?this.template.volumeButton.innerHTML=o.default.volumeDown:this.template.volumeButton.innerHTML=o.default.volumeOff}},{key:"volume",value:function(e,t){return e=parseFloat(e),isNaN(e)||(e=Math.max(e,0),e=Math.min(e,1),this.bar.set("volume",e,"height"),t||this.storage.set("volume",e),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),this.switchVolumeIcon()),this.audio.muted?0:this.audio.volume}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"toggle",value:function(){this.template.button.classList.contains("aplayer-play")?this.play():this.template.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"switchAudio",value:function(e){this.list.switch(e)}},{key:"addAudio",value:function(e){this.list.add(e)}},{key:"removeAudio",value:function(e){this.list.remove(e)}},{key:"destroy",value:function(){m.splice(m.indexOf(this),1),this.pause(),this.container.innerHTML="",this.audio.src="",this.timer.destroy(),this.events.trigger("destroy")}},{key:"setMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"normal";this.mode=e,"mini"===e?this.container.classList.add("aplayer-narrow"):"normal"===e&&this.container.classList.remove("aplayer-narrow")}},{key:"notice",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.template.notice.innerHTML=e,this.template.notice.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.events.trigger("noticeshow",{text:e}),n&&(this.noticeTime=setTimeout(function(){t.template.notice.style.opacity=0,t.events.trigger("noticehide")},n))}},{key:"prevIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return this.list.index-1<0?this.list.audios.length-1:this.list.index-1;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return 0===e?this.randomOrder[this.randomOrder.length-1]:this.randomOrder[e-1]}}},{key:"nextIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return(this.list.index+1)%this.list.audios.length;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return e===this.randomOrder.length-1?this.randomOrder[0]:this.randomOrder[e+1]}}},{key:"skipBack",value:function(){this.list.switch(this.prevIndex())}},{key:"skipForward",value:function(){this.list.switch(this.nextIndex())}},{key:"duration",get:function(){return isNaN(this.audio.duration)?0:this.audio.duration}}],[{key:"version",get:function(){return"1.10.1"}}]),e}();t.default=g},,function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(40);var i,a=n(38),r=(i=a)&&i.__esModule?i:{default:i};console.log("\n %c APlayer v1.10.1 af84efb %c http://aplayer.js.org \n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),t.default=r.default}]).default});!function(t,e){"object"==typeof exports?module.exports=e(t):"function"==typeof define&&define.amd?define([],e(t)):t.LazyLoad=e(t)}("undefined"!=typeof global?global:this.window||this.global,function(t){"use strict";function e(t,e){this.settings=r(s,e||{}),this.images=t||document.querySelectorAll(this.settings.selector),this.observer=null,this.init()}const s={src:"data-src",srcset:"data-srcset",selector:".lazyload"},r=function(){let t={},e=!1,s=0,o=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],s++);for(;s>>(32-d))}function K(G,k){var I,d,F,H,x;F=(G&2147483648);H=(k&2147483648);I=(G&1073741824);d=(k&1073741824);x=(G&1073741823)+(k&1073741823);if(I&d){return(x^2147483648^F^H)}if(I|d){if(x&1073741824){return(x^3221225472^F^H)}else{return(x^1073741824^F^H)}}else{return(x^F^H)}}function r(d,F,k){return(d&F)|((~d)&k)}function q(d,F,k){return(d&k)|(F&(~k))}function p(d,F,k){return(d^F^k)}function n(d,F,k){return(F^(d|(~k)))}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)}function e(G){var Z;var F=G.length;var x=F+8;var k=(x-(x%64))/64;var I=(k+1)*16;var aa=Array(I-1);var d=0;var H=0;while(H>>29;return aa}function B(x){var k="",F="",G,d;for(d=0;d<=3;d++){G=(x>>>(d*8))&255;F="0"+G.toString(16);k=k+F.substr(F.length-2,2)}return k}function J(k){k=k.replace(/rn/g,"n");var d="";for(var F=0;F127)&&(x<2048)){d+=String.fromCharCode((x>>6)|192);d+=String.fromCharCode((x&63)|128)}else{d+=String.fromCharCode((x>>12)|224);d+=String.fromCharCode(((x>>6)&63)|128);d+=String.fromCharCode((x&63)|128)}}}return d}var C=Array();var P,h,E,v,g,Y,X,W,V;var S=7,Q=12,N=17,M=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;P0?[t,n,i]:[n,i]).map(function(e){return e<10?"0"+e:""+e}).join(":")},getElementViewLeft:function(e){var t=e.offsetLeft,n=e.offsetParent,i=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==n&&n!==e;)t+=n.offsetLeft,n=n.offsetParent;else for(;null!==n;)t+=n.offsetLeft,n=n.offsetParent;return t-i},getElementViewTop:function(e,t){for(var n,i=e.offsetTop,a=e.offsetParent;null!==a;)i+=a.offsetTop,a=a.offsetParent;return n=document.body.scrollTop+document.documentElement.scrollTop,t?i:i-n},isMobile:i,storage:{set:function(e,t){localStorage.setItem(e,t)},get:function(e){return localStorage.getItem(e)}},nameMap:{dragStart:i?"touchstart":"mousedown",dragMove:i?"touchmove":"mousemove",dragEnd:i?"touchend":"mouseup"},randomOrder:function(e){return function(e){for(var t=e.length-1;t>=0;t--){var n=Math.floor(Math.random()*(t+1)),i=e[n];e[n]=e[t],e[t]=i}return e}([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t\n \n ',t+=r(n+s),t+='\n ',t+=r(e.name),t+='\n ',t+=r(e.artist),t+="\n\n"}),t}},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=g(n(33)),a=g(n(32)),r=g(n(31)),o=g(n(30)),s=g(n(29)),l=g(n(28)),u=g(n(27)),c=g(n(26)),p=g(n(25)),d=g(n(24)),h=g(n(23)),y=g(n(22)),f=g(n(21)),v=g(n(20)),m=g(n(19));function g(e){return e&&e.__esModule?e:{default:e}}var w={play:i.default,pause:a.default,volumeUp:r.default,volumeDown:o.default,volumeOff:s.default,orderRandom:l.default,orderList:u.default,menu:c.default,loopAll:p.default,loopOne:d.default,loopNone:h.default,loading:y.default,right:f.default,skip:v.default,lrc:m.default};t.default=w},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";var i,a,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};void 0===(a="function"==typeof(i=function(){if("object"===("undefined"==typeof window?"undefined":r(window))&&void 0!==document.querySelectorAll&&void 0!==window.pageYOffset&&void 0!==history.pushState){var e=function(e,t,n,i){return n>i?t:e+(t-e)*((a=n/i)<.5?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1);var a},t=function(t,n,i,a){n=n||500;var r=(a=a||window).scrollTop||window.pageYOffset;if("number"==typeof t)var o=parseInt(t);else var o=function(e,t){return"HTML"===e.nodeName?-t:e.getBoundingClientRect().top+t}(t,r);var s=Date.now(),l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,15)};!function u(){var c=Date.now()-s;a!==window?a.scrollTop=e(r,o,c,n):window.scroll(0,e(r,o,c,n)),c>n?"function"==typeof i&&i(t):l(u)}()},n=function(e){if(!e.defaultPrevented){e.preventDefault(),location.hash!==this.hash&&window.history.pushState(null,null,this.hash);var n=document.getElementById(this.hash.substring(1));if(!n)return;t(n,500,function(e){location.replace("#"+e.id)})}};return document.addEventListener("DOMContentLoaded",function(){for(var e,t=document.querySelectorAll('a[href^="#"]:not([href="#"])'),i=t.length;e=t[--i];)e.addEventListener("click",n,!1)}),t}})?i.call(t,n,t,e):i)||(e.exports=a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1),n=0===this.audios.length;this.player.template.listOl.innerHTML+=(0,a.default)({theme:this.player.options.theme,audio:e,index:this.audios.length+1}),this.audios=this.audios.concat(e),t&&this.audios.length>1&&this.player.container.classList.add("aplayer-withlist"),this.player.randomOrder=r.default.randomOrder(this.audios.length),this.player.template.listCurs=this.player.container.querySelectorAll(".aplayer-list-cur"),this.player.template.listCurs[this.audios.length-1].style.backgroundColor=e.theme||this.player.options.theme,n&&("random"===this.player.options.order?this.switch(this.player.randomOrder[0]):this.switch(0))}},{key:"remove",value:function(e){if(this.player.events.trigger("listremove",{index:e}),this.audios[e])if(this.audios.length>1){var t=this.player.container.querySelectorAll(".aplayer-list li");t[e].remove(),this.audios.splice(e,1),this.player.lrc&&this.player.lrc.remove(e),e===this.index&&(this.audios[e]?this.switch(e):this.switch(e-1)),this.index>e&&this.index--;for(var n=e;nt&&!e.player.audio.paused&&(e.player.container.classList.remove("aplayer-loading"),i=!1),t=n)},100)}},{key:"enable",value:function(e){this["enable"+e+"Checker"]=!0,"fps"===e&&this.initfpsChecker()}},{key:"disable",value:function(e){this["enable"+e+"Checker"]=!1}},{key:"destroy",value:function(){var e=this;this.types.forEach(function(t){e["enable"+t+"Checker"]=!1,e[t+"Checker"]&&clearInterval(e[t+"Checker"])})}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1?"one"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop?(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll):"all"===e.player.options.loop&&(e.player.options.loop="one",e.player.template.loop.innerHTML=r.default.loopOne):"one"===e.player.options.loop||"all"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop&&(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll)})}},{key:"initMenuButton",value:function(){var e=this;this.player.template.menu.addEventListener("click",function(){e.player.list.toggle()})}},{key:"initMiniSwitcher",value:function(){var e=this;this.player.template.miniSwitcher.addEventListener("click",function(){e.player.setMode("mini"===e.player.mode?"normal":"mini")})}},{key:"initSkipButton",value:function(){var e=this;this.player.template.skipBackButton.addEventListener("click",function(){e.player.skipBack()}),this.player.template.skipForwardButton.addEventListener("click",function(){e.player.skipForward()}),this.player.template.skipPlayButton.addEventListener("click",function(){e.player.toggle()})}},{key:"initLrcButton",value:function(){var e=this;this.player.template.lrcButton.addEventListener("click",function(){e.player.template.lrcButton.classList.contains("aplayer-icon-lrc-inactivity")?(e.player.template.lrcButton.classList.remove("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.show()):(e.player.template.lrcButton.classList.add("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.hide())})}}]),e}();t.default=s},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";e=e||{};var t="",n=i.$each,a=e.lyrics,r=(e.$value,e.$index,i.$escape);return n(a,function(e,n){t+="\n ",t+=r(e[1]),t+="
\n"}),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:this.player.audio.currentTime;if(this.index>this.current.length-1||e=this.current[this.index+1][0])for(var t=0;t=this.current[t][0]&&(!this.current[t+1]||e=200&&n.status<300||304===n.status?t.parsed[e]=t.parse(n.responseText):(t.player.notice("LRC file request fails: status "+n.status),t.parsed[e]=[["00:00","Not available"]]),t.container.innerHTML=(0,o.default)({lyrics:t.parsed[e]}),t.update(0),t.current=t.parsed[e])};var i=this.player.list.audios[e].lrc;n.open("get",i,!0),n.send(null)}else this.player.list.audios[e].lrc?this.parsed[e]=this.parse(this.player.list.audios[e].lrc):this.parsed[e]=[["00:00","Not available"]];this.container.innerHTML=(0,o.default)({lyrics:this.parsed[e]}),this.update(0),this.current=this.parsed[e]}},{key:"parse",value:function(e){if(e){for(var t=(e=e.replace(/([^\]^\n])\[/g,function(e,t){return t+"\n["})).split("\n"),n=[],i=t.length,a=0;a/g,"").replace(/^\s+|\s+$/g,"");if(r)for(var s=r.length,l=0;l]/;a.$escape=function(e){return function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i="",a=void 0,o=void 0,s=void 0;for(a=n.index,o=0;a\n \n ",l(n(1)(u({theme:a.theme,audio:a.audio,index:1}))),t+='\n
\n\n\n
\n
\n
\n No audio\n \n
\n
\n
\n
\n
\n
\n \n ',t+=s.loading,t+='\n \n
\n
\n
\n
\n
\n 00:00 / 00:00\n \n
\n ',t+=s.skip,t+='\n \n
\n ',t+=s.play,t+='\n \n
\n ',t+=s.skip,t+='\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n\n'):(t+='\n\n
\n
\n
\n No audio\n \n
\n
\n
\n
\n
\n
\n
\n \n ',t+=s.loading,t+='\n \n
\n
\n
\n
\n
\n 00:00 / 00:00\n \n
\n ',t+=s.skip,t+='\n \n
\n ',t+=s.play,t+='\n \n
\n ',t+=s.skip,t+='\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n\n
\n ",l(n(1)(u({theme:a.theme,audio:a.audio,index:1}))),t+="\n
\n
\n"),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n'},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t,n){"use strict";var i,a,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(i===setTimeout)return setTimeout(e,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(e){i=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var u,c=[],p=!1,d=-1;function h(){p&&u&&(p=!1,u.length?c=u.concat(c):d=-1,c.length&&y())}function y(){if(!p){var e=l(h);p=!0;for(var t=c.length;t;){for(u=c,c=[];++d1)for(var n=1;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(35),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=setTimeout;function a(){}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,r._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void l(t.promise,e)}s(t.promise,i)}else(1===e._state?s:l)(t.promise,e._value)})):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":n(t))||"function"==typeof t)){var i=t.then;if(t instanceof r)return e._state=3,e._value=t,void u(e);if("function"==typeof i)return void c((a=i,o=t,function(){a.apply(o,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){l(e,t)}var a,o}function l(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&r._immediateFn(function(){e._handled||r._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t1&&this.container.classList.add("aplayer-withlist"),r.default.isMobile&&this.container.classList.add("aplayer-mobile"),this.arrow=this.container.offsetWidth<=300,this.arrow&&this.container.classList.add("aplayer-arrow"),this.container=this.options.container,2===this.options.lrcType||!0===this.options.lrcType)for(var n=this.container.getElementsByClassName("aplayer-lrc-content"),i=0;i1?(e.notice("An audio error has occurred, player will skip forward in 2 seconds."),t=setTimeout(function(){e.skipForward(),e.paused||e.play()},2e3)):1===e.list.audios.length&&e.notice("An audio error has occurred.")}),this.events.on("listswitch",function(){t&&clearTimeout(t)}),this.on("ended",function(){"none"===e.options.loop?"list"===e.options.order?e.list.index0&&void 0!==arguments[0]?arguments[0]:this.list.audios[this.list.index].theme||this.options.theme,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.list.index;(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&this.list.audios[t]&&(this.list.audios[t].theme=e),this.template.listCurs[t]&&(this.template.listCurs[t].style.backgroundColor=e),t===this.list.index&&(this.template.pic.style.backgroundColor=e,this.template.played.style.background=e,this.template.thumb.style.background=e,this.template.volume.style.background=e)}},{key:"seek",value:function(e){e=Math.max(e,0),e=Math.min(e,this.duration),this.audio.currentTime=e,this.bar.set("played",e/this.duration,"width"),this.template.ptime.innerHTML=r.default.secondToTime(e)}},{key:"setUIPlaying",value:function(){var e=this;if(this.paused&&(this.paused=!1,this.template.button.classList.remove("aplayer-play"),this.template.button.classList.add("aplayer-pause"),this.template.button.innerHTML="",setTimeout(function(){e.template.button.innerHTML=o.default.pause},100),this.template.skipPlayButton.innerHTML=o.default.pause),this.timer.enable("loading"),this.options.mutex)for(var t=0;t=.95?this.template.volumeButton.innerHTML=o.default.volumeUp:this.volume()>0?this.template.volumeButton.innerHTML=o.default.volumeDown:this.template.volumeButton.innerHTML=o.default.volumeOff}},{key:"volume",value:function(e,t){return e=parseFloat(e),isNaN(e)||(e=Math.max(e,0),e=Math.min(e,1),this.bar.set("volume",e,"height"),t||this.storage.set("volume",e),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),this.switchVolumeIcon()),this.audio.muted?0:this.audio.volume}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"toggle",value:function(){this.template.button.classList.contains("aplayer-play")?this.play():this.template.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"switchAudio",value:function(e){this.list.switch(e)}},{key:"addAudio",value:function(e){this.list.add(e)}},{key:"removeAudio",value:function(e){this.list.remove(e)}},{key:"destroy",value:function(){m.splice(m.indexOf(this),1),this.pause(),this.container.innerHTML="",this.audio.src="",this.timer.destroy(),this.events.trigger("destroy")}},{key:"setMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"normal";this.mode=e,"mini"===e?this.container.classList.add("aplayer-narrow"):"normal"===e&&this.container.classList.remove("aplayer-narrow")}},{key:"notice",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.template.notice.innerHTML=e,this.template.notice.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.events.trigger("noticeshow",{text:e}),n&&(this.noticeTime=setTimeout(function(){t.template.notice.style.opacity=0,t.events.trigger("noticehide")},n))}},{key:"prevIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return this.list.index-1<0?this.list.audios.length-1:this.list.index-1;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return 0===e?this.randomOrder[this.randomOrder.length-1]:this.randomOrder[e-1]}}},{key:"nextIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return(this.list.index+1)%this.list.audios.length;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return e===this.randomOrder.length-1?this.randomOrder[0]:this.randomOrder[e+1]}}},{key:"skipBack",value:function(){this.list.switch(this.prevIndex())}},{key:"skipForward",value:function(){this.list.switch(this.nextIndex())}},{key:"duration",get:function(){return isNaN(this.audio.duration)?0:this.audio.duration}}],[{key:"version",get:function(){return"1.10.1"}}]),e}();t.default=g},,function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(40);var i,a=n(38),r=(i=a)&&i.__esModule?i:{default:i};console.log("\n %c APlayer v1.10.1 af84efb %c http://aplayer.js.org \n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),t.default=r.default}]).default});!function(t,e){"object"==typeof exports?module.exports=e(t):"function"==typeof define&&define.amd?define([],e(t)):t.LazyLoad=e(t)}("undefined"!=typeof global?global:this.window||this.global,function(t){"use strict";function e(t,e){this.settings=r(s,e||{}),this.images=t||document.querySelectorAll(this.settings.selector),this.observer=null,this.init()}const s={src:"data-src",srcset:"data-srcset",selector:".lazyload"},r=function(){let t={},e=!1,s=0,o=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],s++);for(;s>>(32-d))}function K(G,k){var I,d,F,H,x;F=(G&2147483648);H=(k&2147483648);I=(G&1073741824);d=(k&1073741824);x=(G&1073741823)+(k&1073741823);if(I&d){return(x^2147483648^F^H)}if(I|d){if(x&1073741824){return(x^3221225472^F^H)}else{return(x^1073741824^F^H)}}else{return(x^F^H)}}function r(d,F,k){return(d&F)|((~d)&k)}function q(d,F,k){return(d&k)|(F&(~k))}function p(d,F,k){return(d^F^k)}function n(d,F,k){return(F^(d|(~k)))}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)}function e(G){var Z;var F=G.length;var x=F+8;var k=(x-(x%64))/64;var I=(k+1)*16;var aa=Array(I-1);var d=0;var H=0;while(H>>29;return aa}function B(x){var k="",F="",G,d;for(d=0;d<=3;d++){G=(x>>>(d*8))&255;F="0"+G.toString(16);k=k+F.substr(F.length-2,2)}return k}function J(k){k=k.replace(/rn/g,"n");var d="";for(var F=0;F127)&&(x<2048)){d+=String.fromCharCode((x>>6)|192);d+=String.fromCharCode((x&63)|128)}else{d+=String.fromCharCode((x>>12)|224);d+=String.fromCharCode(((x>>6)&63)|128);d+=String.fromCharCode((x&63)|128)}}}return d}var C=Array();var P,h,E,v,g,Y,X,W,V;var S=7,Q=12,N=17,M=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;Pe.fixedSidebarOffset?-1===n.className.indexOf(e.positionFixedClass)&&(n.className+=h+e.positionFixedClass):n.className=n.className.split(h+e.positionFixedClass).join("")}function r(t){var n=document.documentElement.scrollTop||f.scrollTop;e.positionFixedSelector&&i();var o,l=t;if(m&&null!==document.querySelector(e.tocSelector)&&l.length>0){d.call(l,function(t,i){if(t.offsetTop>n+e.headingsOffset+10){return o=l[0===i?i:i-1],!0}if(i===l.length-1)return o=l[l.length-1],!0});var r=document.querySelector(e.tocSelector).querySelectorAll("."+e.linkClass);u.call(r,function(t){t.className=t.className.split(h+e.activeLinkClass).join("")});var c=document.querySelector(e.tocSelector).querySelector("."+e.linkClass+".node-name--"+o.nodeName+'[href="#'+o.id+'"]');c.className+=h+e.activeLinkClass;var a=document.querySelector(e.tocSelector).querySelectorAll("."+e.listClass+"."+e.collapsibleClass);u.call(a,function(t){var n=h+e.isCollapsedClass;-1===t.className.indexOf(n)&&(t.className+=h+e.isCollapsedClass)}),c.nextSibling&&(c.nextSibling.className=c.nextSibling.className.split(h+e.isCollapsedClass).join("")),s(c.parentNode.parentNode)}}function s(t){return-1!==t.className.indexOf(e.collapsibleClass)?(t.className=t.className.split(h+e.isCollapsedClass).join(""),s(t.parentNode.parentNode)):t}function c(t){var n=t.target||t.srcElement;"string"==typeof n.className&&-1!==n.className.indexOf(e.linkClass)&&(m=!1)}function a(){m=!0}var u=[].forEach,d=[].some,f=document.body,m=!0,h=" ";return{enableTocAnimation:a,disableTocAnimation:c,render:n,updateToc:r}}},function(e,t){e.exports=function(e){function t(e){return e[e.length-1]}function n(e){return+e.nodeName.split("H").join("")}function o(t){var o={id:t.id,children:[],nodeName:t.nodeName,headingLevel:n(t),textContent:t.textContent.trim()};return e.includeHtml&&(o.childNodes=t.childNodes),o}function l(l,i){for(var r=o(l),s=n(l),c=i,a=t(c),u=a?a.headingLevel:0,d=s-u;d>0;)a=t(c),a&&void 0!==a.children&&(c=a.children),d--;return s>=e.collapseDepth&&(r.isCollapsed=!0),c.push(r),c}function i(t,n){var o=n;e.ignoreSelector&&(o=n.split(",").map(function(t){return t.trim()+":not("+e.ignoreSelector+")"}));try{return document.querySelector(t).querySelectorAll(o)}catch(e){return console.warn("Element not found: "+t),null}}function r(e){return s.call(e,function(e,t){return l(o(t),e.nest),e},{nest:[]})}var s=[].reduce;return{nestHeadingsArray:r,selectHeadings:i}}},function(e,t){function n(e){function t(e){return"a"===e.tagName.toLowerCase()&&(e.hash.length>0||"#"===e.href.charAt(e.href.length-1))&&(n(e.href)===r||n(e.href)+"#"===r)}function n(e){return e.slice(0,e.lastIndexOf("#"))}function l(e){var t=document.getElementById(e.substring(1));t&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}!function(){document.documentElement.style}();var i=e.duration,r=location.hash?n(location.href):location.href;!function(){function e(e){!t(e.target)||e.target.className.indexOf("no-smooth-scroll")>-1||"#"===e.target.href.charAt(e.target.href.length-2)&&"!"===e.target.href.charAt(e.target.href.length-1)||(e.preventDefault(),o(e.target.hash,{duration:i,callback:function(){l(e.target.hash)}}))}document.body.addEventListener("click",e,!1)}()}function o(e,t){function n(e){r=e-i,window.scrollTo(0,c.easing(r,s,u,d)),r65536?(i[0]=240|(1835008&n)>>>18,i[1]=128|(258048&n)>>>12,i[2]=128|(4032&n)>>>6,i[3]=128|63&n):n>2048?(i[0]=224|(61440&n)>>>12,i[1]=128|(4032&n)>>>6,i[2]=128|63&n):n>128?(i[0]=192|(1984&n)>>>6,i[1]=128|63&n):i[0]=n,this.parsedData.push(i)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function e(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function r(t,e){if(void 0==t.length)throw new Error(t.length+"/"+e);for(var r=0;rd.length)throw new Error("Too long data");return r}t.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,r)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(this.modules[t+r][e+i]=0<=r&&r<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=i&&i<=4)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var i=u.getLostPoint(this);(0==r||t>i)&&(t=i,e=r)}return e},createMovieClip:function(t,e,r){var i=t.createEmptyMovieClip(e,r);this.make();for(var n=0;n>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=i}for(r=0;r<18;r++){var i=!t&&1==(e>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=i}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,i=u.getBCHTypeInfo(r),n=0;n<15;n++){o=!t&&1==(i>>n&1);n<6?this.modules[n][8]=o:n<8?this.modules[n+1][8]=o:this.modules[this.moduleCount-15+n][8]=o}for(n=0;n<15;n++){var o=!t&&1==(i>>n&1);n<8?this.modules[8][this.moduleCount-n-1]=o:n<9?this.modules[8][15-n-1+1]=o:this.modules[8][15-n-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,i=this.moduleCount-1,n=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[i][a-s]){var h=!1;o>>n&1));u.getMask(e,i,a-s)&&(h=!h),this.modules[i][a-s]=h,-1==--n&&(o++,n=7)}if((i+=r)<0||this.moduleCount<=i){i-=r,r=-r;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(t,r,o){for(var a=i.getRSBlocks(t,r),s=new n,h=0;h8*c)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*c+")");for(s.getLengthInBits()+4<=8*c&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;;){if(s.getLengthInBits()>=8*c)break;if(s.put(e.PAD0,8),s.getLengthInBits()>=8*c)break;s.put(e.PAD1,8)}return e.createBytes(s,a)},e.createBytes=function(t,e){for(var i=0,n=0,o=0,a=new Array(e.length),s=new Array(e.length),h=0;h=0?d.get(g):0}}for(var p=0,m=0;m=0;)e^=u.G15<=0;)e^=u.G18<>>=1;return e},getPatternPosition:function(t){return u.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case l.PATTERN000:return(e+r)%2==0;case l.PATTERN001:return e%2==0;case l.PATTERN010:return r%3==0;case l.PATTERN011:return(e+r)%3==0;case l.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case l.PATTERN101:return e*r%2+e*r%3==0;case l.PATTERN110:return(e*r%2+e*r%3)%2==0;case l.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new r([1],0),i=0;i5&&(r+=3+n-5)}for(i=0;i=256;)t-=255;return c.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},f=0;f<8;f++)c.EXP_TABLE[f]=1<>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var d=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],g=function(){var t=function(t,e){this._el=t,this._htOption=e};return t.prototype.draw=function(t){function e(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg",t);for(var i in e)e.hasOwnProperty(i)&&r.setAttribute(i,e[i]);return r}var r=this._htOption,i=this._el,n=t.getModuleCount();Math.floor(r.width/n),Math.floor(r.height/n);this.clear();var o=e("svg",{viewBox:"0 0 "+String(n)+" "+String(n),width:"100%",height:"100%",fill:r.colorLight});o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),i.appendChild(o),o.appendChild(e("rect",{fill:r.colorLight,width:"100%",height:"100%"})),o.appendChild(e("rect",{fill:r.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a'],s=0;s");for(var h=0;h');a.push("")}a.push(""),r.innerHTML=a.join("");var l=r.childNodes[0],u=(e.width-l.offsetWidth)/2,c=(e.height-l.offsetHeight)/2;u>0&&c>0&&(l.style.margin=c+"px "+u+"px")},t.prototype.clear=function(){this._el.innerHTML=""},t}():function(){function t(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}if(this._android&&this._android<=2.1){var e=1/window.devicePixelRatio,r=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(t,i,n,o,a,s,h,l,u){if("nodeName"in t&&/img/i.test(t.nodeName))for(var c=arguments.length-1;c>=1;c--)arguments[c]=arguments[c]*e;else void 0===l&&(arguments[1]*=e,arguments[2]*=e,arguments[3]*=e,arguments[4]*=e);r.apply(this,arguments)}}var i=function(t,e){this._bIsPainted=!1,this._android=o(),this._htOption=e,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=e.width,this._elCanvas.height=e.height,t.appendChild(this._elCanvas),this._el=t,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return i.prototype.draw=function(t){var e=this._elImage,r=this._oContext,i=this._htOption,n=t.getModuleCount(),o=i.width/n,a=i.height/n,s=Math.round(o),h=Math.round(a);e.style.display="none",this.clear();for(var l=0;l=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=h}(),function(t,e,r){function i(t,e){var i=function(){var t=arguments;if(u)return u.apply(null,t);var e={};return h(t,function(t){h(t,function(t,r){e[r]=t})}),t[0]=e}({},v,e||{},function(t){if(t.dataset)return JSON.parse(JSON.stringify(t.dataset));var e={};if(t.hasAttributes())return h(t.attributes,function(t){var r=t.name;if(0!==r.indexOf("data-"))return!0;r=r.replace(/^data-/i,"").replace(/-(\w)/g,function(t,e){return e.toUpperCase()}),e[r]=t.value}),e;return{}}(t));i.imageSelector&&(i.image=n(i.imageSelector).map(function(t){return t.src}).join("||")),function(t,e){if(e&&"string"==typeof e){var r=" ";h((t.className+" "+e).split(/\s+/),function(t){r.indexOf(" "+t+" ")<0&&(r+=t+" ")}),t.className=r.slice(1,-1)}}(t,"share-component social-share"),function(t,e){var i=function(t){t.mobileSites.length||(t.mobileSites=t.sites);var e=(f?t.mobileSites:t.sites).slice(0),r=t.disabled;"string"==typeof e&&(e=e.split(/\s*,\s*/));"string"==typeof r&&(r=r.split(/\s*,\s*/));c&&r.push("wechat");return r.length&&h(r,function(t){e.splice(function(t,e,r){var i;if(e){if(l)return l.call(e,t,r);for(i=e.length,r=r?r<0?Math.max(0,i+r):r:0;r');if(!h.length)return!0;h[0].href=o,"wechat"===i?h[0].tabindex=-1:h[0].target="_blank",e.initialized||(n?t.insertBefore(h[0],t.firstChild):t.appendChild(h[0]))})}(t,i),function(t,e){var r=a(t,"icon-wechat","a");if(0===r.length)return!1;var i=s(''+e.wechatQrcodeTitle+'
'+e.wechatQrcodeHelper+"
"),n=a(i[0],"qrcode","div");r[0].appendChild(i[0]),new QRCode(n[0],{text:e.url,width:e.wechatQrcodeSize,height:e.wechatQrcodeSize})}(t,i),t.initialized=!0}function n(r){return(e.querySelectorAll||t.jQuery||t.Zepto||function(t){var r=[];return h(t.split(/\s*,\s*/),function(i){var n=i.match(/([#.])(\w+)/);if(null===n)throw Error("Supports only simple single #ID or .CLASS selector.");if(n[1]){var o=e.getElementById(n[2]);o&&r.push(o)}r=r.concat(a(t))}),r}).call(e,r)}function o(t){return(e.getElementsByName(t)[0]||0).content}function a(t,e,r){if(t.getElementsByClassName)return t.getElementsByClassName(e);var i=[],n=t.getElementsByTagName(r||"*");return e=" "+e+" ",h(n,function(t){(" "+(t.className||"")+" ").indexOf(e)>=0&&i.push(t)}),i}function s(t){var r=e.createElement("div");return r.innerHTML=t,r.childNodes}function h(t,e){var i=t.length;if(i===r){for(var n in t)if(t.hasOwnProperty(n)&&!1===e.call(t[n],t[n],n))break}else for(var o=0;o微信里点“发现”,扫一下
二维码便可将本文分享至朋友圈。
",wechatQrcodeSize:100,sites:["weibo","qq","wechat","tencent","douban","qzone","linkedin","diandian","facebook","twitter","google"],mobileSites:[],disabled:[],initialized:!1},w={qzone:"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={{URL}}&title={{TITLE}}&desc={{DESCRIPTION}}&summary={{SUMMARY}}&site={{SOURCE}}",qq:'http://connect.qq.com/widget/shareqq/index.html?url={{URL}}&title={{TITLE}}&source={{SOURCE}}&desc={{DESCRIPTION}}&pics={{IMAGE}}&summary="{{SUMMARY}}"',tencent:"http://share.v.t.qq.com/index.php?c=share&a=index&title={{TITLE}}&url={{URL}}&pic={{IMAGE}}",weibo:"http://service.weibo.com/share/share.php?url={{URL}}&title={{TITLE}}&pic={{IMAGE}}&appkey={{WEIBOKEY}}",wechat:"javascript:",douban:"http://shuo.douban.com/!service/share?href={{URL}}&name={{TITLE}}&text={{DESCRIPTION}}&image={{IMAGE}}&starid=0&aid=0&style=11",diandian:"http://www.diandian.com/share?lo={{URL}}&ti={{TITLE}}&type=link",linkedin:"http://www.linkedin.com/shareArticle?mini=true&ro=true&title={{TITLE}}&url={{URL}}&summary={{SUMMARY}}&source={{SOURCE}}&armin=armin",facebook:"https://www.facebook.com/sharer/sharer.php?u={{URL}}",twitter:"https://twitter.com/intent/tweet?text={{TITLE}}&url={{URL}}&via={{ORIGIN}}",google:"https://plus.google.com/share?url={{URL}}"};t.socialShare=function(t,e){(t="string"==typeof t?n(t):t).length===r&&(t=[t]),h(t,function(t){t.initialized||i(t,e)})},function(r){var i="addEventListener",n=e[i]?"":"on";~e.readyState.indexOf("m")?r():"load DOMContentLoaded readystatechange".replace(/\w+/g,function(o,a){(a?e:t)[n?"attachEvent":i](n+o,function(){r&&(a<6||~e.readyState.indexOf("m"))&&(r(),r=0)},!1)})}(function(){socialShare(".social-share, .share-component")})}(window,document);}/*!
* baguetteBox.js
* @author feimosi
From be6a6e76c334556ca4e21d0f68eedde23ba1c977 Mon Sep 17 00:00:00 2001
From: Mashiro
Date: Sat, 11 Jan 2020 23:04:31 +0800
Subject: [PATCH 03/14] Update functions.php
---
functions.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/functions.php b/functions.php
index 61728fa..b05c162 100644
--- a/functions.php
+++ b/functions.php
@@ -609,7 +609,9 @@ function get_link_items()
function gravatar_cn($url)
{
$gravatar_url = array('0.gravatar.com', '1.gravatar.com', '2.gravatar.com', 'secure.gravatar.com');
- return str_replace($gravatar_url, 'cn.gravatar.com', $url);
+ //return str_replace($gravatar_url, 'cn.gravatar.com', $url);
+ //官方服务器近期大陆访问 429,建议使用镜像
+ return str_replace( $gravatar_url, 'gravatar.2heng.xin', $url );
}
add_filter('get_avatar_url', 'gravatar_cn', 4);
From 3b8cb192949f6365f5d68a2c8b2cbe0a06d35a21 Mon Sep 17 00:00:00 2001
From: Spirit
Date: Fri, 14 Feb 2020 00:09:01 +0800
Subject: [PATCH 04/14] perf: optmize
---
comments.php | 2 +-
inc/decorate.php | 3 +++
languages/en_US.mo | Bin 1570 -> 1568 bytes
languages/en_US.po | 30 +++++++++++++++---------------
languages/sakura.pot | 28 ++++++++++++++--------------
languages/zh_CN.mo | Bin 34269 -> 34267 bytes
languages/zh_CN.po | 30 +++++++++++++++---------------
tpl/content-none.php | 2 +-
tpl/content-thumb.php | 3 +++
9 files changed, 52 insertions(+), 46 deletions(-)
diff --git a/comments.php b/comments.php
index cbb5bbd..cf995b4 100644
--- a/comments.php
+++ b/comments.php
@@ -88,7 +88,7 @@
'comment_notes_after' => '',
'comment_notes_before' => '',
'fields' => apply_filters( 'comment_form_default_fields', array(
- 'avatar' => '',
+ 'avatar' => '
',
'author' =>
'',
'email' =>
diff --git a/inc/decorate.php b/inc/decorate.php
index 14855e0..b2a4691 100644
--- a/inc/decorate.php
+++ b/inc/decorate.php
@@ -61,6 +61,9 @@ if ( akina_option('theme_skin') ) { ?>
}
+.post-list-thumb{opacity: 0}
+.post-list-show {opacity: 1}
+
$&PpmaKr<^=LffHWVFt^?8nK)M%5
zvjFLNK$-(cF9y;eb!&h$8<5@x%>$%kpmZjX<^=M~fHWVFZUE8(K)N4D
zvjFJ@K$-(cF9p&db?bmM8<5@sXv=~t{k;{<^WCZK9wAT6@l
hl5ry=m!YnKxq_j&m67@6FH9?#jr2@5&t-0A0ssZ=7O?;T
diff --git a/languages/en_US.po b/languages/en_US.po
index 34958bd..7f47aa0 100644
--- a/languages/en_US.po
+++ b/languages/en_US.po
@@ -1,15 +1,15 @@
msgid ""
msgstr ""
"Project-Id-Version: Sakura\n"
-"POT-Creation-Date: 2020-01-07 17:27+0800\n"
-"PO-Revision-Date: 2020-01-07 17:27+0800\n"
+"POT-Creation-Date: 2020-02-13 23:59+0800\n"
+"PO-Revision-Date: 2020-02-13 23:59+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.2.4\n"
+"X-Generator: Poedit 2.3\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
@@ -181,35 +181,35 @@ msgstr ""
msgid "This guy is so lazy ╮(╯▽╰)╭"
msgstr ""
-#: functions.php:1327
+#: functions.php:1329
msgid "All expand/collapse"
msgstr ""
-#: functions.php:1348 options.php:834
+#: functions.php:1350 options.php:834
msgid " "
msgstr ""
-#: functions.php:1352
+#: functions.php:1354
msgid " post(s)"
msgstr ""
-#: functions.php:1375 functions.php:1378 inc/theme_plus.php:478
+#: functions.php:1377 functions.php:1380 inc/theme_plus.php:478
msgid "Dashboard"
msgstr ""
-#: functions.php:1604
+#: functions.php:1606
msgid "
ERROR: This email domain (
@"
msgstr ""
-#: functions.php:1709
+#: functions.php:1711
msgid "QQ"
msgstr ""
-#: functions.php:1779
+#: functions.php:1781
msgid "Sidebar"
msgstr ""
-#: functions.php:1891
+#: functions.php:1893
msgid ""
" For a better experience, please do not set permalink as plain. To do this, you may need to "
@@ -1710,17 +1710,17 @@ msgstr "Search result: %s"
msgid "NOTHING"
msgstr ""
-#: tpl/content-image.php:35 tpl/content-status.php:31 tpl/content-thumb.php:53
+#: tpl/content-image.php:35 tpl/content-status.php:31 tpl/content-thumb.php:56
#: tpl/content.php:34
msgid "Comment"
msgstr ""
-#: tpl/content-image.php:35 tpl/content-status.php:31 tpl/content-thumb.php:53
+#: tpl/content-image.php:35 tpl/content-status.php:31 tpl/content-thumb.php:56
#: tpl/content.php:34
msgid "Comments"
msgstr ""
-#: tpl/content-image.php:38 tpl/content-status.php:34 tpl/content-thumb.php:52
+#: tpl/content-image.php:38 tpl/content-status.php:34 tpl/content-thumb.php:55
#: tpl/content.php:37
msgid "Hit"
msgid_plural "Hits"
@@ -1728,7 +1728,7 @@ msgstr[0] ""
msgstr[1] ""
#: tpl/content-none.php:14
-msgid "There is noyhing here!"
+msgid "There is nothing here!"
msgstr ""
#: tpl/content-none.php:21
diff --git a/languages/sakura.pot b/languages/sakura.pot
index 54cb12a..146179a 100644
--- a/languages/sakura.pot
+++ b/languages/sakura.pot
@@ -3,14 +3,14 @@ msgid ""
msgstr ""
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"Project-Id-Version: Sakura\n"
-"POT-Creation-Date: 2020-01-07 17:27+0800\n"
+"POT-Creation-Date: 2020-02-13 23:59+0800\n"
"PO-Revision-Date: 2019-11-01 14:27+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.2.4\n"
+"X-Generator: Poedit 2.3\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
"X-Poedit-WPHeader: style.css\n"
@@ -180,35 +180,35 @@ msgstr ""
msgid "This guy is so lazy ╮(╯▽╰)╭"
msgstr ""
-#: functions.php:1327
+#: functions.php:1329
msgid "All expand/collapse"
msgstr ""
-#: functions.php:1348 options.php:834
+#: functions.php:1350 options.php:834
msgid " "
msgstr ""
-#: functions.php:1352
+#: functions.php:1354
msgid " post(s)"
msgstr ""
-#: functions.php:1375 functions.php:1378 inc/theme_plus.php:478
+#: functions.php:1377 functions.php:1380 inc/theme_plus.php:478
msgid "Dashboard"
msgstr ""
-#: functions.php:1604
+#: functions.php:1606
msgid "ERROR: This email domain (@"
msgstr ""
-#: functions.php:1709
+#: functions.php:1711
msgid "QQ"
msgstr ""
-#: functions.php:1779
+#: functions.php:1781
msgid "Sidebar"
msgstr ""
-#: functions.php:1891
+#: functions.php:1893
msgid ""
" For a better experience, please do not set "
"permalink as plain. To do this, you may need to configure tFX8WSP5jNHH$U`!(!Q8Uy`af1|G8ce`jW^WM36wO>;
zm^!XgiA@uYODXgE*BQ&=_4FXTAtfsb(reu)$C7WTv9>E3eG0#=~v9GPe}tun|Y$KFq~V)bk0?`URw7
zFXAkVAHy)>;1d+0D3qcGoQ+Cdopo4;8fc5T*Xo;5{f?QRp)zwB8sH%6!IS1iYyTZJQRp1M!#=2fv8eiV%)k+51)d__
ziaP7LbDg^nt5Ng4jzK+mh{9TYAHT(-d49l@`96hNsD2Ysuh~ot#bstKDz&Rnw||4x
z?=W{`4)q7I6fdC`{@?=guLp}3_yMNiPU3mE2}3KKdlI*!cJLGG!E0u>N}tMD)LG}C
z7CH&@aTY40yKoq`q85G~)$evC`G1%~#PfcF$59Q%sE%c*vz~>zbk*1&8&PNfCh7}!
z6xIJUYN2N>zJyxvRn$hiusen=^l|SX1$}ASwcR(TW6408->=Ow6tDp46)
zj!OAP)CQW7<944~dv>*D7|B%7m086ca|!B86~u5{k4oWo)PQfHcK8u$;&$wd=TWKs
z6{GMv>av9{CRc^ony8|`;F>618DO%B26f{7WHMnJd=aHzp5rbMl5^BP9RR1wnUxZp{
zsm0~yVpRW?7O%H>r}+*BHBcJ`c?$JO{Q@=N&zOQYuoou0;8UA{N_8GaViD>tOu|^K
zLfwG|)Oh<*<9vv90q1_eRO0d)^1qG3x*C4jaOiTr(>M?HEA}<^!6*(;zX^kIGy~LQ
z0r3Yb{G|)j`UNLo9QCO<7z;587hyiG!#F&HcQ#l{{*|H|RuNI>;}~8_#{_77^sk*obcv8dadjM+FI
z)gH9=Mzaa^{8no}Z1pXu4_hlnOry|l9nP7Z=AWq4{fEj#&sY6`X{gsR9}BSrweUAk
z3u!@Z;6(HO0hjI$A$<)AD?7fOokwWxC06(X&O5&Q7*uYB4Zkcfu^XLq8O&2W^TM%=7%I^4AD$e
zKd4!`)Sxy^G>$`qnM&GbLXO#F*tATmlUmyU^4y<(=RW5=XSvULp7(9r7<_4C@H^j!
z2WoMCJc^am{X$Nl9{3ms;g?v5cd$DamU_!j3s{ZnUxUizHggYZ
zV~4H%7;5KD7=>2@)^Obnnc-I+g&MHGnT~^rM_N1|mAPdYi?uic-@@V8j(R?Rre8oZ
zb|KEPcno$V4m?7kGlgQ*fOAo)tF{iCPy=l@_gno@RKMfqXQ<3v#W=iWaj#jvUn-_k
zpNkr=${TP23Q9>0DpiM&<8?=|FGfA-9Gh`zs0V9NJKm03@OwB0&!HyhG24%mkBP(+
zu|F&EHSmJhzQ=jsw8j9*S8YA#A)EUk~Evyo?;A*@d
zUq|(C#%#QZld$U?%d}*ES4}~w+lm_CAnL(0=4EUD12s|TT))HasD5#%`ZP?#5oQIR
zCf-lBQ-G^1E`Ci3<9y~+s6ZM)_UFgsYUf3$ffk}N
zv=Wu_EvO9~MULB@w)P>5EyGBr0S-pK8RjT+JZgX`7SBd~+ZUmZ
zvL5x%XNSd~V=i$k>L}u>oqGTSxfFCp3o#!zpmy3~wwc#Z6aH=S9kUY|)WE$_hXOw=3s4+R}T%v%35nSz>V9>!rM)?qE`OV@9mzdQqQU=Xhu
zYT^~o`+;9EcVRL02T%(MdBL}b;a1|FcVi|$OhFSiVj?!9F5NZM!v00AIC8xoC=PXd
z`(q|fM76K8_FA(Z_52QNKWz1ls1I8chEJ!^VjWt|cJnV(>VjVMndpKVFctMW=Hgf^
zLM{9?)Iu6j8#vYQX3xv_1osZAd#O)#uyYMzeLo!(w4$Lk|8{s-MoRkdgpA=2Wo6cV
RSF}GQGj&MA#>s^l{{!VcrSt#*
diff --git a/languages/zh_CN.po b/languages/zh_CN.po
index da5ad02..b65aad9 100644
--- a/languages/zh_CN.po
+++ b/languages/zh_CN.po
@@ -1,15 +1,15 @@
msgid ""
msgstr ""
"Project-Id-Version: Sakura\n"
-"POT-Creation-Date: 2020-01-07 17:29+0800\n"
-"PO-Revision-Date: 2020-01-07 17:32+0800\n"
+"POT-Creation-Date: 2020-02-13 23:59+0800\n"
+"PO-Revision-Date: 2020-02-13 23:59+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.2.4\n"
+"X-Generator: Poedit 2.3\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
@@ -183,35 +183,35 @@ msgstr ""
msgid "This guy is so lazy ╮(╯▽╰)╭"
msgstr "这家伙好懒╮(╯▽╰)╭"
-#: functions.php:1327
+#: functions.php:1329
msgid "All expand/collapse"
msgstr "全部展开/收缩"
-#: functions.php:1348 options.php:834
+#: functions.php:1350 options.php:834
msgid " "
msgstr ""
-#: functions.php:1352
+#: functions.php:1354
msgid " post(s)"
msgstr " 篇文章"
-#: functions.php:1375 functions.php:1378 inc/theme_plus.php:478
+#: functions.php:1377 functions.php:1380 inc/theme_plus.php:478
msgid "Dashboard"
msgstr "管理中心"
-#: functions.php:1604
+#: functions.php:1606
msgid "ERROR: This email domain (@"
msgstr ""
-#: functions.php:1709
+#: functions.php:1711
msgid "QQ"
msgstr ""
-#: functions.php:1779
+#: functions.php:1781
msgid "Sidebar"
msgstr "侧栏"
-#: functions.php:1891
+#: functions.php:1893
msgid ""
" For a better experience, please do not set permalink as plain. To do this, you may need to "
@@ -1764,24 +1764,24 @@ msgstr "关于 %s 的搜索结果:"
msgid "NOTHING"
msgstr "啥也没有呀"
-#: tpl/content-image.php:35 tpl/content-status.php:31 tpl/content-thumb.php:53
+#: tpl/content-image.php:35 tpl/content-status.php:31 tpl/content-thumb.php:56
#: tpl/content.php:34
msgid "Comment"
msgstr "条评论"
-#: tpl/content-image.php:35 tpl/content-status.php:31 tpl/content-thumb.php:53
+#: tpl/content-image.php:35 tpl/content-status.php:31 tpl/content-thumb.php:56
#: tpl/content.php:34
msgid "Comments"
msgstr "条评论"
-#: tpl/content-image.php:38 tpl/content-status.php:34 tpl/content-thumb.php:52
+#: tpl/content-image.php:38 tpl/content-status.php:34 tpl/content-thumb.php:55
#: tpl/content.php:37
msgid "Hit"
msgid_plural "Hits"
msgstr[0] "热度"
#: tpl/content-none.php:14
-msgid "There is noyhing here!"
+msgid "There is nothing here!"
msgstr "没有找到任何东西!"
#: tpl/content-none.php:21
diff --git a/tpl/content-none.php b/tpl/content-none.php
index dd894e6..0bc309f 100644
--- a/tpl/content-none.php
+++ b/tpl/content-none.php
@@ -11,7 +11,7 @@
diff --git a/tpl/content-thumb.php b/tpl/content-thumb.php
index 1c668dc..c59747b 100644
--- a/tpl/content-thumb.php
+++ b/tpl/content-thumb.php
@@ -24,6 +24,9 @@ switch (akina_option('feature_align')) {
default:
$class = ($i%2 == 0) ? 'post-list-thumb-left' : '';
}
+if( $i == 1 ){
+ $class .= ' post-list-show';
+}
if(has_post_thumbnail()){
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large');
$post_img = $large_image_url[0];
From b17576867f9cdccffe83e52b1755fda8e44c3635 Mon Sep 17 00:00:00 2001
From: Spirit
Date: Mon, 24 Feb 2020 00:27:02 +0800
Subject: [PATCH 05/14] perf: remove ua Edge Dev (Chromium)
---
inc/theme_plus.php | 3 ---
1 file changed, 3 deletions(-)
diff --git a/inc/theme_plus.php b/inc/theme_plus.php
index d90a8ee..95a0b2a 100644
--- a/inc/theme_plus.php
+++ b/inc/theme_plus.php
@@ -791,9 +791,6 @@ function siren_get_browsers($ua){
}elseif (preg_match('#Edge/([a-zA-Z0-9.]+)#i', $ua, $matches)){
$title = 'Edge '. $matches[1];
$icon = 'edge';
- }elseif (preg_match('#Edg/([a-zA-Z0-9.]+)#i', $ua, $matches)){
- $title = 'Edge Dev (Chromium) '. $matches[1];
- $icon = 'edge';
}elseif (preg_match('#360([a-zA-Z0-9.]+)#i', $ua, $matches)) {
$title = '360 Browser '. $matches[1];
$icon = '360se';
From c0f0990ff037f377f17dd0206192caed658705b2 Mon Sep 17 00:00:00 2001
From: Spirit
Date: Fri, 6 Mar 2020 00:08:36 +0800
Subject: [PATCH 06/14] perf: optmize
---
inc/api.php | 2 +-
js/sakura-app.js | 44 +++++++++++++++++++++++++++-----------------
2 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/inc/api.php b/inc/api.php
index a640a08..11e5ee9 100644
--- a/inc/api.php
+++ b/inc/api.php
@@ -402,7 +402,7 @@ function get_qq_avatar(){
$encrypted=$_GET["qq"];
if(isset($encrypted)){
$iv = str_repeat($sakura_privkey, 2);
- $encrypted = urldecode(base64_decode($encrypted));
+ $encrypted = base64_decode(urldecode($encrypted));
$qq_number = openssl_decrypt($encrypted, 'aes-128-cbc', $sakura_privkey, 0, $iv);
preg_match('/^\d{3,}$/', $qq_number, $matches);
$imgurl='https://q2.qlogo.cn/headimg_dl?dst_uin='.$matches[0].'&spec=100';
diff --git a/js/sakura-app.js b/js/sakura-app.js
index b581098..97697e1 100644
--- a/js/sakura-app.js
+++ b/js/sakura-app.js
@@ -5,6 +5,7 @@
* @date 2019.8.3
*/
mashiro_global.variables = new function () {
+ this.has_hls = false;
this.skinSecter = true;
}
mashiro_global.ini = new function () {
@@ -523,25 +524,34 @@ function killCoverVideo() {
}
}
+function loadHls(){
+ var video = addComment.I('coverVideo');
+ var video_src = $('#coverVideo').attr('data-src');
+ if (Hls.isSupported()) {
+ var hls = new Hls();
+ hls.loadSource(video_src);
+ hls.attachMedia(video);
+ hls.on(Hls.Events.MANIFEST_PARSED, function () {
+ video.play();
+ });
+ } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
+ video.src = video_src;
+ video.addEventListener('loadedmetadata', function () {
+ video.play();
+ });
+ }
+}
+
function coverVideoIni() {
if ($('video').hasClass('hls')) {
- $.getScript("https://cdn.jsdelivr.net/gh/mashirozx/Sakura@3.3.3/cdn/js/src/16.hls.js", function(){
- var video = addComment.I('coverVideo');
- var video_src = $('#coverVideo').attr('data-src');
- if (Hls.isSupported()) {
- var hls = new Hls();
- hls.loadSource(video_src);
- hls.attachMedia(video);
- hls.on(Hls.Events.MANIFEST_PARSED, function () {
- video.play();
- });
- } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
- video.src = video_src;
- video.addEventListener('loadedmetadata', function () {
- video.play();
- });
- }
- });
+ if (mashiro_global.variables.has_hls){
+ loadHls();
+ }else{
+ $.getScript("https://cdn.jsdelivr.net/gh/mashirozx/Sakura@3.3.3/cdn/js/src/16.hls.js", function(){
+ loadHls();
+ mashiro_global.variables.has_hls = true;
+ });
+ }
//console.info('ini:coverVideoIni()');
}
}
From aa221716b1eabbc3b9a7299536079b9d93e13674 Mon Sep 17 00:00:00 2001
From: Parasomnia
Date: Fri, 6 Mar 2020 17:59:17 +0800
Subject: [PATCH 07/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=B1=E5=88=87?=
=?UTF-8?q?=E6=8D=A2qq=E5=A4=B4=E5=83=8F=E5=92=8Cgravatar=E5=A4=B4?=
=?UTF-8?q?=E5=83=8F=E5=AF=BC=E8=87=B4=E7=9A=84=E6=8A=A5=E9=94=99=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
js/sakura-app.js | 87 +++++++++++++++++++++++++-----------------------
1 file changed, 45 insertions(+), 42 deletions(-)
diff --git a/js/sakura-app.js b/js/sakura-app.js
index b581098..5ccca36 100644
--- a/js/sakura-app.js
+++ b/js/sakura-app.js
@@ -864,53 +864,56 @@ function getqqinfo() {
}
var emailAddressFlag = cached.filter('#email').val();
cached.filter('#author').on('blur', function () {
- var qq = cached.filter('#author').val();
- $.ajax({
- type: 'get',
- url: mashiro_option.qq_api_url + '?qq=' + qq + '&_wpnonce=' + Poi.nonce,
- dataType: 'json',
- success: function (data) {
- cached.filter('#author').val(data.name);
- cached.filter('#email').val($.trim(qq) + '@qq.com');
- if (mashiro_option.qzone_autocomplete) {
- cached.filter('#url').val('https://user.qzone.qq.com/' + $.trim(qq));
- }
- $('div.comment-user-avatar img').attr('src', 'https://q2.qlogo.cn/headimg_dl?dst_uin=' + qq + '&spec=100');
- is_get_by_qq = true;
- cached.filter('#qq').val($.trim(qq));
- if (cached.filter('#qq').val()) {
- $('.qq-check').css('display', 'block');
- $('.gravatar-check').css('display', 'none');
- }
- setCookie('user_author', data.name, 30);
- setCookie('user_qq', qq, 30);
- setCookie('is_user_qq', 'yes', 30);
- setCookie('user_qq_email', qq + '@qq.com', 30);
- setCookie('user_email', qq + '@qq.com', 30);
- emailAddressFlag = cached.filter('#email').val();
- /***/
- $('div.comment-user-avatar img').attr('src', data.avatar);
- setCookie('user_avatar', data.avatar, 30);
- },
- error: function () {
- cached.filter('#qq').val('');
- $('.qq-check').css('display', 'none');
- $('.gravatar-check').css('display', 'block');
- $('div.comment-user-avatar img').attr('src', get_gravatar(cached.filter('#email').val(), 80));
- setCookie('user_qq', '', 30);
- setCookie('user_email', cached.filter('#email').val(), 30);
- setCookie('user_avatar', get_gravatar(cached.filter('#email').val(), 80), 30);
- /***/
- cached.filter('#qq,#email,#url').val('');
- if (!cached.filter('#qq').val()) {
+ var qq = cached.filter('#author').val(),
+ $reg = /^[1-9]\d{4,9}$/;
+ if ($reg.test(qq)) {
+ $.ajax({
+ type: 'get',
+ url: mashiro_option.qq_api_url + '?qq=' + qq + '&_wpnonce=' + Poi.nonce,
+ dataType: 'json',
+ success: function (data) {
+ cached.filter('#author').val(data.name);
+ cached.filter('#email').val($.trim(qq) + '@qq.com');
+ if (mashiro_option.qzone_autocomplete) {
+ cached.filter('#url').val('https://user.qzone.qq.com/' + $.trim(qq));
+ }
+ $('div.comment-user-avatar img').attr('src', 'https://q2.qlogo.cn/headimg_dl?dst_uin=' + qq + '&spec=100');
+ is_get_by_qq = true;
+ cached.filter('#qq').val($.trim(qq));
+ if (cached.filter('#qq').val()) {
+ $('.qq-check').css('display', 'block');
+ $('.gravatar-check').css('display', 'none');
+ }
+ setCookie('user_author', data.name, 30);
+ setCookie('user_qq', qq, 30);
+ setCookie('is_user_qq', 'yes', 30);
+ setCookie('user_qq_email', qq + '@qq.com', 30);
+ setCookie('user_email', qq + '@qq.com', 30);
+ emailAddressFlag = cached.filter('#email').val();
+ /***/
+ $('div.comment-user-avatar img').attr('src', data.avatar);
+ setCookie('user_avatar', data.avatar, 30);
+ },
+ error: function () {
+ cached.filter('#qq').val('');
$('.qq-check').css('display', 'none');
$('.gravatar-check').css('display', 'block');
- setCookie('user_qq', '', 30);
$('div.comment-user-avatar img').attr('src', get_gravatar(cached.filter('#email').val(), 80));
+ setCookie('user_qq', '', 30);
+ setCookie('user_email', cached.filter('#email').val(), 30);
setCookie('user_avatar', get_gravatar(cached.filter('#email').val(), 80), 30);
+ /***/
+ cached.filter('#qq,#email,#url').val('');
+ if (!cached.filter('#qq').val()) {
+ $('.qq-check').css('display', 'none');
+ $('.gravatar-check').css('display', 'block');
+ setCookie('user_qq', '', 30);
+ $('div.comment-user-avatar img').attr('src', get_gravatar(cached.filter('#email').val(), 80));
+ setCookie('user_avatar', get_gravatar(cached.filter('#email').val(), 80), 30);
+ }
}
- }
- });
+ });
+ }
// $.ajax({
// type: 'get',
// url: mashiro_option.qq_avatar_api_url + '?type=getqqavatar&qq=' + qq,
From 67dffdbfa419b88f1d36b4e0689fabe7857f7132 Mon Sep 17 00:00:00 2001
From: Spirit
Date: Thu, 19 Mar 2020 16:03:06 +0800
Subject: [PATCH 08/14] feat: Google Analytics adaptation
---
functions.php | 1 +
js/sakura-app.js | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/functions.php b/functions.php
index b05c162..1e9dd90 100644
--- a/functions.php
+++ b/functions.php
@@ -215,6 +215,7 @@ function sakura_scripts()
'reply_link_version' => $reply_link_version,
'api' => esc_url_raw(rest_url()),
'nonce' => wp_create_nonce('wp_rest'),
+ 'google_analytics_id' => akina_option('google_analytics_id', '')
));
}
add_action('wp_enqueue_scripts', 'sakura_scripts');
diff --git a/js/sakura-app.js b/js/sakura-app.js
index a81b2d6..4943397 100644
--- a/js/sakura-app.js
+++ b/js/sakura-app.js
@@ -1751,6 +1751,11 @@ var home = location.href,
$('#loading-comments').after(result.fadeIn(500));
$('ul.commentwrap').after(nextlink);
lazyload();
+ if (window.gtag) {
+ gtag('config', Poi.google_analytics_id, {
+ 'page_path': path
+ });
+ }
code_highlight_style();
click_to_view_image();
}
@@ -1838,6 +1843,12 @@ $(function () {
$.getScript("//static.duoshuo.com/embed.js");
}
}
+ }).on('pjax:end', function() {
+ if (window.gtag){
+ gtag('config', Poi.google_analytics_id, {
+ 'page_path': window.location.pathname
+ });
+ }
}).on('submit', '.search-form,.s-search', function (event) {
event.preventDefault();
$.pjax.submit(event, '#page', {
From 499d2c324e907590cd14b1b9ec33121bc2201799 Mon Sep 17 00:00:00 2001
From: Spirit
Date: Fri, 20 Mar 2020 11:02:52 +0800
Subject: [PATCH 09/14] refactor: first screen the Above The Fold of mobile not
depend wp_is_mobile anymore, and window height is set `vh` to fit issue-199
---
functions.php | 6 +++---
inc/swicher.php | 1 +
js/sakura-app.js | 16 +++-------------
3 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/functions.php b/functions.php
index 1e9dd90..450e8ec 100644
--- a/functions.php
+++ b/functions.php
@@ -199,9 +199,9 @@ function sakura_scripts()
$movies = akina_option('focus_amv') ? array('url' => akina_option('amv_url'), 'name' => akina_option('amv_title'), 'live' => $mv_live) : 'close';
$auto_height = akina_option('focus_height') ? 'fixed' : 'auto';
$code_lamp = 'close';
- if (wp_is_mobile()) {
- $auto_height = 'fixed';
- }
+ // if (wp_is_mobile()) {
+ // $auto_height = 'fixed';
+ // }
//拦截移动端
version_compare($GLOBALS['wp_version'], '5.1', '>=') ? $reply_link_version = 'new' : $reply_link_version = 'old';
wp_localize_script('app', 'Poi', array(
diff --git a/inc/swicher.php b/inc/swicher.php
index 7f0ca16..ad8c560 100644
--- a/inc/swicher.php
+++ b/inc/swicher.php
@@ -73,6 +73,7 @@ mashiro_option.float_player_on = true;
mashiro_option.cover_api = "";
+mashiro_option.windowheight = /Mobile|Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? 'fixed' : 'auto';
/*End of Initial Variables*/
0) {
var _height = $(window).height() + "px";
$('#centerbg').css({
- 'height': _height
+ 'height': '100vh'
});
$('#bgvideo').css({
- 'min-height': _height
+ 'min-height': '100vh'
});
- window.resizeFlag = null;
- $(window).resize(function () {
- //直接resize性能爆炸,改成延时
- if (resizeFlag = null) {
- clearTimeout(resizeFlag);
- }
- resizeFlag = setTimeout(function () {
- Siren.AH();
- }, 1000);
- })
}
} else {
$('.headertop').addClass('headertop-bar');
From 130c8802dd7c881e5e4239ab226bc2feb6169d4a Mon Sep 17 00:00:00 2001
From: Spirit
Date: Fri, 20 Mar 2020 12:28:01 +0800
Subject: [PATCH 10/14] refactor: cd_to_top and change_skin button back-to-top
button function and mobile button animation issue-199
---
js/sakura-app.js | 81 +++++++++++++++++++++++++-----------------------
style.css | 7 ++---
2 files changed, 45 insertions(+), 43 deletions(-)
diff --git a/js/sakura-app.js b/js/sakura-app.js
index 32abbaa..9c2cc6d 100644
--- a/js/sakura-app.js
+++ b/js/sakura-app.js
@@ -417,22 +417,15 @@ $(document).ready(function () {
preBG();
});
});
-if (document.body.clientWidth <= 860) {
- window.onscroll = function () {
- scrollFunction()
- };
- function scrollFunction() {
- if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
- addComment.I("moblieGoTop").style.display = "block";
- } else {
- addComment.I("moblieGoTop").style.display = "none";
- }
- }
-
- function topFunction() {
- document.body.scrollTop = 0;
- document.documentElement.scrollTop = 0;
+function topFunction() {
+ if ('scrollBehavior' in document.documentElement.style) {
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth"
+ })
+ } else {
+ window.scrollSmoothTo(0)
}
}
@@ -1758,36 +1751,46 @@ var home = location.href,
document.body.addEventListener('input', POWERMODE)
},
GT: function () {
- var offset = 100,
- offset_opacity = 1200,
- scroll_top_duration = 700,
- $back_to_top = $('.cd-top');
- $(window).scroll(function () {
- if ($(this).scrollTop() > offset) {
- $back_to_top.addClass('cd-is-visible');
- $(".changeSkin-gear").css("bottom", "0");
- if ($(window).height() > 950) {
- $(".cd-top.cd-is-visible").css("top", "0");
+ var cwidth = document.body.clientWidth,
+ cheight = window.innerHeight,
+ pc_to_top = document.querySelector(".cd-top"),
+ mb_to_top = document.querySelector("#moblieGoTop"),
+ changeskin = document.querySelector(".changeSkin-gear");
+
+ $(window).scroll(function() {
+ if (cwidth <= 860) {
+ if ($(this).scrollTop() > 20) {
+ mb_to_top.style.display = "block";
} else {
- $(".cd-top.cd-is-visible").css("top", ($(window).height() - 950) + "px");
+ mb_to_top.style.display = "none";
}
} else {
- $(".changeSkin-gear").css("bottom", "-999px");
- $(".cd-top.cd-is-visible").css("top", "-900px");
- $back_to_top.removeClass('cd-is-visible cd-fade-out');
- }
- if ($(this).scrollTop() > offset_opacity) {
- $back_to_top.addClass('cd-fade-out');
+ if ($(this).scrollTop() > 100) {
+ pc_to_top.classList.add("cd-is-visible");
+ changeskin.style.bottom = "0";
+ if (cheight > 950) {
+ pc_to_top.style.top = "0";
+ } else {
+ pc_to_top.style.top = cheight - 950 + "px";
+ }
+ } else {
+ changeskin.style.bottom = "-999px";
+ pc_to_top.style.top = "-999px";
+ pc_to_top.classList.remove("cd-fade-out", "cd-is-visible");
+ }
+ if ($(this).scrollTop() > 1200) {
+ pc_to_top.classList.add("cd-fade-out");
+ }
}
});
+
//smooth scroll to top
- $back_to_top.on('click', function (event) {
- event.preventDefault();
- $('body,html').animate({
- scrollTop: 0,
- }, scroll_top_duration);
- return false;
- });
+ mb_to_top.onclick = function() {
+ topFunction();
+ }
+ pc_to_top.onclick = function() {
+ topFunction();
+ }
}
}
$(function () {
diff --git a/style.css b/style.css
index c80cb53..8c121db 100644
--- a/style.css
+++ b/style.css
@@ -1870,7 +1870,6 @@ h1.page-title.mb- {
}
#moblieGoTop {
- display: none;
position: fixed;
bottom: 10px;
right: 10px;
@@ -1884,9 +1883,9 @@ h1.page-title.mb- {
border-radius: 10px;
border-radius: 12px;
box-shadow: 0 0 2px 0 rgba(0, 0, 0, .12), 0 2px 2px 0 rgba(0, 0, 0, .24);
- transition: box-shadow .2s ease
+ transform: scale(0);
+ transition:transform .3s
}
-
#moblieGoTop:hover {
background-color: #fff;
opacity: .8
@@ -4260,7 +4259,7 @@ i.iconfont.js-toggle-search.iconsearch {
.s-search input {
font-size: 1rem;
- background: #none;
+ background: none;
padding: 12px 24px 12px 64px;
width: 100%;
outline: 0;
From 164a977f028376f078753b280de3fd971fe06662 Mon Sep 17 00:00:00 2001
From: Spirit
Date: Fri, 20 Mar 2020 16:53:06 +0800
Subject: [PATCH 11/14] refactor: remove and optimize remove some unuseful
code, change timeline animation issue-199
---
js/sakura-app.js | 50 +++++++++++++++++++++++++-----------------------
1 file changed, 26 insertions(+), 24 deletions(-)
diff --git a/js/sakura-app.js b/js/sakura-app.js
index 9c2cc6d..14be44a 100644
--- a/js/sakura-app.js
+++ b/js/sakura-app.js
@@ -470,10 +470,20 @@ function timeSeriesReload(flag) {
var al_expand_collapse_click = 0;
$('#al_expand_collapse').click(function () {
if (al_expand_collapse_click == 0) {
- $al_post_list.show(400);
+ $al_post_list.each(function(index){
+ var $this = $(this),
+ s = setTimeout(function() {
+ $this.show(400);
+ }, 50 * index);
+ });
al_expand_collapse_click++;
} else if (al_expand_collapse_click == 1) {
- $al_post_list.hide(400);
+ $al_post_list.each(function(index){
+ var $this = $(this),
+ h = setTimeout(function() {
+ $this.hide(400);
+ }, 50 * index);
+ });
al_expand_collapse_click--;
}
});
@@ -1222,13 +1232,6 @@ var home = location.href,
Siren = {
MN: function () {
$('.iconflat').on('click', function () {
- if ($("#main-container").hasClass("open")) {
- $('.iconflat').css('width', '50px').css('height', '50px');
- $('.openNav').css('height', '50px');
- } else {
- $('.iconflat').css('width', '100%').css('height', '100%');
- $('.openNav').css('height', '100%');
- }
$('body').toggleClass('navOpen');
$('#main-container,#mo-nav,.openNav').toggleClass('open');
});
@@ -1530,17 +1533,19 @@ var home = location.href,
});
},
NH: function () {
- var h1 = 0;
- $(window).scroll(function () {
- var s = $(document).scrollTop(),
- cached = $('.site-header');
- if (s == h1) {
- cached.removeClass('yya');
- }
- if (s > h1) {
- cached.addClass('yya');
- }
+ if(document.body.clientWidth > 860){
+ var h1 = 0;
+ $(window).scroll(function () {
+ var s = $(document).scrollTop(),
+ cached = $('.site-header');
+ if (s == h1) {
+ cached.removeClass('yya');
+ }
+ if (s > h1) {
+ cached.addClass('yya');
+ }
});
+ }
},
XLS: function () {
$body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');
@@ -1760,9 +1765,9 @@ var home = location.href,
$(window).scroll(function() {
if (cwidth <= 860) {
if ($(this).scrollTop() > 20) {
- mb_to_top.style.display = "block";
+ mb_to_top.style.transform = "scale(1)";
} else {
- mb_to_top.style.display = "none";
+ mb_to_top.style.transform = "scale(0)";
}
} else {
if ($(this).scrollTop() > 100) {
@@ -1785,9 +1790,6 @@ var home = location.href,
});
//smooth scroll to top
- mb_to_top.onclick = function() {
- topFunction();
- }
pc_to_top.onclick = function() {
topFunction();
}
From 57c541e6db5a2fabf27f3da5d6eb4db9a2de6595 Mon Sep 17 00:00:00 2001
From: Spirit
Date: Sat, 21 Mar 2020 16:13:01 +0800
Subject: [PATCH 12/14] perf: imporve post list float animation use css
will-change to improve performance issue #199
---
js/sakura-app.js | 2 ++
style.css | 24 +++++++++++++++++++++---
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/js/sakura-app.js b/js/sakura-app.js
index 14be44a..98ef975 100644
--- a/js/sakura-app.js
+++ b/js/sakura-app.js
@@ -78,10 +78,12 @@ function post_list_show_animation() {
function callback(entries) {
entries.forEach((article) => {
if (article.target.classList.contains("post-list-show")) {
+ article.target.style.willChange = 'auto';
io.unobserve(article.target)
} else {
if (article.isIntersecting) {
article.target.classList.add("post-list-show");
+ article.target.style.willChange = 'auto';
io.unobserve(article.target)
}
}
diff --git a/style.css b/style.css
index 8c121db..ccc88cb 100644
--- a/style.css
+++ b/style.css
@@ -1086,6 +1086,7 @@ a:hover {
display: block
}
+
.m-nav {
display: none
}
@@ -1142,6 +1143,22 @@ a:hover {
max-width: 100%
}
+@media(max-width:1200px) {
+ .site-top .lower nav{
+ right: calc(-150px - 100%);
+ position: absolute;
+ float: right;
+ animation: searchbox .2s;
+ min-width: 860px;
+ }
+ .site-top .lower nav.navbar {
+ right: calc(-50px - 100%);
+ }
+ .site-top .lower nav.navbar ul {
+ background: #fff;
+ }
+}
+
#show-nav {
position: relative;
float: right;
@@ -1443,6 +1460,7 @@ i.iconfont.hotpost {
}
.post-list-thumb {
+ will-change: transform;
float: left;
width: 100%;
height: 300px;
@@ -1456,7 +1474,7 @@ i.iconfont.hotpost {
@media (max-width:860px) {
.post-list-thumb {
- margin: 0;
+ margin: 10px 0 10px;
height: auto
}
}
@@ -6839,9 +6857,9 @@ input[type=radio]:checked:before {
margin-right: 22px
}
-@media (max-width:800px) {
+@media (max-width:860px) {
.changeSkin-gear {
- visibility: hidden
+ visibility: hidden !important
}
.changeSkin-gear span::before {
content: ""
From 7d5ff98f87721a36ac940029480a08fa4cfba2ef Mon Sep 17 00:00:00 2001
From: Spirit
Date: Sat, 21 Mar 2020 17:38:05 +0800
Subject: [PATCH 13/14] fix: fix the fixes
---
js/sakura-app.js | 1 +
style.css | 13 ++++++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/js/sakura-app.js b/js/sakura-app.js
index 98ef975..4c91c90 100644
--- a/js/sakura-app.js
+++ b/js/sakura-app.js
@@ -1722,6 +1722,7 @@ var home = location.href,
$body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');
$('body').on('click', '#comments-navi a', function (e) {
e.preventDefault();
+ var path = $(this)[0].pathname;
$.ajax({
type: "GET",
url: $(this).attr('href'),
diff --git a/style.css b/style.css
index ccc88cb..0286418 100644
--- a/style.css
+++ b/style.css
@@ -5,7 +5,7 @@ Theme URI: https://github.com/mashirozx/Sakura/
Author: Mashiro, Spirit, Louie, Fuzzz
Author URI: http://2heng.xin
Description: A wonderful branch of theme Akina
-Version: 3.3.6
+Version: 3.3.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sakura
@@ -1150,6 +1150,7 @@ a:hover {
float: right;
animation: searchbox .2s;
min-width: 860px;
+ z-index: -1
}
.site-top .lower nav.navbar {
right: calc(-50px - 100%);
@@ -4728,6 +4729,11 @@ i.iconfont.js-toggle-search.iconsearch {
margin-top: 0;
padding: 0
}
+.wp-smiley {
+ height: 2em !important;
+ max-height: 2em !important;
+ vertical-align: bottom;
+}
embed,
iframe,
@@ -7584,6 +7590,11 @@ a.toc-link {
}
@media (max-width:860px) {
+ .wp-smiley {
+ height:20px !important;
+ max-height:20px !important;
+ vertical-align:middle
+ }
.bili-container,
.tieba-container {
padding-left: 0
From a62d42d3729bc1a357c0ff8cd6a275928d1f7f71 Mon Sep 17 00:00:00 2001
From: Spirit
Date: Sat, 21 Mar 2020 18:17:44 +0800
Subject: [PATCH 14/14] perf: update live-search
---
inc/api.php | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/inc/api.php b/inc/api.php
index 11e5ee9..bd4126b 100644
--- a/inc/api.php
+++ b/inc/api.php
@@ -268,21 +268,24 @@ function SMMS_API($image)
*/
function cache_search_json()
{
+ global $more;
$vowels = array("[", "{", "]", "}", "<", ">", "\r\n", "\r", "\n", "-", "'", '"', '`', " ", ":", ";", '\\', " ", "toc");
$regex = <<])*>|begin[\S\s]*\/begin|hermit[\S\s]*\/hermit|img[\S\s]*\/img|{{.*?}}|:.*?:/m
EOS;
+ $more = 1;
$posts = new WP_Query('posts_per_page=-1&post_status=publish&post_type=post');
while ($posts->have_posts()): $posts->the_post();
- $output .= '{"type":"post","link":"' . get_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', get_the_content()))) . '},';
+ $output .= '{"type":"post","link":"' . get_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', apply_filters( 'the_content', get_the_content())))) . '},';
endwhile;
wp_reset_postdata();
- $pages = get_pages();
- foreach ($pages as $page) {
- $output .= '{"type":"page","link":"' . get_page_link($page) . '","title":' . json_encode($page->post_title) . ',"comments":"' . $page->comment_count . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', $page->post_content))) . '},';
- }
+ $pages = new WP_Query('posts_per_page=-1&post_status=publish&post_type=page');
+ while ($pages->have_posts()): $pages->the_post();
+ $output .= '{"type":"page","link":"' . get_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', apply_filters( 'the_content', get_the_content())))) . '},';
+ endwhile;
+ wp_reset_postdata();
$tags = get_tags();
foreach ($tags as $tag) {