diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index f6bb5826..aac3173d 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -12,6 +12,7 @@ import fetch from 'electron-fetch' import {wsapi} from "./wsapi"; import {AppImageUpdater, NsisUpdater} from "electron-updater"; import {utils} from './utils'; + const AdmZip = require("adm-zip"); @@ -76,6 +77,108 @@ export class BrowserWindow { "components/lyrics-view", "components/fullscreen", "components/miniplayer", + ], + appRoutes: [ + { + page: "podcasts", + component: ``, + condition: `page == 'podcasts'` + }, { + page: "library-videos", + component: ``, + condition: `page == 'library-videos'` + }, { + page: "apple-account-settings", + component: ``, + condition: `page == 'apple-account-settings'` + }, { + page: "about", + component: ``, + condition: `page == 'about'` + }, { + page: "cider-artist", + component: ``, + condition: `page == 'artist-page' && artistPage.data.attributes` + }, { + page: "collection-list", + component: ``, + condition: `page == 'collection-list'` + }, { + page: "home", + component: ``, + condition: `page == 'home'` + }, { + page: "artist-feed", + component: ``, + condition: `page == 'artist-feed'` + }, { + page: "playlist-inline", + component: ``, + condition: `modals.showPlaylist` + }, { + page: "playlist_", + component: ``, + condition: `page.includes('playlist_')` + }, { + page: "album_", + component: ``, + condition: `page.includes('album_')` + }, { + page: "recordLabel_", + component: ``, + condition: `page.includes('recordLabel_')` + }, { + page: "curator_", + component: ``, + condition: `page.includes('curator_')` + }, { + page: "browsepage", + component: ``, + condition: `page == 'browse'`, + onEnter: `getBrowsePage();` + }, { + page: "listen_now", + component: ``, + condition: `page == 'listen_now'`, + onEnter: `getListenNow()` + }, { + page: "settings", + component: ``, + condition: `page == 'settings'` + }, { + page: "search", + component: ``, + condition: `page == 'search'` + }, { + page: "library-songs", + component: ``, + condition: `page == 'library-songs'`, + onEnter: `getLibrarySongsFull()` + }, { + page: "appleCurator", + component: ``, + condition: `page.includes('appleCurator')` + }, { + page: "themes-github", + component: ``, + condition: `page == 'themes-github'` + }, { + page: "podcasts", + component: ``, + condition: `page == 'podcasts'` + }, { + page: "remote-pair", + component: ``, + condition: `page == 'remote-pair'` + }, { + page: "audiolabs", + component: ``, + condition: `page == 'audiolabs'` + }, { + page: "replay", + component: ``, + condition: `page == 'replay'` + } ] }, }; @@ -125,24 +228,24 @@ export class BrowserWindow { this.options.width = windowState.width; this.options.height = windowState.height; - switch(process.platform) { + switch (process.platform) { default: - break; + break; case "win32": this.options.backgroundColor = "#1E1E1E"; this.options.transparent = false; - break; + break; case "linux": this.options.backgroundColor = "#1E1E1E"; this.options.autoHideMenuBar = true this.options.frame = true - break; + break; case "darwin": this.options.transparent = true; this.options.vibrancy = "dark"; this.options.hasShadow = true; - break; + break; } // Start the webserver for the browser window to load @@ -279,7 +382,7 @@ export class BrowserWindow { res.send(`// File not found - ${userThemePath}`); } }); - + app.get("/plugins/:plugin/*", (req, res) => { const plugin = req.params.plugin; // @ts-ignore @@ -425,7 +528,7 @@ export class BrowserWindow { let zipFile = new AdmZip(zip); zipFile.extractAllTo(utils.getPath("themes"), true); - }catch(e) { + } catch (e) { returnVal.success = false; } BrowserWindow.win.webContents.send("theme-installed", returnVal); @@ -684,8 +787,8 @@ export class BrowserWindow { console.log('sc', SoundCheckTag) BrowserWindow.win.webContents.send('SoundCheckTag', SoundCheckTag) }).catch(err => { - console.log(err) - }); + console.log(err) + }); }); ipcMain.on('check-for-update', async (_event) => { @@ -704,9 +807,9 @@ export class BrowserWindow { provider: 'generic', url: `${base_url}` } - + // Have to handle the auto updaters seperatly until we can support macOS. electron-builder limitation -q - + const win_autoUpdater = new NsisUpdater(options) //Windows const linux_autoUpdater = new AppImageUpdater(options) //Linux await win_autoUpdater.checkForUpdatesAndNotify() diff --git a/src/renderer/style.less b/src/renderer/style.less index 36a4d469..2c7ebdcb 100644 --- a/src/renderer/style.less +++ b/src/renderer/style.less @@ -2739,7 +2739,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb { .wpfade_transform-enter, .wpfade_transform-leave-to { - transform: scale(0.90); + transform: translateX(20px); opacity: 0; } diff --git a/src/renderer/views/app/app-content.ejs b/src/renderer/views/app/app-content.ejs index 10250ca4..8bd2de6b 100644 --- a/src/renderer/views/app/app-content.ejs +++ b/src/renderer/views/app/app-content.ejs @@ -8,103 +8,26 @@ - - - - - - - - + + <% for(var i=0; i < Object.keys(env.appRoutes).length ; i++) {%> + + v-on:enter="<%- env.appRoutes[i].onEnter %>" + <% + } + %> + name="wpfade_transform" + > + + + <% } %> - - - - - - - - - - - - - - <%- include('../pages/zoo') %> - - - <%- include('../pages/webview') %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + <%- include('../pages/library-recentlyadded') %>'); - - - - - + <%- include('../pages/library-albums') %>'); %> - + - + - - - - - - - - - - - - - - - - - - - \ No newline at end of file