[feat](trx-frontend-http): refine responsive main and map layout
Adjust responsive behavior and interaction details in the HTTP frontend.\n\n- switch signal measurement from sample-based to time-based averaging\n- move Transmit/Power below Mode+Tune on small viewports\n- add practical mobile breakpoints and width handling\n- resize and tune logo/top spacing/layout placement\n- make map height viewport-aware with adjustable minimum\n- improve FT8/WSPR control wrapping on small screens\n\nCo-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -839,9 +839,10 @@ const mapMarkers = new Set();
|
||||
const mapFilter = { aprs: true, ft8: true };
|
||||
|
||||
function initAprsMap() {
|
||||
if (aprsMap) return;
|
||||
const mapEl = document.getElementById("aprs-map");
|
||||
if (!mapEl) return;
|
||||
sizeAprsMapToViewport();
|
||||
if (aprsMap) return;
|
||||
|
||||
const hasLocation = serverLat != null && serverLon != null;
|
||||
const center = hasLocation ? [serverLat, serverLon] : [20, 0];
|
||||
@@ -876,6 +877,16 @@ function initAprsMap() {
|
||||
}
|
||||
}
|
||||
|
||||
function sizeAprsMapToViewport() {
|
||||
const mapEl = document.getElementById("aprs-map");
|
||||
if (!mapEl) return;
|
||||
const topPadding = parseFloat(getComputedStyle(document.body).paddingTop) || 0;
|
||||
const available = Math.max(0, window.innerHeight - topPadding);
|
||||
const target = Math.max(150, Math.floor(available * 0.6));
|
||||
mapEl.style.height = `${target}px`;
|
||||
if (aprsMap) aprsMap.invalidateSize();
|
||||
}
|
||||
|
||||
function aprsSymbolIcon(symbolTable, symbolCode) {
|
||||
if (!symbolTable || !symbolCode) return null;
|
||||
const sheet = symbolTable === "/" ? 0 : 1;
|
||||
@@ -985,11 +996,18 @@ document.querySelectorAll(".sub-tab-bar").forEach((bar) => {
|
||||
parent.querySelector(`#subtab-${btn.dataset.subtab}`).style.display = "";
|
||||
if (btn.dataset.subtab === "map") {
|
||||
initAprsMap();
|
||||
sizeAprsMapToViewport();
|
||||
if (aprsMap) setTimeout(() => aprsMap.invalidateSize(), 50);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener("resize", () => {
|
||||
const mapTab = document.getElementById("subtab-map");
|
||||
if (!mapTab || mapTab.style.display === "none") return;
|
||||
sizeAprsMapToViewport();
|
||||
});
|
||||
|
||||
// --- Signal measurement ---
|
||||
const sigMeasureBtn = document.getElementById("sig-measure-btn");
|
||||
const sigClearBtn = document.getElementById("sig-clear-btn");
|
||||
|
||||
Reference in New Issue
Block a user