mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 04:11:47 +00:00
stylecheck
This commit is contained in:
41
menu.js
41
menu.js
@ -148,7 +148,7 @@ const mainMenuTemplate = (win) => [
|
|||||||
type: "checkbox",
|
type: "checkbox",
|
||||||
checked: !!config.get("options.proxy"),
|
checked: !!config.get("options.proxy"),
|
||||||
click: (item) => {
|
click: (item) => {
|
||||||
setProxy(item);
|
setProxy(item, win);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -311,36 +311,31 @@ module.exports.setApplicationMenu = (win) => {
|
|||||||
|
|
||||||
const iconPath = path.join(__dirname, "assets", "youtube-music-tray.png");
|
const iconPath = path.join(__dirname, "assets", "youtube-music-tray.png");
|
||||||
const example = `Example: "socks5://127.0.0.1:9999"`;
|
const example = `Example: "socks5://127.0.0.1:9999"`;
|
||||||
function setProxy(item) {
|
function setProxy(item, win) {
|
||||||
let options = {
|
let options = {
|
||||||
title: 'Set Proxy',
|
title: 'Set Proxy',
|
||||||
label: 'Enter Proxy Address (leave empty to disable)',
|
label: 'Enter Proxy Address: (leave empty to disable)',
|
||||||
value: config.get("options.proxy") || example,
|
value: config.get("options.proxy") || example,
|
||||||
inputAttrs: {
|
inputAttrs: {
|
||||||
type: 'text'
|
type: 'text'
|
||||||
},
|
},
|
||||||
type: 'input',
|
type: 'input',
|
||||||
alwaysOnTop: true,
|
|
||||||
icon: iconPath,
|
icon: iconPath,
|
||||||
customStylesheet: path.join(__dirname, "prompt","darkPrompt.css"),
|
customStylesheet: path.join(__dirname, "prompt", "darkPrompt.css"),
|
||||||
|
frame: false,
|
||||||
|
customScript: path.join(__dirname, "prompt", "customTitlebar.js"),
|
||||||
|
enableRemoteModule: true,
|
||||||
|
height: 200,
|
||||||
|
width: 450,
|
||||||
};
|
};
|
||||||
if (config.plugins.isEnabled("in-app-menu")) {
|
prompt(options, win)
|
||||||
Object.assign(options, {
|
.then((input) => {
|
||||||
frame: false,
|
if (input !== null && input !== example) {
|
||||||
customScript: path.join(__dirname, "prompt","customTitlebar.js"),
|
config.set("options.proxy", input);
|
||||||
enableRemoteModule: true,
|
item.checked = (input === "") ? false : true;
|
||||||
height: 200,
|
} else { //user pressed cancel
|
||||||
width: 450,
|
item.checked = !item.checked; //reset checkbox
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
.catch(console.error);
|
||||||
prompt(options)
|
|
||||||
.then((input) => {
|
|
||||||
if(input !== null && input !== example) {
|
|
||||||
config.set("options.proxy", input);
|
|
||||||
item.checked = (input === "") ? false : true;
|
|
||||||
} else { //user pressed cancel
|
|
||||||
item.checked = !item.checked; //reset checkbox
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(console.error);
|
|
||||||
}
|
}
|
||||||
@ -2,11 +2,11 @@ const customTitlebar = require("custom-electron-titlebar");
|
|||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
const bar = new customTitlebar.Titlebar({
|
const bar = new customTitlebar.Titlebar({
|
||||||
backgroundColor: customTitlebar.Color.fromHex("#050505"),
|
backgroundColor: customTitlebar.Color.fromHex("#050505"),
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
unfocusEffect: true,
|
unfocusEffect: true,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
bar.updateMenu(null);
|
bar.updateMenu(null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@ -1,47 +1,45 @@
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
background-image: linear-gradient(315deg, #200000 0%, #13253a 74%);
|
background-image: linear-gradient(315deg, #200000 0%, #13253a 74%);
|
||||||
color:whitesmoke;
|
color: whitesmoke;
|
||||||
}
|
}
|
||||||
|
|
||||||
#label {
|
#label {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#container {
|
#container {
|
||||||
background: rgba( 0, 0, 0, 0.7 );
|
background: rgba(0, 0, 0, 0.7);
|
||||||
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
|
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
|
||||||
backdrop-filter: blur( 10.0px );
|
backdrop-filter: blur(10px);
|
||||||
-webkit-backdrop-filter: blur( 10.0px );
|
-webkit-backdrop-filter: blur(10px);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
border: 1px solid rgba(80, 0, 0, 0.4);
|
border: 1px solid rgba(80, 0, 0, 0.4);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#data {
|
#data {
|
||||||
background: unset;
|
background: unset;
|
||||||
color: whitesmoke;
|
color: whitesmoke;
|
||||||
border: 1px solid rgb(54, 54, 54);
|
border: 1px solid rgb(54, 54, 54);
|
||||||
}
|
}
|
||||||
|
|
||||||
#data:hover {
|
#data:hover {
|
||||||
border: 1px solid rgb(85, 85, 85);
|
border: 1px solid rgb(85, 85, 85);
|
||||||
}
|
}
|
||||||
|
|
||||||
#data:focus {
|
#data:focus {
|
||||||
outline: unset;
|
outline: unset;
|
||||||
border: 1px solid rgb(85, 85, 85);
|
border: 1px solid rgb(85, 85, 85);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ok:hover, #cancel:hover {
|
#ok:hover,
|
||||||
outline: rgba(60, 0, 0, 0.4) solid 2px;
|
#cancel:hover {
|
||||||
/*
|
outline: rgba(60, 0, 0, 0.4) solid 2px;
|
||||||
border: 1px solid rgba(60, 0, 0, 0.4);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ok, #cancel {
|
#ok,
|
||||||
background-color: rgb(0, 0, 0);
|
#cancel {
|
||||||
color: whitesmoke;
|
background-color: rgb(0, 0, 0);
|
||||||
|
color: whitesmoke;
|
||||||
}
|
}
|
||||||
@ -1,78 +1,80 @@
|
|||||||
body {
|
body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||||
line-height: 1.5em;
|
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial,
|
||||||
color: #333;
|
sans-serif;
|
||||||
background-color: #fff;
|
line-height: 1.5em;
|
||||||
overflow-y: hidden;
|
color: #333;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow-y: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 0 !important;
|
width: 0 !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#container {
|
#container {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#form {
|
#form {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: .5em;
|
padding-top: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#label {
|
#label {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
margin-bottom: .8em;
|
margin-bottom: 0.8em;
|
||||||
padding: 0 .5em;
|
padding: 0 0.5em;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
#data {
|
#data {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
padding: .4em .5em;
|
padding: 0.4em 0.5em;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
min-height: 2em;
|
min-height: 2em;
|
||||||
margin: 0 0 1.2em;
|
margin: 0 0 1.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
select#data {
|
select#data {
|
||||||
height: 2em;
|
height: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#data-container {
|
#data-container {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#buttons {
|
#buttons {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding: 0 .5em 0 0;
|
padding: 0 0.5em 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#buttons > button,
|
#buttons > button,
|
||||||
#buttons > input[type=submit] {
|
#buttons > input[type="submit"] {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
border: 0;
|
border: 0;
|
||||||
margin: 0 0 0 .5em;
|
margin: 0 0 0 0.5em;
|
||||||
font-size: .8em;
|
font-size: 0.8em;
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
padding: .6em 1em
|
padding: 0.6em 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ok {
|
#ok {
|
||||||
background-color: #3879D9;
|
background-color: #3879d9;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cancel {
|
#cancel {
|
||||||
background-color: #DDD;
|
background-color: #ddd;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user