diff --git a/settings.yaml b/settings.yaml index ad987294..abbfc9cd 100644 --- a/settings.yaml +++ b/settings.yaml @@ -1857,24 +1857,55 @@ spec: name: game2 label: 爱好游戏 2 value: + game2_type: img game2_tips: 爱好游戏 game2_title: 狼人杀 game2_uid: ID 1333E3FF game2_bg: https://img.zhheo.com/i/2022/08/31/630efa916a851.webp children: + - $formkit: radio + name: game2_type + id: game2_type + key: game2_type + options: + - label: 图片 + value: img + - label: 追番 + value: comic - $formkit: text name: game2_tips label: 提示文字 placeholder: 请输入内容 - $formkit: text name: game2_title - label: 游戏标题 + label: 标题 placeholder: 请输入内容 + - $formkit: repeater + name: comic_list + id: comic_list + key: comic_list + if: $get(game2_type).value == 'comic' + label: 追番列表 + children: + - $formkit: text + name: title + label: 标题 + placeholder: 请输入内容 + - $formkit: textarea + name: url + label: 链接 + placeholder: 请输入内容 + - $formkit: attachment + name: bg + label: 背景 + placeholder: 请输入内容 - $formkit: text + if: $get(game2_type).value == 'img' name: game2_uid label: 游戏 ID placeholder: 请输入内容 - $formkit: attachment + if: $get(game2_type).value == 'img' name: game2_bg label: 游戏背景 placeholder: 请输入内容 diff --git a/templates/assets/js/heo.js b/templates/assets/js/heo.js index 66d06d02..e965b56b 100644 --- a/templates/assets/js/heo.js +++ b/templates/assets/js/heo.js @@ -18,22 +18,6 @@ var heo = { } }, - // //bb添加时间 - // changeTimeInEssay: function () { - // const relativeDate = function (selector) { - // selector.forEach(item => { - // const $this = item - // const timeVal = $this.getAttribute('datetime') - // $this.innerText = btf.diffDate(timeVal, true) - // $this.style.display = 'inline' - // }) - // } - // - // if (document.querySelector('#comment')) { - // relativeDate(document.querySelectorAll('#comment time')) - // } - // }, - // 首页bb initIndexEssay: function() { if (document.querySelector("#bber-talk")) @@ -81,60 +65,6 @@ var heo = { $("#cookies-window").hide()) }, - // 标签页面 - //分类条 - // tagPageActive: function () { - // var urlinfo = window.location.pathname; - // urlinfo = decodeURIComponent(urlinfo) - // // console.log(urlinfo); - // // 验证是否是分类链接 - // var pattern = /\/tags\/.*?\//; - // var patbool = pattern.test(urlinfo); - // // console.log(patbool); - // // 获取当前的分类 - // if (patbool) { - // var valuegroup = urlinfo.split("/"); - // // console.log(valuegroup[2]); - // // 获取当前分类 - // var nowCategorie = valuegroup[2]; - // if (document.querySelector('#tag-page-tags')) { - // $('a').removeClass('select') - // document.getElementById(nowCategorie).classList.add("select"); - // } - // } - // }, - - //分类条 - // categoriesBarActive: function () { - // if (document.querySelector('#category-bar')) { - // $(".category-bar-item").removeClass("select") - // } - // var urlinfo = window.location.pathname; - // urlinfo = decodeURIComponent(urlinfo); - // // console.log(urlinfo); - // //判断是否是首页 - // if (urlinfo == '/') { - // if (document.querySelector('#category-bar')) { - // document.getElementById('category-bar-home').classList.add("select"); - // } - // } else { - // // 验证是否是分类链接 - // var pattern = /\/categories\/.*?\//; - // var patbool = pattern.test(urlinfo); - // // console.log(patbool); - // // 获取当前的分类 - // if (patbool) { - // var valuegroup = urlinfo.split("/"); - // // console.log(valuegroup[2]); - // // 获取当前分类 - // var nowCategorie = valuegroup[2]; - // if (document.querySelector('#category-bar')) { - // document.getElementById(nowCategorie).classList.add("select"); - // } - // } - // } - // }, - // 页脚友链 addFriendLinksInFooter: function () { const linksUrl = GLOBAL_CONFIG.source.links.linksUrl @@ -201,18 +131,6 @@ var heo = { }, - // 添加标签 - addTag: function () { - //添加new标签 - if (document.querySelector('.heo-tag-new')) { - $(".heo-tag-new").append(`N`) - } - //添加hot标签 - if (document.querySelector('.heo-tag-hot')) { - $(".heo-tag-hot").append(`H`) - } - }, - // 二维码 qrcodeCreate: function () { if (document.getElementById('qrcode')) { @@ -232,7 +150,7 @@ var heo = { reflashEssayWaterFall: function() { document.querySelector("#waterfall") && setTimeout((function() { waterfall("#waterfall"), - document.getElementById("waterfall").classList.add("show") + document.getElementById("waterfall") && document.getElementById("waterfall").classList.add("show") } ), 500) }, diff --git a/templates/assets/js/main.js b/templates/assets/js/main.js index 73dde687..9315be98 100644 --- a/templates/assets/js/main.js +++ b/templates/assets/js/main.js @@ -124,7 +124,7 @@ document.addEventListener('DOMContentLoaded', function () { // } /** - * fancybox和 mediumZoom + * fancybox */ const addFancybox = function (ele) { const runFancybox = (ele) => { @@ -161,16 +161,6 @@ document.addEventListener('DOMContentLoaded', function () { } } - const addMediumZoom = () => { - const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a)>img')) - zoom.on('open', e => { - const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff' - zoom.update({ - background: photoBg - }) - }) - } - const jqLoadAndRun = () => { const $fancyboxEle = GLOBAL_CONFIG.lightbox === 'fancybox' ? document.querySelectorAll('#article-container :not(a):not(.gallery-group):not(.site-card-avatar):not(.flink-item-info):not(.rss-plan-info-group) > img, #article-container > img,.bber-container-img > img') @@ -265,234 +255,6 @@ document.addEventListener('DOMContentLoaded', function () { } } - /** - * toc - */ - const tocFn = function () { - const $cardTocLayout = document.getElementById('card-toc') - const $cardToc = $cardTocLayout.getElementsByClassName('toc-content')[0] - const $tocLink = $cardToc.querySelectorAll('.toc-link') - const $article = document.getElementById('article-container') - - // main of scroll - window.tocScrollFn = function () { - return btf.throttle(function () { - const currentTop = window.scrollY || document.documentElement.scrollTop - scrollPercent(currentTop) - findHeadPosition(currentTop) - }, 100)() - } - window.addEventListener('scroll', tocScrollFn) - - const scrollPercent = function (currentTop) { - const docHeight = $article.clientHeight - const winHeight = document.documentElement.clientHeight - const headerHeight = $article.offsetTop - const contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : (document.documentElement.scrollHeight - winHeight) - const scrollPercent = (currentTop - headerHeight) / (contentMath) - const scrollPercentRounded = Math.round(scrollPercent * 100) - const percentage = (scrollPercentRounded > 100) ? 100 : (scrollPercentRounded <= 0) ? 0 : scrollPercentRounded - $cardToc.setAttribute('progress-percentage', percentage) - } - - // anchor - const isAnchor = GLOBAL_CONFIG.isanchor - const updateAnchor = function (anchor) { - if (window.history.replaceState && anchor !== window.location.hash) { - if (!anchor) anchor = location.pathname - const title = GLOBAL_CONFIG_SITE.title - window.history.replaceState({ - url: location.href, - title: title - }, title, anchor) - } - } - - const mobileToc = { - open: () => { - $cardTocLayout.style.cssText = 'animation: toc-open .3s; opacity: 1; right: 45px' - }, - - close: () => { - $cardTocLayout.style.animation = 'toc-close .2s' - setTimeout(() => { - $cardTocLayout.style.cssText = "opacity:''; animation: ''; right: ''" - }, 100) - } - } - - document.getElementById('mobile-toc-button').addEventListener('click', () => { - if (window.getComputedStyle($cardTocLayout).getPropertyValue('opacity') === '0') mobileToc.open() - else mobileToc.close() - }) - - // toc元素點擊 - $cardToc.addEventListener('click', (e) => { - e.preventDefault() - const $target = e.target.classList.contains('toc-link') - ? e.target - : e.target.parentElement - btf.scrollToDest(btf.getEleTop(document.getElementById(decodeURI($target.getAttribute('href')).replace('#', ''))), 300) - if (window.innerWidth < 900) { - mobileToc.close() - } - }) - - const autoScrollToc = function (item) { - const activePosition = item.getBoundingClientRect().top - const sidebarScrollTop = $cardToc.scrollTop - if (activePosition > (document.documentElement.clientHeight - 100)) { - $cardToc.scrollTop = sidebarScrollTop + 150 - } - if (activePosition < 100) { - $cardToc.scrollTop = sidebarScrollTop - 150 - } - } - - // find head position & add active class - const list = $article.querySelectorAll('h1,h2,h3,h4,h5,h6') - let detectItem = '' - const findHeadPosition = function (top) { - if ($tocLink.length === 0 || top === 0) { - return false - } - - let currentId = '' - let currentIndex = '' - - list.forEach(function (ele, index) { - if (top > btf.getEleTop(ele) - 80) { - currentId = '#' + encodeURI(ele.getAttribute('id')) - currentIndex = index - } - }) - - if (detectItem === currentIndex) return - - if (isAnchor) updateAnchor(currentId) - - if (currentId === '') { - $cardToc.querySelectorAll('.active').forEach(i => { i.classList.remove('active') }) - detectItem = currentIndex - return - } - - detectItem = currentIndex - - $cardToc.querySelectorAll('.active').forEach(item => { item.classList.remove('active') }) - const currentActive = $tocLink[currentIndex] - currentActive.classList.add('active') - - setTimeout(() => { - autoScrollToc(currentActive) - }, 0) - - let parent = currentActive.parentNode - - for (; !parent.matches('.toc'); parent = parent.parentNode) { - if (parent.matches('li')) parent.classList.add('active') - } - } - } - - /** - * Rightside - */ - // const rightSideFn = { - // switchReadMode: () => { // read-mode - // const $body = document.body - // $body.classList.add('read-mode') - // const newEle = document.createElement('button') - // newEle.type = 'button' - // newEle.className = 'fas fa-sign-out-alt exit-readmode' - // $body.appendChild(newEle) - // - // function clickFn() { - // $body.classList.remove('read-mode') - // newEle.remove() - // newEle.removeEventListener('click', clickFn) - // } - // - // newEle.addEventListener('click', clickFn) - // }, - // switchDarkMode: () => { // Switch Between Light And Dark Mode - // const nowMode = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light' - // if (nowMode === 'light') { - // activateDarkMode() - // saveToLocal.set('theme', 'dark', 2); - // GLOBAL_CONFIG.Snackbar !== undefined && btf.snackbarShow(GLOBAL_CONFIG.Snackbar.day_to_night, false, 2000); - // } else { - // activateLightMode(); - // saveToLocal.set('theme', 'light', 2); - // GLOBAL_CONFIG.Snackbar !== undefined && btf.snackbarShow(GLOBAL_CONFIG.Snackbar.night_to_day, false, 2000); - // } - // // handle some cases - // typeof utterancesTheme === 'function' && utterancesTheme() - // typeof FB === 'object' && window.loadFBComment() - // window.DISQUS && document.getElementById('disqus_thread').children.length && setTimeout(() => window.disqusReset(), 200) - // }, - // showOrHideBtn: () => { // rightside 點擊設置 按鈕 展開 - // document.getElementById('rightside-config-hide').classList.toggle('show') - // }, - // scrollToTop: () => { // Back to top - // btf.scrollToDest(0, 500) - // }, - // hideAsideBtn: () => { // Hide aside - // const $htmlDom = document.documentElement.classList - // $htmlDom.contains('hide-aside') - // ? saveToLocal.set('aside-status', 'show', 2) - // : saveToLocal.set('aside-status', 'hide', 2) - // $htmlDom.toggle('hide-aside') - // }, - // - // adjustFontSize: (plus) => { - // const fontSizeVal = parseInt(window.getComputedStyle(document.documentElement).getPropertyValue('--global-font-size')) - // let newValue = '' - // if (plus) { - // if (fontSizeVal >= 20) return - // newValue = fontSizeVal + 1 - // document.documentElement.style.setProperty('--global-font-size', newValue + 'px') - // !document.getElementById('nav').classList.contains('hide-menu') && adjustMenu(true) - // } else { - // if (fontSizeVal <= 10) return - // newValue = fontSizeVal - 1 - // document.documentElement.style.setProperty('--global-font-size', newValue + 'px') - // document.getElementById('nav').classList.contains('hide-menu') && adjustMenu(true) - // } - // - // saveToLocal.set('global-font-size', newValue, 2) - // // document.getElementById('font-text').innerText = newValue - // } - // } - - // document.getElementById('rightside').addEventListener('click', function (e) { - // const $target = e.target.id || e.target.parentNode.id - // switch ($target) { - // case 'go-up': - // rightSideFn.scrollToTop() - // break - // case 'rightside_config': - // rightSideFn.showOrHideBtn() - // break - // case 'readmode': - // rightSideFn.switchReadMode() - // break - // case 'darkmode': - // rightSideFn.switchDarkMode() - // break - // case 'hide-aside-btn': - // rightSideFn.hideAsideBtn() - // break - // case 'font-plus': - // rightSideFn.adjustFontSize(true) - // break - // case 'font-minus': - // rightSideFn.adjustFontSize() - // break - // default: - // break - // } - // }) /** * menu @@ -661,26 +423,6 @@ document.addEventListener('DOMContentLoaded', function () { } } - // const switchComments = function () { - // let switchDone = false - // const $switchBtn = document.querySelector('#comment-switch > .switch-btn') - // $switchBtn && $switchBtn.addEventListener('click', function () { - // this.classList.toggle('move') - // document.querySelectorAll('#post-comment > .comment-wrap > div').forEach(function (item) { - // if (btf.isHidden(item)) { - // item.style.cssText = 'display: block;animation: tabshow .5s' - // } else { - // item.style.cssText = "display: none;animation: ''" - // } - // }) - // - // if (!switchDone && typeof loadOtherComment === 'function') { - // switchDone = true - // loadOtherComment() - // } - // }) - // } - const addPostOutdateNotice = function () { const data = GLOBAL_CONFIG.noticeOutdate const diffDay = btf.diffDate(GLOBAL_CONFIG_SITE.postUpdate) @@ -732,13 +474,8 @@ document.addEventListener('DOMContentLoaded', function () { GLOBAL_CONFIG.lazyload.enable && lazyloadImg() if (GLOBAL_CONFIG.isPost) { - // GLOBAL_CONFIG.isToc && tocFn() addRuntime(); - // GLOBAL_CONFIG.noticeOutdate !== undefined && addPostOutdateNotice() - // GLOBAL_CONFIG.relativeDate.post && relativeDate(document.querySelectorAll('#post-meta time')) } else { - // GLOBAL_CONFIG.relativeDate.homepage && relativeDate(document.querySelectorAll('#recent-posts time')) - // GLOBAL_CONFIG.runtime && addRuntime() addLastPushDate() toggleCardCategory() addRuntime() @@ -746,16 +483,12 @@ document.addEventListener('DOMContentLoaded', function () { sidebarFn() GLOBAL_CONFIG.isHome && scrollDownInIndex() - // addHighlightTool() - //GLOBAL_CONFIG.isPhotoFigcaption && addPhotoFigcaption() scrollFn() addTableWrap() clickFnOfTagHide() tabsFn.clickFnOfTabs() tabsFn.backToTop() jqLoadAndRun() - //initGallery() - // switchComments() } refreshFn() diff --git a/templates/assets/libs/aplayer/APlayer.min.js b/templates/assets/libs/aplayer/APlayer.min.js index 2070181f..69c0f9ea 100644 --- a/templates/assets/libs/aplayer/APlayer.min.js +++ b/templates/assets/libs/aplayer/APlayer.min.js @@ -1 +1 @@ -!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}); \ No newline at end of file +!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 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,r=(i=n(38))&&i.__esModule?i:{default:i};t.default=r.default}]).default})); \ No newline at end of file diff --git a/templates/assets/libs/aplayer/Meting2.min.js b/templates/assets/libs/aplayer/Meting2.min.js index da4394a5..64ea1095 100644 --- a/templates/assets/libs/aplayer/Meting2.min.js +++ b/templates/assets/libs/aplayer/Meting2.min.js @@ -1 +1 @@ -"use strict";function _objectSpread(a){for(var b=1;bb.toUpperCase())}_init(){let a={};for(let b=0;ba.json()).then(a=>this._loadPlayer(a))}_loadPlayer(a){let b={audio:a,mutex:!0,lrcType:this.meta.lrcType||3,storageName:"metingjs"};if(a.length){let a=_objectSpread({},b,this.config);for(let b in a)("true"===a[b]||"false"===a[b])&&(a[b]="true"===a[b]);let c=document.createElement("div");a.container=c,this.appendChild(c),this.aplayer=new APlayer(a)}}}console.log("\n %c MetingJS v2.0.1 %c https://github.com/metowolf/MetingJS \n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),window.customElements&&!window.customElements.get("meting-js")&&(window.MetingJSElement=MetingJSElement,window.customElements.define("meting-js",MetingJSElement)); \ No newline at end of file +"use strict";function _objectSpread(a){for(var b=1;bb.toUpperCase())}_init(){let a={};for(let b=0;ba.json()).then(a=>this._loadPlayer(a))}_loadPlayer(a){let b={audio:a,mutex:!0,lrcType:this.meta.lrcType||3,storageName:"metingjs"};if(a.length){let a=_objectSpread({},b,this.config);for(let b in a)("true"===a[b]||"false"===a[b])&&(a[b]="true"===a[b]);let c=document.createElement("div");a.container=c,this.appendChild(c),this.aplayer=new APlayer(a)}}}window.customElements&&!window.customElements.get("meting-js")&&(window.MetingJSElement=MetingJSElement,window.customElements.define("meting-js",MetingJSElement)); \ No newline at end of file diff --git a/templates/assets/libs/waterfall/waterfall.min.js b/templates/assets/libs/waterfall/waterfall.min.js index d88c1316..11ab3ef7 100644 --- a/templates/assets/libs/waterfall/waterfall.min.js +++ b/templates/assets/libs/waterfall/waterfall.min.js @@ -1 +1 @@ -!function(a,b){"function"==typeof define&&define.amd?define("waterfall",function(){return b}):"object"==typeof module&&module.exports?module.exports=b:a.waterfall=b}(this,function(a){function b(a){return window.getComputedStyle(a)}function c(a,c){return parseFloat(b(c)["margin"+a])||0}function d(a){return parseFloat(a)+"px"}function e(a){return parseFloat(a.style.top)}function f(a){return parseFloat(a.style.left)}function g(a){return parseFloat(b(a).width)}function h(a){return parseFloat(b(a).height)}function i(a){return e(a)+h(a)+c("Bottom",a)}function j(a){return f(a)+g(a)+c("Right",a)}function k(a){a=a.sort(function(a,b){var c=i(b)-i(a);return c||f(b)-f(a)})}function l(a){var b=a;k(b),this.add=function(a){b.push(a),k(b),b.pop()},this.min=function(){return b[b.length-1]},this.max=function(){return b[0]}}function m(a,b,c){a.style.position="absolute",a.style.top=d(b),a.style.left=d(c)}function n(a){m(a,0,c("Left",a))}function o(a,b){m(b,a.style.top,j(a)+c("Left",b))}function p(a,b){m(b,i(a)+c("Top",b),f(a))}function q(a,b){a.style.position="relative",a.style.height=d(i(b)+c("Bottom",b))}function r(b,c){return j(b[c-1])+g(b[c])<=g(a)}"string"==typeof a&&(a=document.querySelector(a));var s=a.children;s.length&&n(s[0]);for(var t=1;t 90 ? (document.querySelector("#nav-totop").classList.add("long"), n.innerHTML = "返回顶部") : (document.querySelector("#nav-totop").classList.remove("long"), o >= 0 && (n.innerHTML = o)), @@ -660,10 +660,28 @@ function listenToPageInputPress() { ))) } function initBlog() { + // 图片主色 + GLOBAL_CONFIG.source.post.dynamicBackground && coverColor(), + navTitle(), + percent(), + heo.topCategoriesBarScroll(), heo.initIndexEssay(), - checkUrlAndAddHideBanner(), setBodyDataType(), - listenToPageInputPress() + listenToPageInputPress(), + heo.topPostScroll(), + heo.sayhi(), + heo.qrcodeCreate(), + //右下角 snackbar 弹窗 + GLOBAL_CONFIG.source.tool.switch && heo.hidecookie(), + heo.stopImgRightDrag(), + heo.onlyHome(), + heo.addNavBackgroundInit(), + heo.darkModeStatus(), + heo.initThemeColor(), + //隐藏加载动画 + GLOBAL_CONFIG.loadingBox && heo.hideLoading(), + checkUrlAndAddHideBanner() + } // 如果当前页有评论就执行函数 @@ -862,34 +880,9 @@ document.addEventListener('pjax:send', function () { }) document.addEventListener('DOMContentLoaded', function () { - // coverColor() - navTitle() - percent() - heo.topPostScroll() - heo.topCategoriesBarScroll() - heo.sayhi() - heo.addTag() - heo.stopImgRightDrag() //页脚友联 if(GLOBAL_CONFIG.isFriendLinksInFooter){ heo.addFriendLinksInFooter() } - heo.qrcodeCreate() - heo.onlyHome() - - heo.addNavBackgroundInit() - // heo.changeTimeInEssay() heo.reflashEssayWaterFall() - //heo.addMediumInEssay() - heo.darkModeStatus() - // heo.categoriesBarActive() - heo.initThemeColor() - //隐藏加载动画 - if(GLOBAL_CONFIG.loadingBox){ - heo.hideLoading() - } - // heo.tagPageActive() }) -window.onscroll = function () { - percent(); -}; diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css index 1bc38b81..0f5b5f65 100644 --- a/templates/assets/zhheo/zhheoblog.css +++ b/templates/assets/zhheo/zhheoblog.css @@ -8028,16 +8028,6 @@ span.fund_name { line-height: 19px; } -.heo-tag-new-view { - color: var(--heo-white); - background: var(--heo-green); -} - -.heo-tag-hot-view { - color: var(--heo-white); - background: var(--heo-red); -} - /* 主页导航栏让位偏移 */ /* .layout_page .recent-posts{ @@ -16557,6 +16547,108 @@ span.hexo-douban-pagenum { left: 0; } +.author-content-item.comic-content { + width: 39%; + min-height: 300px; + overflow: hidden +} + +.author-content-item.comic-content .comic-box { + display: -webkit-box; + display: -moz-box; + display: -webkit-flex; + display: -ms-flexbox; + display: box; + display: flex; + width: 120%; + height: 100%; + position: absolute; + left: 50%; + top: 0; + -webkit-transform: translateX(-50%); + -moz-transform: translateX(-50%); + -o-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%) +} + +.author-content-item.comic-content .author-content-item-tips,.author-content-item.comic-content .author-content-item-title { + z-index: 2; + color: var(--heo-white); + pointer-events: none +} + +.author-content-item.comic-content .comic-item { + height: 100%; + color: #fff; + width: 20%; + -webkit-transform: skew(-10deg,0deg); + -moz-transform: skew(-10deg,0deg); + -o-transform: skew(-10deg,0deg); + -ms-transform: skew(-10deg,0deg); + transform: skew(-10deg,0deg); + -webkit-transition: .8s; + -moz-transition: .8s; + -o-transition: .8s; + -ms-transition: .8s; + transition: .8s; + position: relative; + overflow: hidden +} + +.author-content-item.comic-content .comic-item:hover { + width: 46% +} + +.author-content-item.comic-content .comic-item:hover .comic-item-cover { + left: 16%; + -webkit-transform: skew(10deg,0deg) scale(1.6); + -moz-transform: skew(10deg,0deg) scale(1.6); + -o-transform: skew(10deg,0deg) scale(1.6); + -ms-transform: skew(10deg,0deg) scale(1.6); + transform: skew(10deg,0deg) scale(1.6) +} + +.author-content-item.comic-content .comic-item .comic-item-cover { + position: absolute; + top: 0; + left: -50%; + height: 100%; + -webkit-transform: skew(10deg,0deg); + -moz-transform: skew(10deg,0deg); + -o-transform: skew(10deg,0deg); + -ms-transform: skew(10deg,0deg); + transform: skew(10deg,0deg); + object-fit: cover; + -webkit-transition: scale .2s,all .8s; + -moz-transition: scale .2s,all .8s; + -o-transition: scale .2s,all .8s; + -ms-transition: scale .2s,all .8s; + transition: scale .2s,all .8s +} + +.author-content-item.comic-content .comic-item .comic-item-cover img { + height: 100%; + -webkit-transition: .8s; + -moz-transition: .8s; + -o-transition: .8s; + -ms-transition: .8s; + transition: .8s; + max-width: none; + border-radius: 0 +} + +.author-content-item.comic-content::after { + -webkit-box-shadow: 0 -48px 203px 11px #fbe9b8 inset; + box-shadow: 0 -48px 203px 11px #fbe9b8 inset; + position: absolute; + content: ""; + width: 100%; + height: 100%; + top: 0; + left: 0 +} + /* 关注领域 */ .author-content-item.like-technology { background: url(https://img.zhheo.com/i/2022/08/31/630efac3ecef3.webp) no-repeat; diff --git a/templates/modules/head.html b/templates/modules/head.html index 229f0ef4..757f5016 100644 --- a/templates/modules/head.html +++ b/templates/modules/head.html @@ -236,6 +236,12 @@ locationLng: [[${theme.config.sidebar.welcome.locationLng}]], locationLat: [[${theme.config.sidebar.welcome.locationLat}]], }, + post:{ + dynamicBackground: [[${ theme.config.post.dynamicBackground }]] + }, + tool:{ + switch: [[${ theme.config.tool.snackbar.switch }]] + } }, date_suffix: { just: '刚刚', @@ -264,6 +270,7 @@ enable_height_limit: [[${theme.config.code.enable_height_limit}]] }, + }; // 根据htmlType设置页面title diff --git a/templates/modules/layouts/layout.html b/templates/modules/layouts/layout.html index 555c7d41..b66f8ad3 100644 --- a/templates/modules/layouts/layout.html +++ b/templates/modules/layouts/layout.html @@ -210,50 +210,24 @@ diff --git a/templates/modules/widgets/about-widgets/game.html b/templates/modules/widgets/about-widgets/game.html index 415b42c5..749f3f5c 100644 --- a/templates/modules/widgets/about-widgets/game.html +++ b/templates/modules/widgets/about-widgets/game.html @@ -17,7 +17,7 @@
-
@@ -29,6 +29,24 @@
+
+
+
+
+ +
+