mirror of
https://github.com/db9979/uconsole_asw_game.git
synced 2026-12-05 20:34:16 +01:00
- Radio station without the chart: HF/DF bearing scope (strobe fan per intercept, logged bearings dashed, own course), HF receiver channels with digital frequency, ground/sky-wave badge, S-meter and log button, and a message teletype. No contact dock; the contact detail opens under the station panel when a channel is selected. - Radio projection publishes the measured HF carrier (frequency_khz) and propagation mode, as the uConsole tooltip already shows; browser validator, projection test and schema test updated. - /admin (setup, login, room, crew, options) and /manual-en|de restyled on the shared tokens and fonts; the PDF build keeps its own print stylesheet. - Fix: the CIC grid now always fills the viewport height (the operations grid row no longer collapses to content when the tab list is hidden). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.0 KiB
JavaScript
25 lines
1.0 KiB
JavaScript
import { $ } from "../core/base.js";
|
|
import { t } from "../core/format.js";
|
|
import { palette } from "../core/palette.js";
|
|
import { releaseCanvas, resizeCanvas } from "./chart.js";
|
|
|
|
export function visualContext(id) {
|
|
const element = $(id);
|
|
if (element.closest("[hidden]")) { releaseCanvas(element); return null; }
|
|
const width = element.clientWidth;
|
|
const height = element.clientHeight;
|
|
if (!width || !height) return null;
|
|
const context = element.getContext("2d");
|
|
resizeCanvas(element, context, width, height);
|
|
context.fillStyle = palette().scopeBg;
|
|
context.fillRect(0, 0, width, height);
|
|
context.font = `${Math.max(11, parseFloat(getComputedStyle(document.documentElement).fontSize) * .68)}px "JetBrains Mono", ui-monospace, monospace`;
|
|
context.lineWidth = 1.5;
|
|
return {element, context, width, height};
|
|
}
|
|
export function drawEmpty(plot, key = "visual_empty") {
|
|
plot.context.fillStyle = palette().muted;
|
|
plot.context.textAlign = "center";
|
|
plot.context.fillText(t(key), plot.width / 2, plot.height / 2);
|
|
}
|