diff --git a/src/main/base/win.ts b/src/main/base/win.ts index e27b4145..b22d1a21 100644 --- a/src/main/base/win.ts +++ b/src/main/base/win.ts @@ -85,6 +85,8 @@ export class Win { this.options.height = windowState.height; // Start the webserver for the browser window to load + const ws = new wsapi() + ws.InitWebSockets() this.startWebServer(); this.win = new electron.BrowserWindow(this.options); @@ -191,8 +193,6 @@ export class Win { * TODO: Broadcast the remote so that /web-remote/ can connect * https://github.com/ciderapp/Apple-Music-Electron/blob/818ed18940ff600d76eb59d22016723a75885cd5/resources/functions/handler.js#L1173 */ - const ws = new wsapi() - ws.InitWebSockets() const remote = express(); remote.use(express.static(path.join(this.paths.srcPath, "./web-remote/"))) remote.listen(this.remotePort, () => { diff --git a/src/main/base/wsapi.ts b/src/main/base/wsapi.ts index fc346e76..ff1d96b9 100644 --- a/src/main/base/wsapi.ts +++ b/src/main/base/wsapi.ts @@ -18,13 +18,6 @@ private class standardResponse { } export class wsapi { - private standa2rdResponse (status, data, message, type: string = "generic") { - this.status = status; - this.message = message; - this.data = data; - this.type = type; - } - port: any = 26369 wss: any = null clients: [] diff --git a/src/renderer/style.less b/src/renderer/style.less index d017e913..6138e483 100644 --- a/src/renderer/style.less +++ b/src/renderer/style.less @@ -254,6 +254,32 @@ input[type="text"], input[type="number"] { } } +.artworkMaterial { + position: relative; + height:100%; + width:100%; + overflow: hidden; + pointer-events: none; + + >img { + position: absolute; + width: 200%; + opacity: 0.5; + filter: brightness(200%) blur(180px) saturate(280%) contrast(2); + } + + >img:first-child { + top:0; + left:0; + } + + >img:last-child { + bottom:0; + right: 0; + transform: rotate(180deg); + } +} + [artwork-hidden] { transition: opacity .25s var(--appleEase); @@ -2345,7 +2371,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb { .playlist-page { --bgColor: transparent; padding: 0px; - background: linear-gradient(180deg, var(--bgColor) 32px, var(--bgColor) 59px, transparent 60px, transparent 100%); + //background: linear-gradient(180deg, var(--bgColor) 32px, var(--bgColor) 18px, transparent 60px, transparent 100%); top: 0; padding-top: var(--navigationBarHeight); @@ -2356,104 +2382,149 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb { .playlist-display { padding: var(--contentInnerPadding); min-height: 300px; + position: relative; - .playlist-info { - flex-shrink: unset; + .artworkContainer { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin: 0; + padding: 0; + -webkit-mask-image: radial-gradient(at top left, black, transparent 70%), radial-gradient(at top right, black, transparent 70%), linear-gradient(180deg, rgb(200 200 200), transparent 98%); + opacity: .7; + + .artworkMaterial>img { + filter: brightness(100%) blur(80px) saturate(100%) contrast(1); + object-position: center; + object-fit: cover; + width: 100%; + height: 100%; + transform: unset; + } + .artworkMaterial>img:last-child { + display: none; + } + } + + .playlistInfo { + z-index: 1; + position: absolute; + bottom: 0; + left: 0; + right: 0; + top: 0; display: flex; - flex-flow: column; - justify-content: flex-end; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; - .playlist-name { - font-weight: 700; - font-size: 1.6rem; - margin-bottom: 6px; - margin-right: 6px; - flex-shrink: unset; + >.row { + width: calc(100% - 32px); } - .nameEdit { - font-weight: 700; - font-size: 1.6rem; - margin-bottom: 6px; - margin-right: 6px; + .playlist-info { flex-shrink: unset; - background: transparent; - border: 0px; - color: inherit; - font-family: inherit; - } + display: flex; + flex-flow: column; + justify-content: flex-end; - .playlist-artist { - font-size: 20px; - margin-bottom: 6px; - margin-right: 6px; - flex-shrink: unset; - } - - .playlist-desc { - box-sizing: border-box; - font-size: 14px; - flex-shrink: unset; - margin-right: 5px; - max-height: 100px; - position: relative; - - .content { - height: 100px; - -webkit-mask-image: -webkit-gradient(linear, left 50%, left 90%, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0))); + .playlist-name { + font-weight: 700; + font-size: 1.6rem; + margin-bottom: 6px; + margin-right: 6px; + flex-shrink: unset; } - .more-btn { - appearance: none; - position: absolute; - right: 0; - bottom: 0; - padding: 0 5px; - font-size: 14px; - color: var(--keyColor); - background-color: transparent; + .nameEdit { + font-weight: 700; + font-size: 1.6rem; + margin-bottom: 6px; + margin-right: 6px; + flex-shrink: unset; + background: transparent; border: 0px; - cursor: pointer; - width: 100%; - height: 100%; - overflow: hidden; - display: flex; - justify-content: flex-end; - align-items: flex-end; - font-weight: 600; + color: inherit; font-family: inherit; - text-transform: uppercase; } - } - .playlist-desc-expanded { - box-sizing: border-box; - font-size: 14px; - position: relative; + .playlist-artist { + font-size: 20px; + margin-bottom: 6px; + margin-right: 6px; + flex-shrink: unset; + } - .more-btn { - appearance: none; - position: absolute; - right: 0; - bottom: 0; - padding: 0 5px; + .playlist-desc { + box-sizing: border-box; font-size: 14px; - color: var(--keyColor); - background-color: transparent; - border: 0px; - cursor: pointer; - width: 100%; - height: 100%; - overflow: hidden; - display: flex; - justify-content: flex-end; - align-items: flex-end; - font-weight: 600; - font-family: inherit; - text-transform: uppercase; + flex-shrink: unset; + margin-right: 5px; + max-height: 100px; + position: relative; + + .content { + height: 100px; + -webkit-mask-image: -webkit-gradient(linear, left 50%, left 90%, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0))); + } + + .more-btn { + appearance: none; + position: absolute; + right: 0; + bottom: 0; + padding: 0 5px; + font-size: 14px; + color: var(--keyColor); + background-color: transparent; + border: 0px; + cursor: pointer; + width: 100%; + height: 100%; + overflow: hidden; + display: flex; + justify-content: flex-end; + align-items: flex-end; + font-weight: 600; + font-family: inherit; + text-transform: uppercase; + } + } + + .playlist-desc-expanded { + box-sizing: border-box; + font-size: 14px; + position: relative; + + .more-btn { + appearance: none; + position: absolute; + right: 0; + bottom: 0; + padding: 0 5px; + font-size: 14px; + color: var(--keyColor); + background-color: transparent; + border: 0px; + cursor: pointer; + width: 100%; + height: 100%; + overflow: hidden; + display: flex; + justify-content: flex-end; + align-items: flex-end; + font-weight: 600; + font-family: inherit; + text-transform: uppercase; + } } } } + + } .friends-info { diff --git a/src/renderer/views/components/artwork-material.ejs b/src/renderer/views/components/artwork-material.ejs new file mode 100644 index 00000000..b8a718c4 --- /dev/null +++ b/src/renderer/views/components/artwork-material.ejs @@ -0,0 +1,33 @@ + + + \ No newline at end of file diff --git a/src/renderer/views/main.ejs b/src/renderer/views/main.ejs index 242b5337..4bd78a7f 100644 --- a/src/renderer/views/main.ejs +++ b/src/renderer/views/main.ejs @@ -659,6 +659,8 @@ + +<%- include('components/artwork-material') %> <%- include('components/menu-panel') %> diff --git a/src/renderer/views/pages/cider-playlist.ejs b/src/renderer/views/pages/cider-playlist.ejs index cfc4dc79..ac432239 100644 --- a/src/renderer/views/pages/cider-playlist.ejs +++ b/src/renderer/views/pages/cider-playlist.ejs @@ -7,84 +7,93 @@