[fix](trx-frontend-http): move spectrum shift arrows onto scale
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -8935,8 +8935,17 @@ function updateSpectrumFreqAxis(range) {
|
||||
|
||||
const firstHz = Math.ceil(range.visLoHz / stepHz) * stepHz;
|
||||
spectrumFreqAxis.innerHTML = "";
|
||||
const leftShiftBtn = document.getElementById("spectrum-center-left-btn");
|
||||
const rightShiftBtn = document.getElementById("spectrum-center-right-btn");
|
||||
if (leftShiftBtn) spectrumFreqAxis.appendChild(leftShiftBtn);
|
||||
if (rightShiftBtn) spectrumFreqAxis.appendChild(rightShiftBtn);
|
||||
const axisWidth = spectrumFreqAxis.clientWidth || 0;
|
||||
const edgePad = 6;
|
||||
const buttonReserve = Math.max(
|
||||
leftShiftBtn?.offsetWidth || 0,
|
||||
rightShiftBtn?.offsetWidth || 0,
|
||||
0,
|
||||
);
|
||||
const edgePad = Math.max(6, buttonReserve + 10);
|
||||
for (let hz = firstHz; hz <= range.visHiHz + stepHz * 0.01; hz += stepHz) {
|
||||
const frac = (hz - range.visLoHz) / range.visSpanHz;
|
||||
if (frac < 0 || frac > 1) continue;
|
||||
|
||||
@@ -112,13 +112,14 @@
|
||||
<div class="spectrum-wrap">
|
||||
<div id="spectrum-bookmark-axis"></div>
|
||||
<div id="spectrum-bookmark-side-left" class="spectrum-bookmark-side spectrum-bookmark-side-left" aria-hidden="true"></div>
|
||||
<button id="spectrum-center-left-btn" class="spectrum-edge-shift spectrum-edge-shift-left" type="button" aria-label="Shift spectrum center left">‹</button>
|
||||
<canvas id="spectrum-canvas"></canvas>
|
||||
<div id="spectrum-db-axis" aria-hidden="true"></div>
|
||||
<button id="spectrum-center-right-btn" class="spectrum-edge-shift spectrum-edge-shift-right" type="button" aria-label="Shift spectrum center right">›</button>
|
||||
<div id="spectrum-bookmark-side-right" class="spectrum-bookmark-side spectrum-bookmark-side-right" aria-hidden="true"></div>
|
||||
<div id="spectrum-tooltip"></div>
|
||||
<div id="spectrum-freq-axis"></div>
|
||||
<div id="spectrum-freq-axis">
|
||||
<button id="spectrum-center-left-btn" class="spectrum-edge-shift spectrum-edge-shift-left" type="button" aria-label="Shift spectrum center left">‹</button>
|
||||
<button id="spectrum-center-right-btn" class="spectrum-edge-shift spectrum-edge-shift-right" type="button" aria-label="Shift spectrum center right">›</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="spectrum-size-grip" title="Drag to resize spectrum height" aria-label="Resize spectrum height"></div>
|
||||
<div id="spectrum-controls">
|
||||
|
||||
@@ -2553,9 +2553,8 @@ button:focus-visible, input:focus-visible, select:focus-visible {
|
||||
padding-top: 0.45rem;
|
||||
}
|
||||
.spectrum-edge-shift {
|
||||
top: 0.34rem;
|
||||
width: 1.3rem;
|
||||
height: 1.3rem;
|
||||
width: 1.15rem;
|
||||
height: 1.15rem;
|
||||
}
|
||||
/* Bookmark side panels need too much horizontal space on narrow screens */
|
||||
.spectrum-bookmark-side { display: none !important; }
|
||||
@@ -2564,10 +2563,10 @@ button:focus-visible, input:focus-visible, select:focus-visible {
|
||||
padding: 2px 6px;
|
||||
}
|
||||
.spectrum-edge-shift-left {
|
||||
left: 0.34rem;
|
||||
left: 0.2rem;
|
||||
}
|
||||
.spectrum-edge-shift-right {
|
||||
right: 0.34rem;
|
||||
right: 0.2rem;
|
||||
}
|
||||
#spectrum-bw-row,
|
||||
#spectrum-level-row {
|
||||
@@ -2815,14 +2814,15 @@ button:focus-visible, input:focus-visible, select:focus-visible {
|
||||
}
|
||||
.spectrum-edge-shift {
|
||||
position: absolute;
|
||||
top: 0.42rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 8;
|
||||
width: 1.45rem;
|
||||
height: 1.45rem;
|
||||
width: 1.2rem;
|
||||
height: 1.2rem;
|
||||
border: 1px solid color-mix(in srgb, var(--border-light) 85%, transparent);
|
||||
background: color-mix(in srgb, var(--card-bg) 82%, transparent);
|
||||
color: var(--accent-yellow);
|
||||
border-radius: 0.78rem;
|
||||
border-radius: 999px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -2853,13 +2853,13 @@ button:focus-visible, input:focus-visible, select:focus-visible {
|
||||
border-color: var(--accent-yellow);
|
||||
}
|
||||
.spectrum-edge-shift:active {
|
||||
transform: none;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.spectrum-edge-shift-left {
|
||||
left: 0.42rem;
|
||||
left: 0.24rem;
|
||||
}
|
||||
.spectrum-edge-shift-right {
|
||||
right: 0.42rem;
|
||||
right: 0.24rem;
|
||||
}
|
||||
#spectrum-freq-axis {
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user