mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-17 07:59:24 -03:00
feat(settings): redesign Card Overlay Blur range slider to match settings UI style
This commit is contained in:
@@ -823,54 +823,107 @@
|
||||
}
|
||||
|
||||
.range-control input[type="range"] {
|
||||
--range-fill: 40%;
|
||||
width: 120px;
|
||||
height: 4px;
|
||||
height: 6px;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
background: var(--border-color);
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
var(--lora-accent) 0%,
|
||||
var(--lora-accent) var(--range-fill),
|
||||
var(--border-color) var(--range-fill),
|
||||
var(--border-color) 100%
|
||||
);
|
||||
border-radius: var(--radius-full);
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.range-control input[type="range"]:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.range-control input[type="range"]::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 50%;
|
||||
background: var(--lora-accent);
|
||||
cursor: pointer;
|
||||
border: 2px solid var(--lora-surface);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||
transition: transform 0.15s ease;
|
||||
box-shadow: var(--shadow-md);
|
||||
transition: transform var(--transition-bounce), box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.range-control input[type="range"]::-webkit-slider-thumb:hover {
|
||||
transform: scale(1.15);
|
||||
transform: scale(1.2);
|
||||
box-shadow: var(--shadow-md), 0 0 0 4px var(--color-accent-subtle);
|
||||
}
|
||||
|
||||
.range-control input[type="range"]::-webkit-slider-thumb:active {
|
||||
transform: scale(1.1);
|
||||
box-shadow: var(--shadow-md), 0 0 0 6px var(--color-accent-subtle);
|
||||
}
|
||||
|
||||
.range-control input[type="range"]:focus-visible::-webkit-slider-thumb {
|
||||
box-shadow: var(--shadow-md), 0 0 0 3px var(--color-accent-subtle);
|
||||
}
|
||||
|
||||
.range-control input[type="range"]::-moz-range-thumb {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 50%;
|
||||
background: var(--lora-accent);
|
||||
cursor: pointer;
|
||||
border: 2px solid var(--lora-surface);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: var(--shadow-md);
|
||||
transition: transform var(--transition-bounce), box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.range-control input[type="range"]::-moz-range-thumb:hover {
|
||||
transform: scale(1.2);
|
||||
box-shadow: var(--shadow-md), 0 0 0 4px var(--color-accent-subtle);
|
||||
}
|
||||
|
||||
.range-control input[type="range"]::-moz-range-thumb:active {
|
||||
transform: scale(1.1);
|
||||
box-shadow: var(--shadow-md), 0 0 0 6px var(--color-accent-subtle);
|
||||
}
|
||||
|
||||
.range-control input[type="range"]::-moz-range-track {
|
||||
height: 6px;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--border-color);
|
||||
}
|
||||
|
||||
.range-control .range-value {
|
||||
min-width: 36px;
|
||||
text-align: center;
|
||||
font-size: 0.9em;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
font-size: 0.85em;
|
||||
font-weight: 700;
|
||||
color: var(--lora-accent);
|
||||
font-variant-numeric: tabular-nums;
|
||||
background: var(--surface-subtle);
|
||||
padding: 2px 8px;
|
||||
border-radius: var(--border-radius-xs);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .range-control input[type="range"] {
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
var(--lora-accent) 0%,
|
||||
var(--lora-accent) var(--range-fill),
|
||||
rgba(255, 255, 255, 0.15) var(--range-fill),
|
||||
rgba(255, 255, 255, 0.15) 100%
|
||||
);
|
||||
}
|
||||
|
||||
[data-theme="dark"] .range-control input[type="range"]::-moz-range-track {
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
|
||||
@@ -805,12 +805,14 @@ export class SettingsManager {
|
||||
|
||||
// Set card blur amount slider
|
||||
const cardBlurAmountInput = document.getElementById('cardBlurAmount');
|
||||
const cardBlurValue = state.global.settings.card_blur_amount ?? 8;
|
||||
if (cardBlurAmountInput) {
|
||||
cardBlurAmountInput.value = state.global.settings.card_blur_amount ?? 8;
|
||||
cardBlurAmountInput.value = cardBlurValue;
|
||||
cardBlurAmountInput.style.setProperty('--range-fill', (cardBlurValue / 20 * 100) + '%');
|
||||
}
|
||||
const cardBlurAmountValue = document.getElementById('cardBlurAmountValue');
|
||||
if (cardBlurAmountValue) {
|
||||
cardBlurAmountValue.textContent = `${state.global.settings.card_blur_amount ?? 8}px`;
|
||||
cardBlurAmountValue.textContent = `${cardBlurValue}px`;
|
||||
}
|
||||
|
||||
const usePortableCheckbox = document.getElementById('usePortableSettings');
|
||||
@@ -2070,6 +2072,9 @@ export class SettingsManager {
|
||||
displayEl.textContent = `${value}px`;
|
||||
}
|
||||
|
||||
const max = parseInt(element.max, 10) || 20;
|
||||
element.style.setProperty('--range-fill', (value / max * 100) + '%');
|
||||
|
||||
showToast('toast.settings.settingsUpdated', { setting: settingKey.replace(/_/g, ' ') }, 'success');
|
||||
} catch (error) {
|
||||
showToast('toast.settings.settingSaveFailed', { message: error.message }, 'error');
|
||||
|
||||
@@ -549,7 +549,7 @@
|
||||
</div>
|
||||
<div class="setting-control range-control">
|
||||
<input type="range" id="cardBlurAmount" min="0" max="20" value="8" step="1"
|
||||
oninput="document.getElementById('cardBlurAmountValue').textContent = this.value + 'px'"
|
||||
oninput="var pct = (this.value / 20) * 100; this.style.setProperty('--range-fill', pct + '%'); document.getElementById('cardBlurAmountValue').textContent = this.value + 'px'"
|
||||
onchange="settingsManager.saveRangeSetting('cardBlurAmount', 'cardBlurAmountValue', 'card_blur_amount')">
|
||||
<span id="cardBlurAmountValue" class="range-value">8px</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user