diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index 244a2e25..6f3d6994 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -1,18 +1,18 @@ -import {join} from "path"; -import {app, BrowserWindow as bw, ipcMain, ShareMenu, shell} from "electron"; +import { join } from "path"; +import { app, BrowserWindow as bw, ipcMain, ShareMenu, shell } from "electron"; import * as windowStateKeeper from "electron-window-state"; import * as express from "express"; import * as getPort from "get-port"; -import {search} from "youtube-search-without-api-key"; -import {existsSync, rmSync, mkdirSync, readdirSync, readFileSync, writeFileSync, statSync} from "fs"; -import {Stream} from "stream"; -import {networkInterfaces} from "os"; +import { search } from "youtube-search-without-api-key"; +import { existsSync, rmSync, mkdirSync, readdirSync, readFileSync, writeFileSync, statSync } from "fs"; +import { Stream } from "stream"; +import { networkInterfaces } from "os"; import * as mm from 'music-metadata'; import fetch from 'electron-fetch' -import {wsapi} from "./wsapi"; -import {utils} from './utils'; -import {Plugins} from "./plugins"; -import {watch} from "chokidar"; +import { wsapi } from "./wsapi"; +import { utils } from './utils'; +import { Plugins } from "./plugins"; +import { watch } from "chokidar"; import * as os from "os"; import wallpaper from "wallpaper"; import * as AdmZip from "adm-zip"; @@ -46,6 +46,7 @@ export class BrowserWindow { "pages/library-artists", "pages/browse", "pages/settings", + "pages/installed-themes", "pages/listen_now", "pages/home", "pages/artist-feed", @@ -178,6 +179,10 @@ export class BrowserWindow { page: "settings", component: ``, condition: `page == 'settings'` + }, { + page: "installed-themes", + component: ``, + condition: `page == 'installed-themes'` }, { page: "search", component: ``, @@ -241,7 +246,7 @@ export class BrowserWindow { show: false, // backgroundColor: "#1E1E1E", titleBarStyle: 'hidden', - trafficLightPosition: {x: 15, y: 20}, + trafficLightPosition: { x: 15, y: 20 }, webPreferences: { experimentalFeatures: true, nodeIntegration: true, @@ -301,7 +306,7 @@ export class BrowserWindow { * @yields {object} Electron browser window */ async createWindow(): Promise { - this.clientPort = await getPort({port: 9000}); + this.clientPort = await getPort({ port: 9000 }); BrowserWindow.verifyFiles(); this.StartWatcher(utils.getPath('themes')); @@ -561,7 +566,7 @@ export class BrowserWindow { remote.use(express.static(join(utils.getPath('srcPath'), "./web-remote/"))) remote.set("views", join(utils.getPath('srcPath'), "./web-remote/views")); remote.set("view engine", "ejs"); - getPort({port: 6942}).then((port: number) => { + getPort({ port: 6942 }).then((port: number) => { this.remotePort = port; // Start Remote Discovery this.broadcastRemote() @@ -634,7 +639,7 @@ export class BrowserWindow { 'KHTML, like Gecko) Mobile/17D50 UCBrowser/12.8.2.1268 Mobile AliApp(TUnionSDK/0.1.20.3) ' details.requestHeaders['Referer'] = "https://y.qq.com/portal/player.html" } - callback({requestHeaders: details.requestHeaders}); + callback({ requestHeaders: details.requestHeaders }); } ); @@ -702,7 +707,7 @@ export class BrowserWindow { // remove WidevineCDM from appdata folder const widevineCdmPath = join(app.getPath("userData"), "./WidevineCdm"); if (existsSync(widevineCdmPath)) { - rmSync(widevineCdmPath, {recursive: true, force: true}) + rmSync(widevineCdmPath, { recursive: true, force: true }) } // reinstall WidevineCDM app.relaunch() @@ -978,7 +983,7 @@ export class BrowserWindow { //Fullscreen ipcMain.on('detachDT', (_event, _) => { - BrowserWindow.win.webContents.openDevTools({mode: 'detach'}); + BrowserWindow.win.webContents.openDevTools({ mode: 'detach' }); }) ipcMain.handle('relaunchApp', (_event, _) => { @@ -1176,8 +1181,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) => { @@ -1215,7 +1220,7 @@ export class BrowserWindow { shell.openPath(app.getPath('userData')); }); - + //#region Cider Connect ipcMain.on('cc-auth', (_event) => { shell.openExternal(String(utils.getStoreValue('cc_authURL'))); @@ -1310,10 +1315,10 @@ export class BrowserWindow { // Set window Handler BrowserWindow.win.webContents.setWindowOpenHandler((x: any) => { if (x.url.includes("apple") || x.url.includes("localhost")) { - return {action: "allow"}; + return { action: "allow" }; } shell.openExternal(x.url).catch(console.error); - return {action: "deny"}; + return { action: "deny" }; }); } @@ -1369,7 +1374,7 @@ export class BrowserWindow { "CtlN": "Cider", "iV": "196623" }; - let server2 = mdns.createAdvertisement(x, `${await getPort({port: 3839})}`, { + let server2 = mdns.createAdvertisement(x, `${await getPort({ port: 3839 })}`, { name: encoded, txt: txt_record }); diff --git a/src/renderer/less/pages.less b/src/renderer/less/pages.less index e4854c3d..6325faa1 100644 --- a/src/renderer/less/pages.less +++ b/src/renderer/less/pages.less @@ -488,74 +488,79 @@ /* Album / Playlist Page */ .playlist-page { - --bgColor : transparent; - padding : 0px; + --bgColor : transparent; + padding : 0px; //background: linear-gradient(180deg, var(--bgColor) 32px, var(--bgColor) 18px, transparent 60px, transparent 100%); - top : 0; - padding-top : var(--navigationBarHeight); - display:flex; + top : 0; + padding-top : var(--navigationBarHeight); + display : flex; flex-direction: column; - height: 100%; - overflow: hidden; - .cd-mediaitem-list-item{ - &:hover{ - .heart-icon{ - display:flex; + height : 100%; + overflow : hidden; + + .cd-mediaitem-list-item { + &:hover { + .heart-icon { + display: flex; } } - .heart-icon{ + + .heart-icon { left: -25px; } } - + .editTracksBtn { position: absolute; - top: 20px; - right: 20px; - z-index: 1; + top : 20px; + right : 20px; + z-index : 1; >span { display: flex; - gap: 8px; + gap : 8px; } } .mediaContainer { transition: width 0.5s ease-in-out, height 0.5s ease-in-out; - width: 260px;height:260px; + width : 260px; + height : 260px; } .playlist-body { - padding : 32px; + padding : 32px; // margin-top: -75px; - overflow-y:overlay; - height:100%; - padding:0px; + overflow-y : overlay; + height : 100%; + padding : 0px; background-color: var(--color1); &.scrollbody { .tabs { - display: flex; + display : flex; flex-flow: column; - height: 100%; + height : 100%; .nav-link { - text-transform:capitalize; + text-transform: capitalize; } .tab-content { - height: 100%; + height : 100%; overflow: hidden; - margin:0px; + margin : 0px; + .tab-pane { - height: 100%; - overflow-y: overlay; - overflow-x:hidden; - padding: var(--contentInnerPadding); - padding-inline: 40px; + height : 100%; + overflow-y : overlay; + overflow-x : hidden; + padding : var(--contentInnerPadding); + padding-inline : 40px; -webkit-mask-image: linear-gradient(180deg, transparent, white 20px); + .well { - margin:0px; + margin: 0px; } } } @@ -574,7 +579,7 @@ background : rgba(0, 0, 0, 0.25); top : var(--navigationBarHeight); transition : opacity 0.1s var(--appleEase); - display: none; + display : none; } .playlist-display { @@ -660,14 +665,14 @@ } .playlist-desc { - transition: height .2s ease-in-out, opacity .2s ease-in-out; + transition : height .2s ease-in-out, opacity .2s ease-in-out; box-sizing : border-box; font-size : 14px; flex-shrink : unset; margin-right: 5px; max-height : 100px; position : relative; - height : 4vh; + height : 4vh; .content { height : 4vh; @@ -761,11 +766,11 @@ } .playlist-time { - font-size: 0.9em; - margin : 6px; - opacity : 0.7; + font-size : 0.9em; + margin : 6px; + opacity : 0.7; transition: height .2s ease-in-out, opacity .2s ease-in-out; - height: 0.9em; + height : 0.9em; } &.inline-playlist { @@ -813,8 +818,8 @@ .pilldim { .nav-pills { - width: max-content; - margin: 0 auto; + width : max-content; + margin : 0 auto; margin-top: 16px; } } @@ -824,26 +829,24 @@ transition: min-height 0.5s ease-in-out; min-height: 200px; - .playlistInfo { - - } + .playlistInfo {} .mediaContainer { transition: width 0.5s ease-in-out, height 0.5s ease-in-out; - width: 128px!important; - height: 128px!important; + width : 128px !important; + height : 128px !important; } .playlist-time { transition: height .2s ease-in-out, opacity .2s ease-in-out; - height: 0px; - opacity: 0; + height : 0px; + opacity : 0; } .playlist-desc { transition: height .2s ease-in-out, opacity .2s ease-in-out; - height: 0px!important; - opacity: 0; + height : 0px !important; + opacity : 0; } } } @@ -931,7 +934,7 @@ pointer-events : none; .header-content { - z-index : 1; + z-index : 1; // margin-top: -16px; } @@ -1123,9 +1126,46 @@ /* Artist Page End */ -// Settings page -.settings-page { - padding: 0px; + +.installed-themes-page { + + .themeContextMenu { + background: transparent; + color : var(--keyColor); + border : 0px; + } + + .repo-header { + font-size : 16px; + position : sticky; + top : 0; + left : 0; + right : 0; + width : 100%; + height : 50px; + z-index : 1; + background : rgba(36, 36, 36, 0.5); + display : flex; + justify-content: center; + align-items : center; + backdrop-filter: var(--glassFilter); + overflow : hidden; + border-bottom : 1px solid rgb(0 0 0 / 18%); + border-top : 1px solid rgb(135 135 135 / 18%); + } + + .style-editor-container { + height : 100%; + flex : 1; + background: var(--color2); + padding : 0px; + overflow-y: overlay; + + .list-group-item { + border-radius: 0px; + } + } + .stylestack-editor { width: 100%; @@ -1136,17 +1176,17 @@ } .themeLabel { - display:flex; + display : flex; align-items: center; } .removeItem { - border: 0px; - background: transparent; - height: 32px; + border : 0px; + background : transparent; + height : 32px; font-weight: bold; - color: var(--textColor); - cursor: pointer; + color : var(--textColor); + cursor : pointer; } .stylesDropdown { @@ -1156,7 +1196,11 @@ } } } +} +// Settings page +.settings-page { + padding: 0px; .nav { width : 90%; @@ -1174,8 +1218,9 @@ .settings-option-body-webview { height: 100%; - width: 100%; + width : 100%; } + .settings-option-body { margin: 16px; } diff --git a/src/renderer/views/pages/installed-themes.ejs b/src/renderer/views/pages/installed-themes.ejs new file mode 100644 index 00000000..20ef4a5d --- /dev/null +++ b/src/renderer/views/pages/installed-themes.ejs @@ -0,0 +1,291 @@ + + + + + \ No newline at end of file diff --git a/src/renderer/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs index fbb41d51..69c76380 100644 --- a/src/renderer/views/pages/settings.ejs +++ b/src/renderer/views/pages/settings.ejs @@ -1224,8 +1224,8 @@ Mix and match various theme components to get Cider looking exactly how you want. -
- +
+
@@ -1436,112 +1436,6 @@ - -