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.classList.add('inputDefault-_djjkz', 'input-cIJ7To');
inputEl.placeholder = placeholder; inputEl.placeholder = placeholder;
inputEl.type = 'text'; inputEl.type = 'text';
inputEl.value = initialValue ? initialValue : '';
inputWrapEl.appendChild(inputEl); inputWrapEl.appendChild(inputEl);
// Button field // Button field
@ -47,6 +46,16 @@ export function textInputField(text, subtext, placeholder, onApply, initialValue
dividerEl.classList.add('divider-3573oO', 'dividerDefault-3rvLe-'); dividerEl.classList.add('divider-3573oO', 'dividerDefault-3rvLe-');
dividerEl.style.marginTop = subtext ? '20px' : '45px'; 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(textEl);
el.appendChild(buttonEl); el.appendChild(buttonEl);
el.appendChild(inputWrapEl); el.appendChild(inputWrapEl);

View File

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

View File

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