diff --git a/src/renderer/index.js b/src/renderer/index.js index d2d54751..8033627b 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -232,6 +232,7 @@ const app = new Vue({ mkIsReady: false, playerReady: false, animateBackground: false, + currentArtUrl: '', lyricon: false, currentTrackID: '', currentTrackIDBG: '', @@ -587,6 +588,7 @@ const app = new Vue({ self.chrome.artworkReady = false self.lyrics = [] self.richlyrics = [] + app.getCurrentArtURL(); app.getNowPlayingArtwork(42); app.getNowPlayingArtworkBG(32); app.loadLyrics() @@ -2527,6 +2529,7 @@ const app = new Vue({ } }, 200) }, + getNowPlayingArtwork(size = 600) { if (typeof this.mk.nowPlayingItem === "undefined") return; let interval = setInterval(() => { @@ -2537,7 +2540,7 @@ const app = new Vue({ if (document.querySelector('.app-playback-controls .artwork') != null) { clearInterval(interval); } - if (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"]) { + if (app.mk.nowPlayingItem.attributes.artwork != null && app.mk.nowPlayingItem.attributes.artwork.url != null && app.mk.nowPlayingItem.attributes.artwork.url!= '' ) { document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${decodeURI((this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"])).replace('{w}', size).replace('{h}', size)}")`); try { clearInterval(interval); @@ -2566,6 +2569,21 @@ const app = new Vue({ }, 200) + }, + async getCurrentArtURL(){ + try{ + this.currentArtUrl = ''; + if (app.mk.nowPlayingItem != null && app.mk.nowPlayingItem.attributes != null && app.mk.nowPlayingItem.attributes.artwork != null && app.mk.nowPlayingItem.attributes.artwork.url != null && app.mk.nowPlayingItem.attributes.artwork.url!= '' ) + {this.currentArtUrl = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ?? '').replace('{w}', 50).replace('{h}', 50); + } else { + let data = await this.mk.api.library.song(this.mk.nowPlayingItem.id); + if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) { + this.currentArtUrl = (data["attributes"]["artwork"]["url"] ?? '').replace('{w}', 50).replace('{h}', 50);; + } else {this.currentArtUrl = ''} + } + }catch(e){ + + } }, async setLibraryArt() { if (typeof this.mk.nowPlayingItem === "undefined") return; diff --git a/src/renderer/style.less b/src/renderer/style.less index 0a885ca8..39beb010 100644 --- a/src/renderer/style.less +++ b/src/renderer/style.less @@ -3567,16 +3567,149 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb { flex-grow: 1; } + .right-col{ + height: 50vh; + } + + .lyrics-col{ + width: 60vh; + height: 50vh; + + ::-webkit-scrollbar { + display: none; + } + + &:hover ::-webkit-scrollbar { + display: unset; + } + } + .artwork-col { justify-content: center; align-items: center; display: flex; + flex-direction: column; .artwork { width: 50vh; height: 50vh; } - } + + .controls-parents{ + width: 50vh; + } + + .app-playback-controls { + .song-artist , .song-name { + font-weight: 600; + text-align: center; + font-size: 0.9em; + margin-top: 0.25vh; + height: 0.9em; + line-height: 0.9em; + overflow: hidden; + max-width: 360px; + + .song-name-normal { + height: inherit; + } + + &.song-artist-marquee { + > marquee { + //margin-bottom: -3px; + } + } + } + .song-artist { + font-size: 0.875em; + } + } + + .app-playback-controls .playback-info { + margin-top: 0.5vh; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + position: relative; + + input[type="range"] { + width: 100%; + } + >div { + width: 100%; + text-align: center; + } + + + } + + .app-playback-controls .song-progress { + @bgColor: transparent; + //height: 16px; + position: absolute; + bottom: -2.5vh; + left: 0px; + background: @bgColor; + + .song-duration p { + font-weight: 400; + font-size: 10px; + height: 1.2em; + line-height: 1.3em; + overflow: hidden; + margin: 0 0 0.5em; + } + + &:hover { + > input[type=range] { + &::-webkit-slider-thumb { + opacity: 1; + transform: scale(1); + z-index: 1; + } + } + } + + > input[type=range] { + appearance: none; + width: 100%; + height: 4px; + background-color: rgb(200 200 200 / 10%); + border-radius: 2px; + + &::-webkit-slider-thumb { + opacity: 0; + transform: scale(0.5); + -webkit-appearance: none; + appearance: none; + width: 12px; + height: 12px; + border-radius: 100%; + background: var(--keyColor); + cursor: default; + transition: opacity .10s var(--appleEase), transform .10s var(--appleEase); + } + + &::-moz-range-thumb { + width: 8px; + height: 8px; + border-radius: 100%; + background: var(--keyColor); + cursor: default; + } + } + } + + .control-buttons { + margin-top: 2vh; + display: inline-flex; + width: 100%; + justify-content: center; + } + + } } /* Cider */ diff --git a/src/renderer/views/components/fullscreen.ejs b/src/renderer/views/components/fullscreen.ejs index 2003cb5b..93122200 100644 --- a/src/renderer/views/components/fullscreen.ejs +++ b/src/renderer/views/components/fullscreen.ejs @@ -2,20 +2,88 @@
-
+
-
-
-
-
Name
-
Name
-
Name
+
+
+
+ +
+ +
+
@@ -25,6 +93,29 @@ \ No newline at end of file diff --git a/src/renderer/views/components/mediaitem-square.ejs b/src/renderer/views/components/mediaitem-square.ejs index d64c6a74..888f7c6b 100644 --- a/src/renderer/views/components/mediaitem-square.ejs +++ b/src/renderer/views/components/mediaitem-square.ejs @@ -27,7 +27,7 @@
-
+
{{ item.attributes.name }}
🅴
diff --git a/src/renderer/views/main.ejs b/src/renderer/views/main.ejs index f2cb1029..41fa1a4b 100644 --- a/src/renderer/views/main.ejs +++ b/src/renderer/views/main.ejs @@ -69,7 +69,9 @@