diff --git a/dist/beautiful-lyrics.js b/dist/beautiful-lyrics.js index 1e880d3..ad5d709 100644 --- a/dist/beautiful-lyrics.js +++ b/dist/beautiful-lyrics.js @@ -1,5 +1,5 @@ -var beautifulDlyrics=(()=>{var V=Object.defineProperty,i=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,n=(e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a=(e,t)=>{for(var r in t=t||{})A.call(t,r)&&n(e,r,t[r]);if(i)for(var r of i(t))j.call(t,r)&&n(e,r,t[r]);return e},t=new Set;function r(){for(;;){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)});if(!1===t.has(e))return t.add(e),e}}var e,_=class{constructor(){this.Items=new Map,this.DestroyedState=!1}Push(e){var t=r();return this.Items.set(t,e),t}Get(e){return this.Items.get(e)}Remove(e){var t=this.Items.get(e);if(void 0!==t)return this.Items.delete(e),t}GetIterator(){return this.Items.entries()}IsDestroyed(){return this.DestroyedState}Destroy(){this.DestroyedState||(this.DestroyedState=!0,delete this.Items)}},o=class{constructor(e,t){this.ConnectionReferences=e,this.Disconnected=!1,this.Location=e.Push({Callback:t,Connection:this})}Disconnect(){this.Disconnected||(this.Disconnected=!0,this.ConnectionReferences.Remove(this.Location),delete this.Location,delete this.Callback,delete this.SignalConnections)}IsDisconnected(){return this.Disconnected}},N=class{constructor(e){this.Signal=e}Connect(e){return this.Signal.Connect(e)}IsDestroyed(){return this.Signal.IsDestroyed()}},s=class{constructor(){this.ConnectionReferences=new _,this.DestroyedState=!1}Connect(e){if(this.DestroyedState)throw"Cannot connect to a Destroyed Signal";return new o(this.ConnectionReferences,e)}Fire(...e){if(this.DestroyedState)throw"Cannot fire a Destroyed Signal";for(var[t,r]of this.ConnectionReferences.GetIterator())r.Callback(...e)}GetEvent(){return new N(this)}IsDestroyed(){return this.DestroyedState}Destroy(){if(!this.DestroyedState){for(var[e,t]of this.ConnectionReferences.GetIterator())t.Connection.Disconnect();this.DestroyedState=!0,delete this.ConnectionReferences}}},z=e=>e instanceof o,c=class{constructor(e,t){this.Cleaner=e,this.Id=t}Cancel(){void 0!==this.Id&&(this.Cleaner(this.Id),delete this.Id,delete this.Cleaner)}},l=(e,t)=>new c(window.clearTimeout.bind(window),setTimeout(t,1e3*e)),H=e=>e instanceof c,h=class{constructor(){this.Items=new Map,this.DestroyedState=!1,this.DestroyingSignal=new s,this.CleanedSignal=new s,this.DestroyedSignal=new s,this.Destroying=this.DestroyingSignal.GetEvent(),this.Cleaned=this.CleanedSignal.GetEvent(),this.Destroyed=this.DestroyedSignal.GetEvent()}CleanItem(e){e instanceof h?e.Destroy():H(e)?e.Cancel():e instanceof MutationObserver||e instanceof ResizeObserver?e.disconnect():z(e)?e.Disconnect():e instanceof HTMLElement?e.remove():e()}Give(e,t){return this.DestroyedState?this.CleanItem(e):(t=t??r(),this.Has(t)&&this.Clean(t),this.Items.set(t,e)),e}GiveItems(...e){for(const t of e)this.Give(t);return Array.from(arguments)}Has(e){return this.Items.has(e)}Clean(e){var t=this.Items.get(e);void 0!==t&&(this.Items.delete(e),this.CleanItem(t))}CleanUp(){for(var[e,t]of this.Items)this.Clean(e);!1===this.DestroyedState&&this.CleanedSignal.Fire()}IsDestroyed(){return this.DestroyedState}Destroy(){!1===this.DestroyedState&&(this.DestroyedState=!0,this.DestroyingSignal.Fire(),this.CleanUp(),delete this.Items,this.DestroyedSignal.Fire(),this.DestroyingSignal.Destroy(),this.CleanedSignal.Destroy(),this.DestroyedSignal.Destroy(),delete this.DestroyingSignal,delete this.CleanedSignal,delete this.DestroyedSignal)}},d=new h,y=document.currentScript,U=y.src.includes("https://xpui.app.spotify.com/"),u=new s,m=Spicetify.Player,v=Spicetify.CosmosAsync;Spicetify.showNotification;{const M=()=>{m=Spicetify.Player,v=Spicetify.CosmosAsync,e=Spicetify.showNotification,void 0===m||void 0===v||void 0===e?d.Give(l(0,M),"WaitForSpicetify"):u.Fire()};M()}var g,f,p,b,B=u.GetEvent(),S=()=>S,$={TrackInformation:{},ISRCLyrics:{}},J={Analytics:{}},w=new Map,C=(w.set("TrackInformation",1),w.set("ISRCLyrics",1),new Map),x=(C.set("Analytics",1),new class{constructor(){var t,r,i,n,e=this.LoadStore("General"),o=this.LoadStore("ExpireCache");for(const s of["ISRCLyrics","TrackInformation"]){var a=o[s];let e=!1;for(const c in a)a[c].ExpiresAt{var e=null==(e=m.data)?void 0:e.track,t=(null!=(t=null==e?void 0:e.uri.match(Q))?t:[])[1];if(t!==(null==g?void 0:g.Id)){if(I.Clean("Song"),(g=void 0)!==t){var i=t;var r=e;const n=I.Give(new h,"Song");g=new D(i,r),new Promise(t=>{var e=x.GetFromExpireCache("TrackInformation",i);void 0===e?v.request("GET","https://api.spotify.com/v1/tracks/"+i).catch(e=>{throw console.warn(e),e}).then(e=>{if(e.status<200||299{const r=t.external_ids.isrc;var e=x.GetFromExpireCache("ISRCLyrics",r);return void 0===e?fetch("https://beautiful-lyrics.socalifornian.live/lyrics/"+r).then(e=>{if(!1===e.ok)throw`Failed to load Lyrics for Track (${i}), Error: ${e.status} `+e.statusText;return e.text()}).then(e=>{if(0!==e.length)return JSON.parse(e)}).then(e=>(x.SetExpireCacheItem("ISRCLyrics",r,null!=e&&e,W),[t,e])):Promise.resolve([t,e||void 0])}).then(([e,t])=>{n.IsDestroyed()||(g=new K(i,r,e,t),G.Fire(g))})}k.Fire(g)}},X=k.GetEvent(),Y=(G.GetEvent(),()=>g),E=new s,Z=e=>{(null==e?void 0:e.CoverArt.Default)!==(null==f?void 0:f.Default)&&(f=null==e?void 0:e.CoverArt,E.Fire(f))},ee=E.GetEvent(),te=()=>f,re=e=>{e=e.match(/(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?/);if(null!==e)return{Text:e[0],Major:parseInt(e[1]),Minor:parseInt(e[2]),Patch:parseInt(e[3]),Control:e[4]?parseInt(e[4]):void 0}},ie=re("2.5.4"),ne=async()=>{let n=1;fetch("https://api.github.com/repos/surfbryce/beautiful-lyrics/contents/dist/beautiful-lyrics.js").then(e=>e.json()).then(e=>fetch("https://api.github.com/repos/surfbryce/beautiful-lyrics/git/blobs/"+e.sha)).then(e=>e.json()).then(e=>atob(e.content)).then(e=>{var t,r,i=re(e);void 0!==i&&([t,r]=((e,t)=>{t={Text:"",Major:t.Major-e.Major,Minor:t.Minor-e.Minor,Patch:t.Patch-e.Patch,Control:void 0===t.Control&&void 0===e.Control?0:void 0===t.Control||void 0===e.Control?e.Control:t.Control-e.Control};return[t,0!==t.Major||0!==t.Minor||0!==t.Patch||0!==t.Control]})(ie,i),r&&(2Beautiful Lyrics Updated! +var beautifulDlyrics=(()=>{var V=Object.defineProperty,i=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,n=(e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a=(e,t)=>{for(var r in t=t||{})A.call(t,r)&&n(e,r,t[r]);if(i)for(var r of i(t))_.call(t,r)&&n(e,r,t[r]);return e},t=new Set;function r(){for(;;){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)});if(!1===t.has(e))return t.add(e),e}}var e,j=class{constructor(){this.Items=new Map,this.DestroyedState=!1}Push(e){var t=r();return this.Items.set(t,e),t}Get(e){return this.Items.get(e)}Remove(e){var t=this.Items.get(e);if(void 0!==t)return this.Items.delete(e),t}GetIterator(){return this.Items.entries()}IsDestroyed(){return this.DestroyedState}Destroy(){this.DestroyedState||(this.DestroyedState=!0,delete this.Items)}},o=class{constructor(e,t){this.ConnectionReferences=e,this.Disconnected=!1,this.Location=e.Push({Callback:t,Connection:this})}Disconnect(){this.Disconnected||(this.Disconnected=!0,this.ConnectionReferences.Remove(this.Location),delete this.Location,delete this.Callback,delete this.SignalConnections)}IsDisconnected(){return this.Disconnected}},N=class{constructor(e){this.Signal=e}Connect(e){return this.Signal.Connect(e)}IsDestroyed(){return this.Signal.IsDestroyed()}},s=class{constructor(){this.ConnectionReferences=new j,this.DestroyedState=!1}Connect(e){if(this.DestroyedState)throw"Cannot connect to a Destroyed Signal";return new o(this.ConnectionReferences,e)}Fire(...e){if(this.DestroyedState)throw"Cannot fire a Destroyed Signal";for(var[t,r]of this.ConnectionReferences.GetIterator())r.Callback(...e)}GetEvent(){return new N(this)}IsDestroyed(){return this.DestroyedState}Destroy(){if(!this.DestroyedState){for(var[e,t]of this.ConnectionReferences.GetIterator())t.Connection.Disconnect();this.DestroyedState=!0,delete this.ConnectionReferences}}},z=e=>e instanceof o,c=class{constructor(e,t){this.Cleaner=e,this.Id=t}Cancel(){void 0!==this.Id&&(this.Cleaner(this.Id),delete this.Id,delete this.Cleaner)}},l=(e,t)=>new c(window.clearTimeout.bind(window),setTimeout(t,1e3*e)),H=e=>e instanceof c,h=class{constructor(){this.Items=new Map,this.DestroyedState=!1,this.DestroyingSignal=new s,this.CleanedSignal=new s,this.DestroyedSignal=new s,this.Destroying=this.DestroyingSignal.GetEvent(),this.Cleaned=this.CleanedSignal.GetEvent(),this.Destroyed=this.DestroyedSignal.GetEvent()}CleanItem(e){e instanceof h?e.Destroy():H(e)?e.Cancel():e instanceof MutationObserver||e instanceof ResizeObserver?e.disconnect():z(e)?e.Disconnect():e instanceof HTMLElement?e.remove():e()}Give(e,t){return this.DestroyedState?this.CleanItem(e):(t=t??r(),this.Has(t)&&this.Clean(t),this.Items.set(t,e)),e}GiveItems(...e){for(const t of e)this.Give(t);return Array.from(arguments)}Has(e){return this.Items.has(e)}Clean(e){var t=this.Items.get(e);void 0!==t&&(this.Items.delete(e),this.CleanItem(t))}CleanUp(){for(var[e,t]of this.Items)this.Clean(e);!1===this.DestroyedState&&this.CleanedSignal.Fire()}IsDestroyed(){return this.DestroyedState}Destroy(){!1===this.DestroyedState&&(this.DestroyedState=!0,this.DestroyingSignal.Fire(),this.CleanUp(),delete this.Items,this.DestroyedSignal.Fire(),this.DestroyingSignal.Destroy(),this.CleanedSignal.Destroy(),this.DestroyedSignal.Destroy(),delete this.DestroyingSignal,delete this.CleanedSignal,delete this.DestroyedSignal)}},d=new h,y=document.currentScript,B=y.src.includes("https://xpui.app.spotify.com/"),u=new s,m=Spicetify.Player,v=Spicetify.CosmosAsync;Spicetify.showNotification;{const M=()=>{m=Spicetify.Player,v=Spicetify.CosmosAsync,e=Spicetify.showNotification,void 0===m||void 0===v||void 0===e?d.Give(l(0,M),"WaitForSpicetify"):u.Fire()};M()}var g,f,p,b,U=u.GetEvent(),S=()=>S,$={TrackInformation:{},ISRCLyrics:{}},J={Analytics:{}},w=new Map,C=(w.set("TrackInformation",1),w.set("ISRCLyrics",2),new Map),x=(C.set("Analytics",1),new class{constructor(){var t,r,i,n,e=this.LoadStore("General"),o=this.LoadStore("ExpireCache");for(const s of["ISRCLyrics","TrackInformation"]){var a=o[s];let e=!1;for(const c in a)a[c].ExpiresAt{var e=null==(e=m.data)?void 0:e.track,t=(null!=(t=null==e?void 0:e.uri.match(Q))?t:[])[1];if(t!==(null==g?void 0:g.Id)){if(I.Clean("Song"),(g=void 0)!==t){var i=t;var r=e;const n=I.Give(new h,"Song");g=new D(i,r),new Promise(t=>{var e=x.GetFromExpireCache("TrackInformation",i);void 0===e?v.request("GET","https://api.spotify.com/v1/tracks/"+i).catch(e=>{throw console.warn(e),e}).then(e=>{if(e.status<200||299{const r=t.external_ids.isrc;var e=x.GetFromExpireCache("ISRCLyrics",r);return void 0===e?fetch("https://beautiful-lyrics.socalifornian.live/lyrics/"+r).then(e=>{if(!1===e.ok)throw`Failed to load Lyrics for Track (${i}), Error: ${e.status} `+e.statusText;return e.text()}).then(e=>{if(0!==e.length)return JSON.parse(e)}).then(e=>(x.SetExpireCacheItem("ISRCLyrics",r,null!=e&&e,W),[t,e])):Promise.resolve([t,e||void 0])}).then(([e,t])=>{n.IsDestroyed()||(g=new K(i,r,e,t),G.Fire(g))})}k.Fire(g)}},X=k.GetEvent(),Y=(G.GetEvent(),()=>g),E=new s,Z=e=>{(null==e?void 0:e.CoverArt.Default)!==(null==f?void 0:f.Default)&&(f=null==e?void 0:e.CoverArt,E.Fire(f))},ee=E.GetEvent(),te=()=>f,re=e=>{e=e.match(/(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?/);if(null!==e)return{Text:e[0],Major:parseInt(e[1]),Minor:parseInt(e[2]),Patch:parseInt(e[3]),Control:e[4]?parseInt(e[4]):void 0}},ie=re("2.5.5"),ne=async()=>{let n=1;fetch("https://api.github.com/repos/surfbryce/beautiful-lyrics/contents/dist/beautiful-lyrics.js").then(e=>e.json()).then(e=>fetch("https://api.github.com/repos/surfbryce/beautiful-lyrics/git/blobs/"+e.sha)).then(e=>e.json()).then(e=>atob(e.content)).then(e=>{var t,r,i=re(e);void 0!==i&&([t,r]=((e,t)=>{t={Text:"",Major:t.Major-e.Major,Minor:t.Minor-e.Minor,Patch:t.Patch-e.Patch,Control:void 0===t.Control&&void 0===e.Control?0:void 0===t.Control||void 0===e.Control?e.Control:t.Control-e.Control};return[t,0!==t.Major||0!==t.Minor||0!==t.Patch||0!==t.Control]})(ie,i),r&&(2Beautiful Lyrics Updated!

No need to re-install - it's already running!

- Version ${ie.Text} -> ${i.Text}`,t.Major<0||t.Minor<0||t.Patch<0||0console.warn("Error: "+e)).finally(()=>d.Give(l(60*n,ne),"CheckForUpdate"))};{const P=new Map,O=(P.set("VanillaFullScreen","#main:has(.os-content .lyrics-lyrics-container) .under-main-view"),P.set("VanillaSideCard","aside:has(.main-nowPlayingView-section) .os-padding"),P.set("LyricsPlusFullScreen","#main:has(.os-content .lyrics-lyricsContainer-LyricsContainer) .under-main-view"),d.Give(new h,"LiveBackgrounds"));p=()=>{for(var[e,t]of P){t=document.body.querySelector(t);(O.Has(e)?null===t:null!==t)&&(null===t?O.Clean(e):((e,t)=>{var e=O.Give(new h,e),r=e.Give(document.createElement("div"));r.classList.add("lyrics-background-container");const[i,n,o]=e.GiveItems(document.createElement("img"),document.createElement("img"),document.createElement("img"));i.classList.add("lyrics-background-color"),n.classList.add("lyrics-background-back"),o.classList.add("lyrics-background-back-center"),r.appendChild(i),r.appendChild(n),r.appendChild(o);var a=()=>{var e=null!=(e=null==(e=te())?void 0:e.Default)?e:"";i.src=e,n.src=e,o.src=e},a=(e.Give(ee.Connect(a)),a(),()=>{t.classList.contains("lyrics-background")||t.classList.add("lyrics-background")});a(),e.Give(new MutationObserver(a)).observe(t,{attributes:!0,attributeFilter:["class"],childList:!1,subtree:!1}),t.prepend(r),e.Give(()=>t.classList.remove("lyrics-background"))})(e,t))}}}{const F=4,ae=.5,T=d.Give(new h,"Lyrics"),R=new Map,se=(R.set("VanillaFullScreen",".lyrics-lyrics-contentWrapper"),R.set("VanillaSideCard",".main-nowPlayingView-lyricsContent"),"lyrics-lyricsContent-lyric"),ce="lyrics-lyricsContent-unsynced",le="lyrics-lyricsContent-highlight",de="lyrics-lyricsContent-active",he=e=>{var e=getComputedStyle(e),t=getComputedStyle(document.documentElement);return parseFloat(e.fontSize)/parseFloat(t.fontSize)},ye=(e,n)=>{const o=T.Give(new h,e),a=new Map;let s=0;const c=(e,t)=>{e.style.fontSize="Active"==t.State?s+ae+"rem":""},l=()=>{let t;for(var[e,r]of a){e=e.classList;e.contains(de)?(r.State="Active",t=r.LayoutOrder):e.contains(ce)?r.State="Unsynced":e.contains(le)?r.State="Sung":r.State="Unsung"}for(var[i,n]of a){var o="Active"===n.State||"Unsynced"===n.State;let e;e=o?0:void 0===t?F:Math.min(Math.abs(n.LayoutOrder-t),F);o=o?"var(--lyrics-color-active)":"Sung"===n.State?"var(--lyrics-color-passed)":"var(--lyrics-color-inactive)";!1===i.classList.contains("lyric")&&i.classList.add("lyric"),c(i,n),i.style.color="transparent",i.style.textShadow=`0 0 ${e}px `+o}};{const d=t=>{if(t instanceof HTMLDivElement&&t.classList.contains(se)){var i=t;var t=o.Give(new h,i),r=Array.from(n.children).indexOf(i);t.Give(new MutationObserver(l)).observe(i,{attributes:!0,attributeFilter:["class"],childList:!1,subtree:!1});let e=!1;!1===o.Has("FontResizeObserver")&&0===i.innerText.length&&(o.Give(new ResizeObserver(e=>{s=he(i);for(var[t,r]of a)c(t,r)}),"FontResizeObserver").observe(i),t.Give(()=>o.Clean("FontResizeObserver")),e=!0),a.set(i,{LayoutOrder:r,State:"Unsung",IsFontSizeObserver:e}),l()}};o.Give(new MutationObserver(e=>{for(const t of e)if("childList"===t.type){for(const r of t.removedNodes)r instanceof HTMLDivElement&&(a.delete(r),o.Clean(r));for(const i of t.addedNodes)d(i)}})).observe(n,{attributes:!1,childList:!0,subtree:!1});for(const t of n.childNodes)d(t)}};b=()=>{for(var[e,t]of R){t=document.body.querySelector(t);(T.Has(e)?null===t:null!==t)&&(null===t?T.Clean(e):ye(e,t))}}}var oe=async function(){await new Promise(e=>{S()?e():B.Connect(e)}),!1===U&&ne(),m.addEventListener("songchange",L),d.Give(()=>m.removeEventListener("songchange",L)),L(),d.Give(X.Connect(Z)),Z(Y()),d.Give(new MutationObserver(()=>{p(),b()})).observe(document.body,{attributes:!1,childList:!0,subtree:!0}),p(),b();var e=x.GetItem("Analytics"),t=void 0!==(t=e.LastVisitedAt)?new Date(t):void 0,r=((r=new Date).setHours(0,0,0,0),r.getTime());(null==t?void 0:t.getTime())!==r&&(e.LastVisitedAt=r,x.SaveItemChanges("Analytics"),(t=d.Give(document.createElement("iframe"))).src="https://track.beautiful-lyrics.socalifornian.live/",t.style.display="none",document.body.appendChild(t))};(async()=>{await oe()})()})();(async()=>{var e;document.getElementById("beautifulDlyrics")||((e=document.createElement("style")).id="beautifulDlyrics",e.textContent=String.raw` + Version ${ie.Text} -> ${i.Text}`,t.Major<0||t.Minor<0||t.Patch<0||0console.warn("Error: "+e)).finally(()=>d.Give(l(60*n,ne),"CheckForUpdate"))};{const P=new Map,O=(P.set("VanillaFullScreen","#main:has(.os-content .lyrics-lyrics-container) .under-main-view"),P.set("VanillaSideCard","aside:has(.main-nowPlayingView-section) .os-padding"),P.set("LyricsPlusFullScreen","#main:has(.os-content .lyrics-lyricsContainer-LyricsContainer) .under-main-view"),d.Give(new h,"LiveBackgrounds"));p=()=>{for(var[e,t]of P){t=document.body.querySelector(t);(O.Has(e)?null===t:null!==t)&&(null===t?O.Clean(e):((e,t)=>{var e=O.Give(new h,e),r=e.Give(document.createElement("div"));r.classList.add("lyrics-background-container");const[i,n,o]=e.GiveItems(document.createElement("img"),document.createElement("img"),document.createElement("img"));i.classList.add("lyrics-background-color"),n.classList.add("lyrics-background-back"),o.classList.add("lyrics-background-back-center"),r.appendChild(i),r.appendChild(n),r.appendChild(o);var a=()=>{var e=null!=(e=null==(e=te())?void 0:e.Default)?e:"";i.src=e,n.src=e,o.src=e},a=(e.Give(ee.Connect(a)),a(),()=>{t.classList.contains("lyrics-background")||t.classList.add("lyrics-background")});a(),e.Give(new MutationObserver(a)).observe(t,{attributes:!0,attributeFilter:["class"],childList:!1,subtree:!1}),t.prepend(r),e.Give(()=>t.classList.remove("lyrics-background"))})(e,t))}}}{const F=4,ae=.5,T=d.Give(new h,"Lyrics"),R=new Map,se=(R.set("VanillaFullScreen",".lyrics-lyrics-contentWrapper"),R.set("VanillaSideCard",".main-nowPlayingView-lyricsContent"),"lyrics-lyricsContent-lyric"),ce="lyrics-lyricsContent-unsynced",le="lyrics-lyricsContent-highlight",de="lyrics-lyricsContent-active",he=e=>{var e=getComputedStyle(e),t=getComputedStyle(document.documentElement);return parseFloat(e.fontSize)/parseFloat(t.fontSize)},ye=(e,n)=>{const o=T.Give(new h,e),a=new Map;let s=0;const c=(e,t)=>{e.style.fontSize="Active"==t.State?s+ae+"rem":""},l=()=>{let t;for(var[e,r]of a){e=e.classList;e.contains(de)?(r.State="Active",t=r.LayoutOrder):e.contains(ce)?r.State="Unsynced":e.contains(le)?r.State="Sung":r.State="Unsung"}for(var[i,n]of a){var o="Active"===n.State||"Unsynced"===n.State;let e;e=o?0:void 0===t?F:Math.min(Math.abs(n.LayoutOrder-t),F);o=o?"var(--lyrics-color-active)":"Sung"===n.State?"var(--lyrics-color-passed)":"var(--lyrics-color-inactive)";!1===i.classList.contains("lyric")&&i.classList.add("lyric"),c(i,n),i.style.color="transparent",i.style.textShadow=`0 0 ${e}px `+o}};{const d=t=>{if(t instanceof HTMLDivElement&&t.classList.contains(se)){var i=t;var t=o.Give(new h,i),r=Array.from(n.children).indexOf(i);t.Give(new MutationObserver(l)).observe(i,{attributes:!0,attributeFilter:["class"],childList:!1,subtree:!1});let e=!1;!1===o.Has("FontResizeObserver")&&0===i.innerText.length&&(o.Give(new ResizeObserver(e=>{s=he(i);for(var[t,r]of a)c(t,r)}),"FontResizeObserver").observe(i),t.Give(()=>o.Clean("FontResizeObserver")),e=!0),a.set(i,{LayoutOrder:r,State:"Unsung",IsFontSizeObserver:e}),l()}};o.Give(new MutationObserver(e=>{for(const t of e)if("childList"===t.type){for(const r of t.removedNodes)r instanceof HTMLDivElement&&(a.delete(r),o.Clean(r));for(const i of t.addedNodes)d(i)}})).observe(n,{attributes:!1,childList:!0,subtree:!1});for(const t of n.childNodes)d(t)}};b=()=>{for(var[e,t]of R){t=document.body.querySelector(t);(T.Has(e)?null===t:null!==t)&&(null===t?T.Clean(e):ye(e,t))}}}var oe=async function(){await new Promise(e=>{S()?e():U.Connect(e)}),!1===B&&ne(),m.addEventListener("songchange",L),d.Give(()=>m.removeEventListener("songchange",L)),L(),d.Give(X.Connect(Z)),Z(Y()),d.Give(new MutationObserver(()=>{p(),b()})).observe(document.body,{attributes:!1,childList:!0,subtree:!0}),p(),b();var e=x.GetItem("Analytics"),t=void 0!==(t=e.LastVisitedAt)?new Date(t):void 0,r=((r=new Date).setHours(0,0,0,0),r.getTime());(null==t?void 0:t.getTime())!==r&&(e.LastVisitedAt=r,x.SaveItemChanges("Analytics"),(t=d.Give(document.createElement("iframe"))).src="https://track.beautiful-lyrics.socalifornian.live/",t.style.display="none",document.body.appendChild(t))};(async()=>{await oe()})()})();(async()=>{var e;document.getElementById("beautifulDlyrics")||((e=document.createElement("style")).id="beautifulDlyrics",e.textContent=String.raw` .main-lyricsCinema-controls,.main-nowPlayingView-lyricsControls{mix-blend-mode:overlay}.lyric:hover{text-shadow:0 0 0 var(--lyrics-color-active)!important}.lyrics-lyricsContent-active{margin-top:.25em;margin-bottom:.25em}aside:has(.main-nowPlayingView-section) .main-nowPlayingView-content{background:0 0}aside:has(.main-nowPlayingView-section) .lyrics-background .main-trackInfo-artists{opacity:.75;filter:brightness(1.15)}aside:has(.main-nowPlayingView-section) .main-nowPlayingView-coverArt{opacity:.85;box-shadow:rgba(0,0,0,.2705882353) 0 9px 20px 0}aside:has(.main-nowPlayingView-section) .main-nowPlayingView-section{background-color:var(--background-tinted-base)!important}#lyrics-cinema .os-scrollbar,.Root__main-view:has(.lyrics-background) .os-scrollbar,.os-host:has(.lyrics-background) .os-scrollbar{padding:5px}#lyrics-cinema .os-scrollbar .os-scrollbar-handle,.Root__main-view:has(.lyrics-background) .os-scrollbar .os-scrollbar-handle,.os-host:has(.lyrics-background) .os-scrollbar .os-scrollbar-handle{mix-blend-mode:overlay;background-color:rgba(252,249,249,.117)!important}.lyrics-lyrics-container,.main-nowPlayingView-section{--lyrics-color-inactive:rgb(240 240 240 / 51%)!important}.os-viewport .lyrics-lyrics-background{background:0 0}.os-viewport .lyrics-lyrics-container{margin-top:25vh}.os-viewport .lyrics-lyrics-container.lyrics-lyrics-coverTopBar{margin-top:7.5vh}.lyrics-lyricsContainer-LyricsBackground{background-color:transparent!important;background-image:none!important}#main:has(.under-main-view.lyrics-background) .Root__top-bar{mix-blend-mode:screen}.lyrics-background{overflow:hidden;position:static}.lyrics-background.main-nowPlayingView-sectionHeaderSpacing.main-nowPlayingView-lyricsGradient{background:0 0}.lyrics-background.os-viewport:not(:has(.main-nowPlayingView-content)){overflow:initial}#main:not(:has(.lyrics-lyricsContainer-LyricsBackground)) .lyrics-background.under-main-view>.lyrics-background-container{max-width:35%;max-height:30%;scale:290% 340%;transform-origin:left top}#main:has(.lyrics-lyricsContainer-LyricsBackground) .lyrics-background.under-main-view>.lyrics-background-container{max-width:25%;max-height:40%;scale:400% 250%;transform-origin:left top}#main:has(#lyrics-cinema .lyrics-lyrics-background) .lyrics-background.under-main-view .lyrics-background-container{z-index:1}.lyrics-background.os-padding:has(.main-nowPlayingView-content) .lyrics-background-container{border-radius:8px;filter:saturate(2) brightness(.7)}.lyrics-background-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden;filter:saturate(1.5) brightness(.8)}.lyrics-background-back,.lyrics-background-back-center,.lyrics-background-color{width:200%;position:absolute;border-radius:100em;animation:rotate 35s linear infinite}.lyrics-background-color{right:0;top:0;filter:blur(40px);z-index:10;mix-blend-mode:revert}.lyrics-background-back{left:0;bottom:0;filter:blur(40px);z-index:1;animation-direction:reverse}.lyrics-background-back-center{filter:blur(40px);z-index:0;width:300%;right:-50%;top:-20%;animation-direction:reverse}@keyframes rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}:root{--beautiful-lyrics-random-degree:258deg}@keyframes rotate{0%{transform:rotate(var(--beautiful-lyrics-random-degree))}100%{transform:rotate(calc(var(--beautiful-lyrics-random-degree) + 360deg))}} `.trim(),document.head.appendChild(e))})(); \ No newline at end of file diff --git a/package.json b/package.json index 5005e4a..27c043e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "beautiful-lyrics", - "version": "2.5.4", + "version": "2.5.5", "private": true, "scripts": { "build": "spicetify-creator --out=dist --minify",