Updated Comfy Theme

This commit is contained in:
フズキ 2021-03-18 10:03:18 +01:00
parent 63fd97d557
commit d912fbb7b7
No known key found for this signature in database
GPG Key ID: AD7750AB4625F1DD
3 changed files with 90 additions and 30 deletions

View File

@ -22,8 +22,7 @@ export function textInputField(text, subtext, placeholder, onApply, initialValue
inputEl.classList.add('inputDefault-_djjkz', 'input-cIJ7To');
inputEl.placeholder = placeholder;
inputEl.type = 'text';
inputEl.value = initialValue ? initialValue : '';
inputWrapEl.appendChild(inputEl);
// Button field
@ -47,6 +46,16 @@ export function textInputField(text, subtext, placeholder, onApply, initialValue
dividerEl.classList.add('divider-3573oO', 'dividerDefault-3rvLe-');
dividerEl.style.marginTop = subtext ? '20px' : '45px';
// Insertion checker
// A bit hacky...
// But works :)
let insertCheckId = setInterval(() => {
if (el.parentNode != null) {
inputEl.value = initialValue != undefined ? initialValue() : '';
clearInterval(insertCheckId);
}
}, 1000);
el.appendChild(textEl);
el.appendChild(buttonEl);
el.appendChild(inputWrapEl);

View File

@ -7,5 +7,5 @@
"authors": ["265924886461939712", "186496078273708033"],
"version": "1.1.0"
"version": "1.2.0"
}

View File

@ -112,11 +112,6 @@ export default {
type: "header",
text: "USRBG settings",
},
{
type: "text",
text: "USRBG modal x offset",
subtext: `Default: ${defaultSettings.usrbgXoff}`,
},
{
type: "custom",
element: textInputField(
@ -127,23 +122,47 @@ export default {
settings.usrbgXoff = value;
updateVars();
},
settings ? settings.usrbgXoff : ""
() => settings.usrbgXoff,
),
},
{
type: "text",
text: "USRBG modal y offset",
subtext: `Default: ${defaultSettings.usrbgYoff}`,
type: "custom",
element: textInputField(
"USRBG modal y offset",
`Default: ${defaultSettings.usrbgYoff}`,
defaultSettings.usrbgYoff,
value => {
settings.usrbgYoff = value;
updateVars();
},
() => settings.usrbgYoff,
),
},
{
type: "text",
text: "USRBG modal width",
subtext: `Default: ${defaultSettings.usrbgWidth}`,
type: "custom",
element: textInputField(
"USRBG modal width",
`Default: ${defaultSettings.usrbgWidth}`,
defaultSettings.usrbgWidth,
value => {
settings.usrbgWidth = value;
updateVars();
},
() => settings.usrbgWidth,
),
},
{
type: "text",
text: "USRBG modal height",
subtext: `Default: ${defaultSettings.usrbgHeight}`,
type: "custom",
element: textInputField(
"USRBG modal height",
`Default: ${defaultSettings.usrbgHeight}`,
defaultSettings.usrbgHeight,
value => {
settings.usrbgHeight = value;
updateVars();
},
() => settings.usrbgHeight,
),
},
{
@ -151,19 +170,43 @@ export default {
text: "User info settings (avatar, popout and modal)",
},
{
type: "text",
text: "Modal avatar roundness",
subtext: `Default: ${defaultSettings.modalAvatarRoundness}`,
type: "custom",
element: textInputField(
"Avatar roundness",
`Default: ${defaultSettings.modalAvatarRoundness}`,
defaultSettings.modalAvatarRoundness,
value => {
settings.modalAvatarRoundness = value;
updateVars();
},
() => settings.modalAvatarRoundness,
),
},
{
type: "text",
text: "Modal avatar width",
subtext: `Default: ${defaultSettings.modalAvatarWidth}`,
type: "custom",
element: textInputField(
"Modal avatar width",
`Default: ${defaultSettings.modalAvatarWidth}`,
defaultSettings.modalAvatarWidth,
value => {
settings.modalAvatarWidth = value;
updateVars();
},
() => settings.modalAvatarWidth,
),
},
{
type: "text",
text: "Popout role circles' size (0px to remove them)",
subtext: `Default: ${defaultSettings.popoutRoleCircles}`,
type: "custom",
element: textInputField(
"Popout role circles' size (0px to remove them)",
`Default: ${defaultSettings.popoutRoleCircles}`,
defaultSettings.popoutRoleCircles,
value => {
settings.popoutRoleCircles = value;
updateVars();
},
() => settings.popoutRoleCircles,
),
},
{
@ -171,9 +214,17 @@ export default {
text: "Server list settings",
},
{
type: "text",
text: "Server icon roundness",
subtext: `Default: ${defaultSettings.serverIconRoundness}`,
type: "custom",
element: textInputField(
"Server icon roundness",
`Default: ${defaultSettings.serverIconRoundness}`,
defaultSettings.serverIconRoundness,
value => {
settings.serverIconRoundness = value;
updateVars();
},
() => settings.serverIconRoundness,
),
},
{