BetterAudioPlayer: small changes (#938)

This commit is contained in:
creations 2026-03-28 21:31:55 -05:00 • committed by GitHub
parent 43ebdc2064
commit af41040297
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 12 deletions

View file

@ -22,16 +22,15 @@ interface PlayerInstance {
}
function validateColor(value: string, key: string, fallback: string) {
const rgbPattern = /^\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}$/;
if (rgbPattern.test(value)) return;
if (/^\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}$/.test(value)) return;
if (value.startsWith("#")) {
const rgb = ColorUtils.hexToRgb(value);
try {
const rgb = ColorUtils.hexToRgb(value.replace("#", ""));
if (rgb) {
settings.store[key] = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
return;
}
}
} catch { /* invalid hex */ }
showToast(`Invalid color format for ${key}, use "R, G, B" or "#RRGGBB"`, Toasts.Type.FAILURE);
settings.store[key] = fallback;

View file

@ -25,7 +25,11 @@
justify-content: center;
margin-top: 2px;
padding-top: 12px;
border-top: 1px solid var(--profile-body-divider-color, var(--input-border-default, var(--input-border)));
border-top: 1px solid
var(
--profile-body-divider-color,
var(--input-border-default, var(--input-border))
);
}
.vc-github-repos-button,
@ -37,7 +41,11 @@
.vc-github-repos-card {
padding: 8px;
border-radius: var(--radius-xs);
border: 1px solid var(--profile-body-divider-color, var(--input-border-default, var(--input-border)));
border: 1px solid
var(
--profile-body-divider-color,
var(--input-border-default, var(--input-border))
);
}
.vc-github-repos-header {
@ -227,19 +235,19 @@
}
.vc-github-repos-header-repo {
width: 20%
width: 20%;
}
.vc-github-repos-header-description {
width: 50%
width: 50%;
}
.vc-github-repos-header-language {
width: 15%
width: 15%;
}
.vc-github-repos-header-stars {
width: 10%
width: 10%;
}
/* Tab variant styles */
@ -291,4 +299,4 @@
.vc-github-repos-container.vc-github-repos-tab .vc-github-repos-star-icon,
.vc-github-repos-container.vc-github-repos-tab .vc-github-repos-stars {
margin-left: 2px;
}
}