Refactor code structure for improved readability and maintainability

This commit is contained in:
Harvey Zhao committed 2026-01-01 19:50:00 +08:00
1 parent 4a0fbda3c4
commit 0bb4e1acdb
214 files changed
+462 -415

No files matched your search

@@ -2,7 +2,7 @@
/*!
* artplayer-plugin-liquid-glass.js v1.0.0
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2025 Harvey Zack
* (c) 2017-2026 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,n,o,i,a,l){var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof d[n]&&d[n],s=u.i||{},c=u.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,r){if(!c[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof d[n]&&d[n];if(!r&&i)return i(t,!0);if(u)return u(t,!0);if(f&&"string"==typeof t)return f(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}s.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},s.cache={};var l=c[t]=new p.Module(t);e[t][0].call(l.exports,s,l,l.exports,d)}return c[t].exports;function s(e){var t=s.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],n=e[1],o=e[2]||e[0],i=p(n);"*"===t?Object.keys(i).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})}):"*"===o?Object.defineProperty(r,t,{enumerable:!0,value:i}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===o?i.__esModule?i.default:i:i[o]}})}),r}return p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=f,this.exports={}},p.modules=e,p.cache=c,p.parent=u,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=s,p.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(p,"root",{get:function(){return d[n]}}),d[n]=p;for(var g=0;g<t.length;g++)p(t[g]);if(r){var y=p(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=y:"function"==typeof define&&define.amd&&define(function(){return y})}}({dOYQ3:[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",()=>l);var i=e("bundle-text:./style.less"),a=o.interopDefault(i);function l(e={}){return t=>{let{constructor:r}=t,{addClass:n,append:o,createElement:i}=r.utils,{$bottom:a,$progress:l,$controls:d,$player:u}=t.template,s=i("div");return n(u,"artplayer-plugin-liquid-glass"),n(s,"art-liquid-glass"),o(a,s),o(s,l),o(s,d),t.on("control",t=>{t?(s.style.width=e.width,s.style["max-width"]=e["max-width"],s.style["min-width"]=e["min-width"]):(s.style.width="",s.style["max-width"]="",s.style["min-width"]="")}),{name:"artplayerPluginLiquidGlass"}}}if("undefined"!=typeof document){let e="artplayer-plugin-liquid-glass",t=document.getElementById(e);t||((t=document.createElement("style")).id=e,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.appendChild(t)}):(document.head||document.documentElement).appendChild(t)),t.textContent=a.default}"undefined"!=typeof window&&(window.artplayerPluginLiquidGlass=l)},{"bundle-text:./style.less":"kzvrd","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],kzvrd:[function(e,t,r,n){t.exports=".artplayer-plugin-liquid-glass.art-control-show{--art-control-height:42px;--art-control-icon-size:24px;--art-control-icon-scale:1.1}.artplayer-plugin-liquid-glass.art-control-show .art-bottom{padding-bottom:var(--art-padding);background-image:none;align-items:center}.artplayer-plugin-liquid-glass.art-control-show .art-bottom .art-liquid-glass{backdrop-filter:blur(12px);padding:var(--art-padding)calc(var(--art-padding)*1.5)5px;background-color:#00000040;border-radius:8px}.artplayer-plugin-liquid-glass.art-control-show .art-bottom .art-control-progress-inner{border-radius:5px;overflow:hidden}.artplayer-plugin-liquid-glass.art-control-show .art-settings{bottom:calc(var(--art-control-height) + var(--art-bottom-gap) + var(--art-padding))}.artplayer-plugin-liquid-glass.art-control-show .art-layer-auto-playback{bottom:calc(var(--art-control-height) + var(--art-bottom-gap) + var(--art-padding)*4 + 10px)}"},{}],"6ykb1":[function(e,t,r,n){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.exportAll=function(e,t){return Object.keys(e).forEach(function(r){"default"===r||"__esModule"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),t},r.export=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:r})}},{}]},["dOYQ3"],"dOYQ3","parcelRequire4dc0",{});
!function(e,t,r,o,n,a,i,l){var u="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},d="function"==typeof u[o]&&u[o],c=d.i||{},s=d.cache||{},p="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!s[t]){if(!e[t]){if(n[t])return n[t];var a="function"==typeof u[o]&&u[o];if(!r&&a)return a(t,!0);if(d)return d(t,!0);if(p&&"string"==typeof t)return p(t);var i=Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}c.resolve=function(r){var o=e[t][1][r];return null!=o?o:r},c.cache={};var l=s[t]=new f.Module(t);e[t][0].call(l.exports,c,l,l.exports,u)}return s[t].exports;function c(e){var t=c.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],o=e[1],n=e[2]||e[0],a=f(o);"*"===t?Object.keys(a).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return a[e]}})}):"*"===n?Object.defineProperty(r,t,{enumerable:!0,value:a}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===n?a.__esModule?a.default:a:a[n]}})}),r}return f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=p,this.exports={}},f.modules=e,f.cache=s,f.parent=d,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=c,f.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(f,"root",{get:function(){return u[o]}}),u[o]=f;for(var y=0;y<t.length;y++)f(t[y]);if(r){var g=f(r);"object"==typeof exports&&"u">typeof module?module.exports=g:"function"==typeof define&&define.amd&&define(function(){return g})}}({dOYQ3:[function(e,t,r,o){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",()=>l);var a=e("bundle-text:./style.less"),i=n.interopDefault(a);function l(e={}){return t=>{let{constructor:r}=t,{addClass:o,append:n,createElement:a}=r.utils,{$bottom:i,$progress:l,$controls:u,$player:d}=t.template,c=a("div");return o(d,"artplayer-plugin-liquid-glass"),o(c,"art-liquid-glass"),n(i,c),n(c,l),n(c,u),t.on("control",t=>{t?(c.style.width=e.width,c.style["max-width"]=e["max-width"],c.style["min-width"]=e["min-width"]):(c.style.width="",c.style["max-width"]="",c.style["min-width"]="")}),{name:"artplayerPluginLiquidGlass"}}}if("u">typeof document){let e="artplayer-plugin-liquid-glass",t=document.getElementById(e);t||((t=document.createElement("style")).id=e,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.appendChild(t)}):(document.head||document.documentElement).appendChild(t)),t.textContent=i.default}"u">typeof window&&(window.artplayerPluginLiquidGlass=l)},{"bundle-text:./style.less":"kzvrd","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],kzvrd:[function(e,t,r,o){t.exports=".artplayer-plugin-liquid-glass.art-control-show{--art-control-height:42px;--art-control-icon-size:24px;--art-control-icon-scale:1.1}.artplayer-plugin-liquid-glass.art-control-show .art-bottom{padding-bottom:var(--art-padding);background-image:none;align-items:center}.artplayer-plugin-liquid-glass.art-control-show .art-bottom .art-liquid-glass{backdrop-filter:blur(12px);padding:var(--art-padding)calc(var(--art-padding)*1.5)5px;background-color:#00000040;border-radius:8px}.artplayer-plugin-liquid-glass.art-control-show .art-settings{bottom:calc(var(--art-control-height) + var(--art-bottom-gap) + var(--art-padding))}.artplayer-plugin-liquid-glass.art-control-show .art-layer-auto-playback{bottom:calc(var(--art-control-height) + var(--art-bottom-gap) + var(--art-padding)*4 + 10px)}"},{}],"6ykb1":[function(e,t,r,o){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.exportAll=function(e,t){return Object.keys(e).forEach(function(r){"default"===r||"__esModule"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),t},r.export=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:r})}},{}]},["dOYQ3"],"dOYQ3","parcelRequire4dc0",{});