Commit ec021e3f authored by Jan Köster's avatar Jan Köster
Browse files

test

parent 261e2e58
Loading
Loading
Loading
Loading
+20 −4
Changes for editor/html/css/editor.css: 20 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -1267,11 +1267,27 @@ dialog label {
    height: 4px;
}

.color-alpha-label {
.color-alpha-number {
    width: 46px;
    padding: 3px 4px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
    font-family: monospace;
    text-align: center;
    flex-shrink: 0;
}

.color-alpha-number:focus {
    outline: none;
    border-color: var(--accent);
}

.color-alpha-number::-webkit-inner-spin-button,
.color-alpha-number::-webkit-outer-spin-button {
    opacity: 1;
}

.color-preview-swatch {
+16 −6
Changes for editor/html/js/properties.js: 16 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -262,13 +262,24 @@ var PropertiesPanel = (function() {
        var alphaInput = document.createElement('input');
        alphaInput.type = 'range';
        alphaInput.className = 'color-alpha-input';
        alphaInput.min = '0'; alphaInput.max = '100';
        alphaInput.min = '0'; alphaInput.max = '100'; alphaInput.step = '1';
        alphaInput.value = String(parsed.alpha);
        var alphaLabel = document.createElement('span');
        alphaLabel.className = 'color-alpha-label';
        alphaLabel.textContent = parsed.alpha + '%';
        var alphaNumber = document.createElement('input');
        alphaNumber.type = 'number';
        alphaNumber.className = 'color-alpha-number';
        alphaNumber.min = '0'; alphaNumber.max = '100'; alphaNumber.step = '1';
        alphaNumber.value = String(parsed.alpha);
        alphaNumber.title = 'Alpha 0–100%';
        alphaWrap.appendChild(alphaInput);
        alphaWrap.appendChild(alphaLabel);
        alphaWrap.appendChild(alphaNumber);

        alphaInput.addEventListener('input', function() {
            alphaNumber.value = alphaInput.value;
        });
        alphaNumber.addEventListener('input', function() {
            var v = Math.max(0, Math.min(100, parseInt(alphaNumber.value, 10) || 0));
            alphaInput.value = String(v);
        });

        var swatch = document.createElement('div');
        swatch.className = 'color-preview-swatch';
@@ -297,7 +308,6 @@ var PropertiesPanel = (function() {
            }
            hiddenInput.value = newVal;
            previewVal.textContent = newVal;
            alphaLabel.textContent = alphaInput.value + '%';
            try { swatchInner.style.background = newVal; } catch(e) {}
            hiddenInput.dispatchEvent(new Event('change', { bubbles: true }));
        }