From 9a0840bc93f5d656640e49862dd8c81017dcf7d4 Mon Sep 17 00:00:00 2001 From: Spirit Date: Mon, 19 Aug 2019 17:47:43 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/decorate.php | 4 ++ inc/swicher.php | 20 ++++++ js/sakura-app.js | 180 +++++++++++++++++++++-------------------------- options.php | 27 +++++++ 4 files changed, 131 insertions(+), 100 deletions(-) diff --git a/inc/decorate.php b/inc/decorate.php index 4256c92..6389b26 100644 --- a/inc/decorate.php +++ b/inc/decorate.php @@ -45,6 +45,10 @@ if ( akina_option('theme_skin') ) { ?> background: } +.changeSkin-gear,.toc{ + background:rgba(255,255,255,); +} + .entry-content th { background-color: diff --git a/inc/swicher.php b/inc/swicher.php index 3e76965..030814f 100644 --- a/inc/swicher.php +++ b/inc/swicher.php @@ -17,6 +17,26 @@ mashiro_option.qq_api_url = "https://api.2heng.xin/qqinfo/"; mashiro_option.qq_avatar_api_url = "https://api.2heng.xin/qqinfo/"; mashiro_option.live_search = ; + +mashiro_option.skin_bg0 = ""; +mashiro_option.skin_bg1 = ""; +mashiro_option.skin_bg2 = ""; +mashiro_option.skin_bg3 = ""; +mashiro_option.skin_bg4 = ""; +mashiro_option.skin_bg5 = ""; +mashiro_option.skin_bg6 = ""; +mashiro_option.skin_bg7 = ""; + +mashiro_option.skin_bg0 = "none"; +mashiro_option.skin_bg1 = "https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/sakura.png"; +mashiro_option.skin_bg2 = "https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/plaid2dbf8.jpg"; +mashiro_option.skin_bg3 = "https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/star02.png"; +mashiro_option.skin_bg4 = "https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/kyotoanimation.png"; +mashiro_option.skin_bg5 = "https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/dot_orange.gif"; +mashiro_option.skin_bg6 = "https://api.mashiro.top/bing/"; +mashiro_option.skin_bg7 = "https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.2/other-sites/api-index/images/me.png"; + + mashiro_option.land_at_home = true; diff --git a/js/sakura-app.js b/js/sakura-app.js index e1ee193..ab5b14d 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -5,9 +5,7 @@ * @date 2019.8.3 */ mashiro_global.variables = new function () { - this.has_bot_ui = false; - this.isNight = false; - this.skinSecter = false; + this.skinSecter = true; } mashiro_global.ini = new function () { this.normalize = function () { @@ -16,6 +14,7 @@ mashiro_global.ini = new function () { mashiro_global.post_list_show_animation.ini(); copy_code_block(); coverVideoIni(); + checkskinSecter(); } this.pjax = function () { pjaxInit(); @@ -23,6 +22,7 @@ mashiro_global.ini = new function () { mashiro_global.post_list_show_animation.ini(); copy_code_block(); coverVideoIni(); + checkskinSecter(); } } @@ -288,29 +288,27 @@ function scrollBar() { } scrollBar(); +function checkskinSecter() { + if (mashiro_global.variables.skinSecter === false) { + $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); + $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); + } else { + $(".pattern-center-sakura").removeClass('pattern-center-sakura').addClass('pattern-center'); + $(".headertop-bar-sakura").removeClass('headertop-bar-sakura').addClass('headertop-bar'); + } +} function checkBgImgCookie() { var bgurl = getCookie("bgImgSetting"); if (bgurl != "") { - if (bgurl == "https://view.moezx.cc/images/2018/01/03/sakura.png" || bgurl == "https://view.moezx.cc/images/2018/01/03/plaid2dbf8.jpg" || bgurl == "https://view.moezx.cc/images/2018/01/10/star02.png" || bgurl == "https://view.moezx.cc/images/2018/01/24/kyotoanimation.png" || bgurl == "https://view.moezx.cc/images/2018/03/27/dot_orange.gif") { - mashiro_global.variables.skinSecter = true; - mashiro_global.variables.isNight = false; - $("#night-mode-cover").css("visibility", "hidden"); - $("body").css("background-image", "url(" + bgurl + ")"); - $(".blank").css("background-color", "rgba(255,255,255,1)"); - $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); - $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); - } else if (bgurl == "https://api.shino.cc/bing/") { - mashiro_global.variables.skinSecter = true; - mashiro_global.variables.isNight = true; - $("#night-mode-cover").css("visibility", "hidden"); - $("body").css("background-image", "url(" + bgurl + ")"); - $(".blank").css("background-color", "rgba(255,255,255,1)"); - $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); - $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); - } else {} - } else {} + $(".skin-menu #" + bgurl + "-bg").click(); + } else { + $(".skin-menu #white-bg").click(); + } } if (document.body.clientWidth > 860) { + setTimeout(function() { + checkBgImgCookie(); + }, 100); checkBgImgCookie(); } @@ -320,87 +318,77 @@ function no_right_click() { }); } no_right_click(); -if (mashiro_global.variables.isNight) { - $(".changeSkin-gear, .toc").css("background", "rgba(255,255,255,0.8)"); -} else { - $(".changeSkin-gear, .toc").css("background", "none"); -} -$(document).ready(function () { - function changeBG(tagid, url) { - $(".skin-menu " + tagid).click(function () { - mashiro_global.variables.skinSecter = true; - mashiro_global.variables.isNight = false; - $("#night-mode-cover").css("visibility", "hidden"); - $("body").css("background-image", "url(" + url + ")"); - $(".blank").css("background-color", "rgba(255,255,255,1)"); - $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); - $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); - closeSkinMenu(); - setCookie("bgImgSetting", url, 30); +$(document).ready(function() { + function checkskin_bg(a){ + return a == "none" ? "" : a + } + function changeBG() { + $(".menu-list li").each(function() { + var tagid = this.id; + $(".skin-menu #" + tagid).click(function() { + if (tagid == "white-bg") { + mashiro_global.variables.skinSecter = true; + $(".pattern-center-sakura").removeClass('pattern-center-sakura').addClass('pattern-center'); + $(".headertop-bar-sakura").removeClass('headertop-bar-sakura').addClass('headertop-bar'); + } else { + mashiro_global.variables.skinSecter = false; + $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); + $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); + } + if (tagid == "dark-bg") { + $("#night-mode-cover").css("visibility", "visible"); + } else + $("#night-mode-cover").css("visibility", "hidden"); + switch (tagid) { + case "white-bg": + $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg0) + ")"); + setCookie("bgImgSetting", "white", 30); + break; + case "sakura-bg": + $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg1) + ")"); + setCookie("bgImgSetting", "sakura", 30); + break; + case "gribs-bg": + $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg2) + ")"); + setCookie("bgImgSetting", "gribs", 30); + break; + case "pixiv-bg": + $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg3) + ")"); + setCookie("bgImgSetting", "pixiv", 30); + break; + case "KAdots-bg": + $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg4) + ")"); + setCookie("bgImgSetting", "KAdots", 30); + break; + case "totem-bg": + $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg5) + ")"); + setCookie("bgImgSetting", "totem", 30); + break; + case "bing-bg": + $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg6) + ")"); + setCookie("bgImgSetting", "bing", 30); + break; + case "dark-bg": + $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg7) + ")"); + setCookie("bgImgSetting", "dark", 30); + break; + } + closeSkinMenu(); + }); }); } - - function changeBGnoTrans(tagid, url) { - $(".skin-menu " + tagid).click(function () { - mashiro_global.variables.skinSecter = true; - mashiro_global.variables.isNight = true; - $("#night-mode-cover").css("visibility", "hidden"); - $("body").css("background-image", "url(" + url + ")"); - $(".blank").css("background-color", "rgba(255,255,255,1)"); - $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); - $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); - closeSkinMenu(); - setCookie("bgImgSetting", url, 30); - }); - } - changeBG("#sakura-bg", "https://view.moezx.cc/images/2018/01/03/sakura.png"); - changeBG("#gribs-bg", "https://view.moezx.cc/images/2018/01/03/plaid2dbf8.jpg"); - changeBG("#pixiv-bg", "https://view.moezx.cc/images/2018/01/10/star02.png"); - changeBG("#KAdots-bg", "https://view.moezx.cc/images/2018/01/24/kyotoanimation.png"); - changeBG("#totem-bg", "https://view.moezx.cc/images/2018/03/27/dot_orange.gif"); - changeBGnoTrans("#bing-bg", "https://api.shino.cc/bing/"); - $(".skin-menu #white-bg").click(function () { - mashiro_global.variables.skinSecter = false; - mashiro_global.variables.isNight = false; - $("#night-mode-cover").css("visibility", "hidden"); - $("body").css("background-image", "none"); - $(".blank").css("background-color", "rgba(255,255,255,.0)"); - $(".pattern-center-sakura").removeClass('pattern-center-sakura').addClass('pattern-center'); - $(".headertop-bar-sakura").removeClass('headertop-bar-sakura').addClass('headertop-bar'); - closeSkinMenu(); - setCookie("bgImgSetting", "Hello World!", 30); - }); - $(".skin-menu #dark-bg").click(function () { - mashiro_global.variables.skinSecter = true; - mashiro_global.variables.isNight = true; - $("body").css("background-image", "url(https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.2/other-sites/api-index/images/me.png)"); - $(".blank").css("background-color", "rgba(255,255,255,.8)"); - $("#night-mode-cover").css("visibility", "visible"); - $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); - $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); - closeSkinMenu(); - }); + changeBG(); function closeSkinMenu() { $(".skin-menu").removeClass('show'); - setTimeout(function () { + setTimeout(function() { $(".changeSkin-gear").css("visibility", "visible"); }, 300); - if (mashiro_global.variables.isNight) { - $(".changeSkin-gear, .toc").css("background", "rgba(255,255,255,0.8)"); - } else { - $(".changeSkin-gear, .toc").css("background", "none"); - } } - $(".changeSkin-gear").click(function () { + $(".changeSkin-gear").click(function() { $(".skin-menu").toggleClass('show'); - if (mashiro_global.variables.isNight) { - $(".changeSkin").css("background", "rgba(255,255,255,0.8)"); - } else { - $(".changeSkin").css("background", "none"); - } }) - $(".skin-menu #close-skinMenu").click(function () { + $(".skin-menu #close-skinMenu").click(function() { closeSkinMenu(); }); add_upload_tips(); @@ -617,14 +605,6 @@ var pjaxInit = function () { reloadHermit(); } catch (e) {}; } - if (mashiro_global.variables.skinSecter === true) { - $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); - $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); - if (mashiro_global.variables.isNight) { - $(".blank").css("background-color", "rgba(255,255,255,1)"); - $(".toc").css("background-color", "rgba(255,255,255,0.8)"); - } - } $('.iconflat').css('width', '50px').css('height', '50px'); $('.openNav').css('height', '50px'); $("#bg-next").click(function () { diff --git a/options.php b/options.php index 27c1488..b01c9c6 100644 --- a/options.php +++ b/options.php @@ -134,6 +134,33 @@ function optionsframework_options() { 'type' => "color" ); + $options[] = array( + 'name' => __('切换主题菜单透明度', 'options_framework_theme'), + 'desc' => __('调整切换主题菜单透明度,值越小越透明,默认透明度0.8', 'options_framework_theme'), + 'id' => 'sakura_skin_alpha', + 'std' => '0.8', + 'type' => 'select', + 'options'=>array( + '0'=> __('全透明',''), + '0.1'=> __('透明度0.1',''), + '0.2'=> __('透明度0.2',''), + '0.3'=> __('透明度0.3',''), + '0.4'=> __('透明度0.4',''), + '0.5'=> __('透明度0.5',''), + '0.6'=> __('透明度0.6',''), + '0.7'=> __('透明度0.7',''), + '0.8'=> __('透明度0.8',''), + '0.9'=> __('透明度0.9',''), + '1'=> __('不透明',''), + )); + + $options[] = array( + 'name' => __('切换网页背景', 'options_framework_theme'), + 'desc' => __('前台切换网页背景,共8个url,使用空格分隔,顺序对应前台切换主题按钮位置(按钮顺序从左至右,从上至下),如不需要背景则填写对应位置为none', 'options_framework_theme'), + 'id' => 'sakura_skin_bg', + 'std' => 'none https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/sakura.png https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/plaid2dbf8.jpg https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/star02.png https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/kyotoanimation.png https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/dot_orange.gif https://api.mashiro.top/bing/ https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.2/other-sites/api-index/images/me.png', + 'type' => 'textarea'); + $options[] = array( 'name' => __('个人头像', 'options_framework_theme'), 'desc' => __('最佳高度尺寸130*130px。', 'options_framework_theme'), From e778d03f561731f15f5aada74d8c46250c9d6553 Mon Sep 17 00:00:00 2001 From: Spirit Date: Mon, 19 Aug 2019 18:42:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/sakura-app.js | 47 +++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/js/sakura-app.js b/js/sakura-app.js index ab5b14d..8ecf3e2 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -300,7 +300,7 @@ function checkskinSecter() { function checkBgImgCookie() { var bgurl = getCookie("bgImgSetting"); if (bgurl != "") { - $(".skin-menu #" + bgurl + "-bg").click(); + $(".skin-menu #" + bgurl).click(); } else { $(".skin-menu #white-bg").click(); } @@ -328,12 +328,10 @@ $(document).ready(function() { $(".skin-menu #" + tagid).click(function() { if (tagid == "white-bg") { mashiro_global.variables.skinSecter = true; - $(".pattern-center-sakura").removeClass('pattern-center-sakura').addClass('pattern-center'); - $(".headertop-bar-sakura").removeClass('headertop-bar-sakura').addClass('headertop-bar'); + checkskinSecter(); } else { mashiro_global.variables.skinSecter = false; - $(".pattern-center").removeClass('pattern-center').addClass('pattern-center-sakura'); - $(".headertop-bar").removeClass('headertop-bar').addClass('headertop-bar-sakura'); + checkskinSecter(); } if (tagid == "dark-bg") { $("#night-mode-cover").css("visibility", "visible"); @@ -342,37 +340,30 @@ $(document).ready(function() { switch (tagid) { case "white-bg": $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg0) + ")"); - setCookie("bgImgSetting", "white", 30); break; case "sakura-bg": $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg1) + ")"); - setCookie("bgImgSetting", "sakura", 30); break; case "gribs-bg": $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg2) + ")"); - setCookie("bgImgSetting", "gribs", 30); break; case "pixiv-bg": $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg3) + ")"); - setCookie("bgImgSetting", "pixiv", 30); break; case "KAdots-bg": $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg4) + ")"); - setCookie("bgImgSetting", "KAdots", 30); break; case "totem-bg": $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg5) + ")"); - setCookie("bgImgSetting", "totem", 30); break; case "bing-bg": $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg6) + ")"); - setCookie("bgImgSetting", "bing", 30); break; case "dark-bg": $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg7) + ")"); - setCookie("bgImgSetting", "dark", 30); break; } + setCookie("bgImgSetting", tagid, 30); closeSkinMenu(); }); }); @@ -419,9 +410,9 @@ if (document.body.clientWidth <= 860) { function scrollFunction() { if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { - document.getElementById("moblieGoTop").style.display = "block"; + addComment.I("moblieGoTop").style.display = "block"; } else { - document.getElementById("moblieGoTop").style.display = "none"; + addComment.I("moblieGoTop").style.display = "none"; } } @@ -485,8 +476,8 @@ timeSeriesReload(); /*视频feature*/ function coverVideo() { - var video = document.getElementById("coverVideo"); - var btn = document.getElementById("coverVideo-btn"); + var video = addComment.I("coverVideo"); + var btn = addComment.I("coverVideo-btn"); if (video.paused) { video.play(); @@ -504,8 +495,8 @@ function coverVideo() { } function killCoverVideo() { - var video = document.getElementById("coverVideo"); - var btn = document.getElementById("coverVideo-btn"); + var video = addComment.I("coverVideo"); + var btn = addComment.I("coverVideo-btn"); if (video.paused) { //console.info('none:killCoverVideo()'); @@ -520,7 +511,7 @@ function killCoverVideo() { function coverVideoIni() { if ($('video').hasClass('hls')) { - var video = document.getElementById('coverVideo'); + var video = addComment.I('coverVideo'); var video_src = $('#coverVideo').attr('data-src'); if(Hls.isSupported()) { var hls = new Hls(); @@ -690,8 +681,8 @@ function grin(tag, type, before, after) { } else { tag = ' :' + tag + ': '; } - if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') { - myField = document.getElementById('comment'); + if (addComment.I('comment') && addComment.I('comment').type == 'textarea') { + myField = addComment.I('comment'); } else { return false; } @@ -1371,8 +1362,8 @@ var home = location.href, var QueryStorage = []; search_a("https://"+document.domain+"/wp-json/cache_search/v1/json/"); - var otxt = document.getElementById("search-input"), - list = document.getElementById("PostlistBox"), + var otxt = addComment.I("search-input"), + list = addComment.I("PostlistBox"), Record = list.innerHTML, searchFlag = null; otxt.oninput = function () { @@ -1482,7 +1473,7 @@ var home = location.href, break } } - w && (y = y + G + "文章" + E + w + D), u && (y = y + G + "页面" + E + u + D), r && (y = y + G + "分类" + E + r + D), p && (y = y + G + "标签" + E + p + D), F && (y = y + G + "评论" + E + F + D), s = document.getElementById("PostlistBox"), s.innerHTML = y + w && (y = y + G + "文章" + E + w + D), u && (y = y + G + "页面" + E + u + D), r && (y = y + G + "分类" + E + r + D), p && (y = y + G + "标签" + E + p + D), F && (y = y + G + "评论" + E + F + D), s = addComment.I("PostlistBox"), s.innerHTML = y } } }); @@ -1535,9 +1526,9 @@ var home = location.href, var intersectionObserver = new IntersectionObserver(function (entries) { if (entries[0].intersectionRatio <= 0) return; var page_next = $('#pagination a').attr("href"); - var load_key = document.getElementById("add_post_time"); + var load_key = addComment.I("add_post_time"); if(page_next!=undefined && load_key ){ - var load_time = document.getElementById("add_post_time").title; + var load_time = addComment.I("add_post_time").title; if(load_time !="233"){ console.log("%c 自动加载时倒计时 %c","background:#9a9da2; color:#ffffff; border-radius:4px;","","",load_time); load_post_timer=setTimeout(function(){load_post();},load_time*1000); @@ -1856,7 +1847,7 @@ if ((isWebkit || isOpera || isIe) && document.getElementById && window.addEventL if (!(/^[A-z0-9_-]+$/.test(id))) { return; } - element = document.getElementById(id); + element = addComment.I(id); if (element) { if (!(/^(?:a|select|input|button|textarea)$/i.test(element.tagName))) { element.tabIndex = -1; From d6c7b426130e8a0ec8e8427332766066cfa3116e Mon Sep 17 00:00:00 2001 From: Spirit Date: Thu, 22 Aug 2019 21:22:53 +0800 Subject: [PATCH 3/3] Update to v3.2.4 --- cdn/js/lib.js | 2 +- cdn/js/src/08.lazyload.min.js | 2 +- footer.php | 2 +- functions.php | 2 +- js/sakura-app.js | 1 - options.php | 3 ++- style.css | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cdn/js/lib.js b/cdn/js/lib.js index 30154a0..d0a0246 100644 --- 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 ',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 \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
',t+=s.play,t+='
\n \n \n
\n
\n\n
\n
\n
\n'):(t+='\n
\n
\n
',t+=s.play,t+='
\n
\n
\n
\n No audio\n \n
\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
\n
\n
\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(;s0){e.observer.unobserve(t.target);let s=t.target.getAttribute(e.settings.src),r=t.target.getAttribute(e.settings.srcset);"img"===t.target.tagName.toLowerCase()?(s&&(t.target.src=s),r&&(t.target.srcset=r)):t.target.style.backgroundImage="url("+s+")"}})},s),this.images.forEach(function(t){e.observer.observe(t)})},loadAndDestroy:function(){this.settings&&(this.loadImages(),this.destroy())},loadImages:function(){if(!this.settings)return;let t=this;this.images.forEach(function(e){let s=e.getAttribute(t.settings.src),r=e.getAttribute(t.settings.srcset);"img"===e.tagName.toLowerCase()?(s&&(e.src=s),r&&(e.srcset=r)):e.style.backgroundImage="url("+s+")"})},destroy:function(){this.settings&&(this.observer.disconnect(),this.settings=null)}},t.lazyload=function(t,s){return new e(t,s)},t.jQuery){const s=t.jQuery;s.fn.lazyload=function(t){return t=t||{},t.attribute=t.attribute||"data-src",new e(s.makeArray(this),t),this}}return e});/*! +])});;!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 ',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 \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
',t+=s.play,t+='
\n
\n \n
\n
\n\n
\n
\n
\n'):(t+='\n
\n
\n
',t+=s.play,t+='
\n
\n
\n
\n No audio\n \n
\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
\n
\n
\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(;s0){e.observer.unobserve(t.target);let s=t.target.getAttribute(e.settings.src),r=t.target.getAttribute(e.settings.srcset);"img"===t.target.tagName.toLowerCase()?(s&&(t.target.src=s),r&&(t.target.srcset=r)):t.target.style.backgroundImage="url("+s+")"}})},s),this.images.forEach(function(t){e.observer.observe(t)})},loadAndDestroy:function(){this.settings&&(this.loadImages(),this.destroy())},loadImages:function(){if(!this.settings)return;let t=this;this.images.forEach(function(e){let s=e.getAttribute(t.settings.src),r=e.getAttribute(t.settings.srcset);"img"===e.tagName.toLowerCase()?(s&&(e.src=s),r&&(e.srcset=r)):e.style.backgroundImage="url("+s+")"})},destroy:function(){this.settings&&(this.observer.disconnect(),this.settings=null)}},t.lazyload=function(t,s){return new e(t,s)},t.jQuery){const s=t.jQuery;s.fn.lazyload=function(t){return t=t||{},t.attribute=t.attribute||"data-src",new e(s.makeArray(this),t),this}}return e}); +!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
-
+
  切换主题 | SCHEME TOOL diff --git a/functions.php b/functions.php index 423ffa5..75feb18 100644 --- a/functions.php +++ b/functions.php @@ -7,7 +7,7 @@ * @package Sakura */ -define( 'SAKURA_VERSION', '3.2.3' ); +define( 'SAKURA_VERSION', '3.2.4' ); define( 'BUILD_VERSION', '3' ); define( 'JSDELIVR_VERSION', '3.6.7' ); diff --git a/js/sakura-app.js b/js/sakura-app.js index 8ecf3e2..5fce096 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -309,7 +309,6 @@ if (document.body.clientWidth > 860) { setTimeout(function() { checkBgImgCookie(); }, 100); - checkBgImgCookie(); } function no_right_click() { diff --git a/options.php b/options.php index b01c9c6..e0a2db4 100644 --- a/options.php +++ b/options.php @@ -156,7 +156,8 @@ function optionsframework_options() { $options[] = array( 'name' => __('切换网页背景', 'options_framework_theme'), - 'desc' => __('前台切换网页背景,共8个url,使用空格分隔,顺序对应前台切换主题按钮位置(按钮顺序从左至右,从上至下),如不需要背景则填写对应位置为none', 'options_framework_theme'), + 'desc' => __('前台切换网页背景,共8个url,使用空格分隔,顺序对应前台切换主题按钮位置(按钮顺序从左至右,从上至下),如不需要背景则填写对应位置为none。注意:如果主题是从3.2.3及以下更新过来的,请务必在这里修改【版本控制】参数为任意新值! +', 'options_framework_theme'), 'id' => 'sakura_skin_bg', 'std' => 'none https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/sakura.png https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/plaid2dbf8.jpg https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/star02.png https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/kyotoanimation.png https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/dot_orange.gif https://api.mashiro.top/bing/ https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.2/other-sites/api-index/images/me.png', 'type' => 'textarea'); diff --git a/style.css b/style.css index 19fd47b..f2506e1 100644 --- a/style.css +++ b/style.css @@ -5,7 +5,7 @@ Theme URI: https://2heng.xin/theme-sakura/ Author: Mashiro, Louie, Fuzzz Author URI: http://2heng.xin Description: Akina主题分支(原版地址 http://www.akina.pw/themeakina) -Version: 3.2.3 +Version: 3.2.4 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: akina