diff --git a/plugins/package-lock.json b/plugins/package-lock.json index 11a1b74..455b5fa 100644 --- a/plugins/package-lock.json +++ b/plugins/package-lock.json @@ -7,7 +7,8 @@ "name": "neptune-plugin-template", "dependencies": { "canvas-confetti": "^1.9.3", - "neptune-types": "^1.0.1" + "neptune-types": "^1.0.1", + "wanakana": "^5.3.1" }, "devDependencies": { "esbuild": "^0.18.13" @@ -527,6 +528,15 @@ "oby": "^14.3.0" } }, + "node_modules/wanakana": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/wanakana/-/wanakana-5.3.1.tgz", + "integrity": "sha512-OSDqupzTlzl2LGyqTdhcXcl6ezMiFhcUwLBP8YKaBIbMYW1wAwDvupw2T9G9oVaKT9RmaSpyTXjxddFPUcFFIw==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/zod": { "version": "3.24.2", "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", diff --git a/plugins/package.json b/plugins/package.json index f679e72..8b67891 100644 --- a/plugins/package.json +++ b/plugins/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "canvas-confetti": "^1.9.3", - "neptune-types": "^1.0.1" + "neptune-types": "^1.0.1", + "wanakana": "^5.3.1" } } diff --git a/plugins/plugins/oled-theme/dist/index.js b/plugins/plugins/oled-theme/dist/index.js index 802cdde..34de185 100644 --- a/plugins/plugins/oled-theme/dist/index.js +++ b/plugins/plugins/oled-theme/dist/index.js @@ -1,6 +1,6 @@ -var y=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var R=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},O=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of w(e))!S.call(t,c)&&c!==r&&y(t,c,{get:()=>e[c],enumerable:!(a=T(e,c))||a.enumerable});return t};var v=t=>O(y({},"__esModule",{value:!0}),t);var C={};N(C,{Tracer:()=>p,libTrace:()=>k});import{actions as h}from"@neptune";var p,k,f=R(()=>{"use strict";p=t=>{let e=o=>{let i=(...l)=>{o(t,...l)};return i.withContext=l=>(...g)=>{o(t,l,...g)},i},r=e(console.log),a=e(console.warn),c=e(console.error),s=e(console.debug),n=(o,i,l)=>{let g=m=>{o(m),i({message:`${t} - ${m}`,category:"OTHER",severity:l})};return g.withContext=m=>{let I=o.withContext(m);return d=>{I(d),d instanceof Error&&(d=d.message),i({message:`${t}.${m} - ${d}`,category:"OTHER",severity:l})}},g};return{log:r,warn:a,err:c,debug:s,msg:{log:n(r,h.message.messageInfo,"INFO"),warn:n(a,h.message.messageWarn,"WARN"),err:n(c,h.message.messageError,"ERROR")}}},k=p("[lib]")});f();import{intercept as E}from"@neptune";f();var A=p("[OLED Theme]"),_="https://raw.githubusercontent.com/ItzzExcel/neptune-projects/refs/heads/main/themes/black-neptune-theme.css",x,u;function $(t){let e=document.createElement("style");return e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.head.appendChild(e),e}function P(){u&&u.parentNode&&u.parentNode.removeChild(u)}async function U(t){try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.text()}catch(e){return A.msg.err(`Failed to fetch URL: ${e.message}`),null}}(async()=>(x=await U(_),u=$(x)))();var b=function([t]){let e=document.querySelector('figure[class*="albumImage"] > div > div > div > img'),r;e&&(r=e.src,r=r.replace(/\d+x\d+/,"1280x1280"),e.src=r);let a=document.querySelector('[class*="nowPlayingContainer"]');if(a&&r){a.querySelectorAll(".corner-image").forEach(o=>o.remove());let s=document.createElement("img");s.src=r,s.className="corner-image",s.style.position="absolute",s.style.left="50%",s.style.top="50%",s.style.transform="translate(-50%, -50%)",s.style.width="75vw",s.style.height="150vh",s.style.objectFit="cover",s.style.zIndex="-1",s.style.filter="blur(100px) brightness(0.6) contrast(1.2) saturate(2)",s.style.animation="spin 35s linear infinite",a.appendChild(s);let n=document.createElement("img");if(n.src=r,n.className="corner-image",n.style.position="absolute",n.style.left="50%",n.style.top="50%",n.style.transform="translate(-50%, -50%)",n.style.width="75vw",n.style.height="150vh",n.style.objectFit="cover",n.style.zIndex="-1",n.style.filter="blur(100px) brightness(0.6) contrast(1.2) saturate(2)",n.style.animation="spin 35s linear infinite",a.appendChild(n),!document.querySelector("#spinAnimation")){let o=document.createElement("style");o.id="spinAnimation",o.textContent=` +var f=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(t&&(e=t(t=0)),e);var A=(t,e)=>{for(var r in e)f(t,r,{get:e[r],enumerable:!0})},O=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of w(e))!S.call(t,c)&&c!==r&&f(t,c,{get:()=>e[c],enumerable:!(a=I(e,c))||a.enumerable});return t};var N=t=>O(f({},"__esModule",{value:!0}),t);var T={};A(T,{Tracer:()=>h,libTrace:()=>R});import{actions as C}from"@neptune";var h,R,E=k(()=>{"use strict";h=t=>{let e=s=>{let m=(...l)=>{s(t,...l)};return m.withContext=l=>(...y)=>{s(t,l,...y)},m},r=e(console.log),a=e(console.warn),c=e(console.error),o=e(console.debug),n=(s,m,l)=>{let y=u=>{s(u),m({message:`${t} - ${u}`,category:"OTHER",severity:l})};return y.withContext=u=>{let x=s.withContext(u);return d=>{x(d),d instanceof Error&&(d=d.message),m({message:`${t}.${u} - ${d}`,category:"OTHER",severity:l})}},y};return{log:r,warn:a,err:c,debug:o,msg:{log:n(r,C.message.messageInfo,"INFO"),warn:n(a,C.message.messageWarn,"WARN"),err:n(c,C.message.messageError,"ERROR")}}},R=h("[lib]")});E();import{intercept as p}from"@neptune";E();var v=h("[OLED Theme]"),_="https://raw.githubusercontent.com/ItzzExcel/neptune-projects/refs/heads/main/themes/black-neptune-theme.css",b,g;function P(t){let e=document.createElement("style");return e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.head.appendChild(e),e}function U(){g&&g.parentNode&&g.parentNode.removeChild(g)}async function D(t){try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.text()}catch(e){return v.msg.err(`Failed to fetch URL: ${e.message}`),null}}(async()=>(b=await D(_),g=P(b)))();var i=function(t=0){t===1&&setTimeout(()=>{i()},2e3);let e=document.querySelector('figure[class*="albumImage"] > div > div > div > img'),r;e&&(r=e.src,r=r.replace(/\d+x\d+/,"1280x1280"),e.src=r);let a=document.querySelector('[class*="nowPlayingContainer"]');if(a&&r){a.querySelectorAll(".corner-image").forEach(s=>s.remove());let o=document.createElement("img");o.src=r,o.className="corner-image",o.style.position="absolute",o.style.left="50%",o.style.top="50%",o.style.transform="translate(-50%, -50%)",o.style.width="75vw",o.style.height="150vh",o.style.objectFit="cover",o.style.zIndex="-1",o.style.filter="blur(100px) brightness(0.6) contrast(1.2) saturate(1)",o.style.animation="spin 35s linear infinite",a.appendChild(o);let n=document.createElement("img");if(n.src=r,n.className="corner-image",n.style.position="absolute",n.style.left="50%",n.style.top="50%",n.style.transform="translate(-50%, -50%)",n.style.width="75vw",n.style.height="150vh",n.style.objectFit="cover",n.style.zIndex="-1",n.style.filter="blur(100px) brightness(0.6) contrast(1.2) saturate(1)",n.style.animation="spin 35s linear infinite",a.appendChild(n),!document.querySelector("#spinAnimation")){let s=document.createElement("style");s.id="spinAnimation",s.textContent=` @keyframes spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } } - `,document.head.appendChild(o)}}},q=E("playbackControls/PREFILL_MEDIA_PRODUCT_TRANSITION",b),D=E("playbackControls/MEDIA_PRODUCT_TRANSITION",b);function W(){P(),q(),D()}export{W as onUnload}; + `,document.head.appendChild(s)}}},$=function(){[...document.getElementsByClassName("corner-image")].forEach(t=>{t.remove()})},L=p("playbackControls/PREFILL_MEDIA_PRODUCT_TRANSITION",i),q=p("playbackControls/MEDIA_PRODUCT_TRANSITION",i),F=p("playbackControls/SEEK",i),z=p("playbackControls/SET_PLAYBACK_STATE",i),H=p("playbackControls/TIME_UPDATE",i);function Y(){U(),L(),q(),F(),z(),H(),$()}export{Y as onUnload}; diff --git a/plugins/plugins/oled-theme/dist/manifest.json b/plugins/plugins/oled-theme/dist/manifest.json index 38a6d0e..6a92ef9 100644 --- a/plugins/plugins/oled-theme/dist/manifest.json +++ b/plugins/plugins/oled-theme/dist/manifest.json @@ -1 +1 @@ -{"name":"Dark Abyss (OLED Theme)","description":"A working themem, ong.","author":"itzzexcel@github","hash":"9dc95fd9e70e3eb67d7765dd0400c463","metafile":{"inputs":{"plugins/oled-theme/src/tracer.js":{"bytes":1596,"imports":[{"path":"@neptune","kind":"import-statement","external":true}],"format":"esm"},"plugins/oled-theme/src/index.js":{"bytes":5423,"imports":[{"path":"plugins/oled-theme/src/tracer.js","kind":"import-statement","original":"./tracer"},{"path":"@neptune","kind":"import-statement","external":true},{"path":"plugins/oled-theme/src/tracer.js","kind":"require-call","original":"./tracer"}],"format":"esm"}},"outputs":{"plugins/oled-theme/dist/index.js":{"imports":[{"path":"@neptune","kind":"import-statement","external":true},{"path":"@neptune","kind":"import-statement","external":true}],"exports":["onUnload"],"entryPoint":"plugins/oled-theme/src/index.js","inputs":{"plugins/oled-theme/src/tracer.js":{"bytesInOutput":693},"plugins/oled-theme/src/index.js":{"bytesInOutput":2261}},"bytes":3424}}}} \ No newline at end of file +{"name":"Dark Abyss (OLED Theme)","description":"A working themem, ong.","author":"itzzexcel@github","hash":"f197c4479672784c42c856eae4408da9","metafile":{"inputs":{"plugins/oled-theme/src/tracer.js":{"bytes":1596,"imports":[{"path":"@neptune","kind":"import-statement","external":true}],"format":"esm"},"plugins/oled-theme/src/index.js":{"bytes":6084,"imports":[{"path":"plugins/oled-theme/src/tracer.js","kind":"import-statement","original":"./tracer"},{"path":"@neptune","kind":"import-statement","external":true},{"path":"plugins/oled-theme/src/tracer.js","kind":"require-call","original":"./tracer"}],"format":"esm"}},"outputs":{"plugins/oled-theme/dist/index.js":{"imports":[{"path":"@neptune","kind":"import-statement","external":true},{"path":"@neptune","kind":"import-statement","external":true}],"exports":["onUnload"],"entryPoint":"plugins/oled-theme/src/index.js","inputs":{"plugins/oled-theme/src/tracer.js":{"bytesInOutput":693},"plugins/oled-theme/src/index.js":{"bytesInOutput":2516}},"bytes":3679}}}} \ No newline at end of file diff --git a/plugins/plugins/oled-theme/src/index.js b/plugins/plugins/oled-theme/src/index.js index 084ee19..fb924a4 100644 --- a/plugins/plugins/oled-theme/src/index.js +++ b/plugins/plugins/oled-theme/src/index.js @@ -44,10 +44,17 @@ async function HttpGet(url) { styleElement = ApplyCSS(style); })(); -const onTrackChanged = function ([track]) { +const onTrackChanged = function (method = 0) { // Tu amor tan liminal, tu amor tan liminal // - Ghouljaboy, 2021 + if (method === 1) { + setTimeout(() => { + onTrackChanged(); + return; + }, 2000); + } + let albumImageElement = document.querySelector('figure[class*="albumImage"] > div > div > div > img'); let albumImageSrc; @@ -112,6 +119,12 @@ const onTrackChanged = function ([track]) { } } +const cleanUpDynamicArt = function () { + [...document.getElementsByClassName("corner-image")].forEach((element) => { + element.remove(); + }); +} + // const onTrackPaused = function ([track]) { // [...document.getElementsByClassName("corner-image")].forEach((element) => { // element.style.animation = "spin 50s linear infinite"; @@ -126,6 +139,9 @@ const onTrackChanged = function ([track]) { const unOnTrackChanged1 = intercept("playbackControls/PREFILL_MEDIA_PRODUCT_TRANSITION", onTrackChanged); const unOnTrackChanged2 = intercept("playbackControls/MEDIA_PRODUCT_TRANSITION", onTrackChanged); +const unOnTrackChanged3 = intercept("playbackControls/SEEK", onTrackChanged); +const unOnTrackChanged4 = intercept("playbackControls/SET_PLAYBACK_STATE", onTrackChanged); +const unOnTrackChanged5 = intercept("playbackControls/TIME_UPDATE", onTrackChanged); // const unOnTrackPaused1 = intercept("playbackControls/STOP", onTrackPaused); // const unOnTrackPaused2 = intercept("playbackControls/PAUSE", onTrackPaused); // const unOnTrackResumed = intercept("playbackControls/PLAY", onTrackResumed); @@ -135,6 +151,10 @@ export function onUnload() { CleanUpCSS(); unOnTrackChanged1(); unOnTrackChanged2(); + unOnTrackChanged3(); + unOnTrackChanged4(); + unOnTrackChanged5(); + cleanUpDynamicArt(); // unOnTrackPaused1(); // unOnTrackPaused2(); // unOnTrackResumed();