Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CUSTOMIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ Some of the customizer's Display settings belong to an optional map layer and on
- **Live Moments**: the Live page's moment cards, only while the operator has `moments.enabled`. `moments.enabled` (default `true`) is whether the Live page starts with them (a `?moments=` link and your own last choice on the Live page still win until Reset All); `moments.visibleCards` (1 to 5, default 3, desktop only: a phone shows one); `moments.dwellSeconds` (3 to 30, default 8) is how long a card stays; `moments.showNewNode`, `showBackOnline`, `showRecordLink` and `showBusiest` (default `true`) switch a kind off. The operator sets the defaults with `moments.display` in `config.json` (see above). The card fill and the four kind accents are the theme keys `momentCardBg`, `momentNewNode`, `momentBackOnline`, `momentRecordLink` and `momentBusiest` (CSS `--moment-*`), and the accents follow the colourblind preset. The operator's thresholds and rate stay in `config.json`. See [moments.md](moments.md).
- **Live Map** (Follow a packet): how the replay of one followed packet plays in this browser, from the next follow. `follow.speed` is `0.5`, `1` (default) or `2` and divides every hop step; `follow.targetSeconds` (3 to 15 whole seconds, default 6) is the replay length aimed for at 1× (each hop step stays between 0.35 s and 1.5 s, so a very short or very deep path takes less or more); `follow.settleSeconds` (0 to 30 whole seconds, or empty) is how long following a just-heard packet waits for late observations before it loads. Empty is the server's `liveMap.propagationBufferMs` (5 s unless the operator changed it), and a value equal to it is not stored. A deep link, or a packet heard longer ago than the delay, loads at once. The colours are the theme keys `followRing` (rings, origin and card accent), `followRelay`, `followObserver` and `followFlag` (the unreliable-clock flag), CSS `--follow-*`, in light and dark; a colourblind preset sets the relay and observer pair.
- **Live kiosk**: how a TV or wall screen running `#/live?kiosk=1` looks in this browser. `kiosk.scale` is the text and tile size: `auto` (the default: picked by the screen's size, 1 up to 2) or a fixed `1`, `1.25`, `1.5` or `2`. `kiosk.safeInsetVmin` is the margin kept clear at the screen edges for TV overscan, in % of the screen's short side, 0 to 10 (default 3). Set them once in the screen's own browser, outside kiosk, before opening the kiosk link (a kiosk screen hides the customizer). Your browser's value wins over the operator's `kiosk` preset in `config.json` (below), which wins over the defaults; a value equal to the operator's is not stored. A running kiosk takes a change at once. In an exported file this section is per browser: placed on a server as `theme.json` it is ignored there, so put the operator's values in `config.json`.
- **Live scope legend**: the SCOPES list on the Live page with "Color by scope" on (always offered). `liveScope.windowMinutes` (1 to 60, default 15) is how long a scope stays listed, and keeps its colour slot, after its last packet; `liveScope.legendRows` (1 to 12, default 12) is how many of the most recent scopes are listed, the rest showing as "+N more". They apply to this browser only. The colours are the theme keys `scope1` to `scope12` (the 12 slots a scope name is given), `scopeNone` (no scope), `scopeUnknown` (scoped, region not known) and `scopeOther` (beyond 12 active scopes), CSS `--scope-*`, under Theme → **Live scope colours** with a light and a dark value. Every theme preset keeps the default palette; a colourblind preset other than Default brings its own for each mode (achromatopsia keeps no scope, unknown and other apart from every slot by luminance), and your own colour wins over both.
- **Oblique Photos**: how the oblique aerial photo (Skråfoto) viewer opens, only while the server offers the photos. `skraafoto.direction` is the first photo: `auto` (the default: across the line when opened from a Path profile, otherwise north), `north`, `east`, `south`, `west` or `nadir`; a shared link's direction still wins. `skraafoto.zoom` is `zoomed` (the default: each new photo opens on the crop around the point, where the point is in the photo, otherwise on the whole photo) or `overview` (the whole photo first). `skraafoto.lineOfSight` (default `true`) draws the line of sight from a Path profile; this row is shown only with the Path profile tool. These are viewer settings; the server's `map.skraafoto` config is not part of the customizer.
- **Predicted reach**: the default environment loss of the Map's Predicted reach panel (#968), only while the server offers the predicted reach. `reach.environmentLossDb` (0 to 60 dB, empty by default) is the buildings, trees and other clutter the terrain model does not include. Empty means the operator's `map.coverage.environmentLossDb` in `config.json` (default 25 dB). A link's own value (`renv`) still wins, and the panel's Reset returns to your default. It stays in the browser: it is never sent to the server and changes no request. Like the other sections here it is a per-browser value: a `theme.json` on the server ignores it, so operators set theirs in `config.json`.

Expand Down
66 changes: 61 additions & 5 deletions public/cb-presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
var MOMENT_KINDS = ['newNode', 'backOnline', 'recordLink', 'busiest'];
var FOLLOW_KINDS = ['relay', 'observer'];
// newNode -> --mc-moment-new-node
// #882 M2 — Live scope colours: --mc-scope-{light|dark}-{1..12|none|unknown|other}.
var SCOPE_SUFFIXES = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 'none', 'unknown', 'other'];
function _momentVar(k) { return '--mc-moment-' + k.replace(/[A-Z]/g, function (c) { return '-' + c.toLowerCase(); }); }

// ── Palettes ────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -61,6 +63,8 @@
// #880 M3 — Live "Follow a packet" relay / observer dots, each >= 3:1
// on the light and the dark card (test-880-m3-follow-customizer.js).
followAccents: { relay: '#D55E00', observer: '#2E86C1' }
// #882 M2 — no scopePalette: the Live scope colours are the stylesheet's
// (style.css --scope-*, Okabe-Ito based), so this preset changes nothing.
},
{
id: 'deut',
Expand Down Expand Up @@ -92,7 +96,16 @@
momentAccents: { newNode: '#785EF0', backOnline: '#648FFF', recordLink: '#DC267F', busiest: '#FE6100' },
// #880 M3 — Live "Follow a packet" relay / observer dots, each >= 3:1
// on the light and the dark card (test-880-m3-follow-customizer.js).
followAccents: { relay: '#FE6100', observer: '#648FFF' }
followAccents: { relay: '#FE6100', observer: '#648FFF' },
// #882 M2 — Live scope colours, slots 1-12 then none / unknown / other,
// one list per base-map mode: blue / orange / purple / amber axes, lightness-separated (red-green safe).
// Each slot >= 3:1 on the map tile (test-882-m2-scope-customizer.js).
scopePalette: {
light: ['#2F5FD0', '#C25000', '#6A3FC8', '#8F6400', '#B0175E', '#1D3D8F', '#6E4300', '#4B2A8A', '#C2338A', '#00607A', '#7D4F94', '#A33500',
'#a1a1aa', '#57534e', '#111827'],
dark: ['#648FFF', '#FE6100', '#A08CFF', '#FFB000', '#DC267F', '#9DB8FF', '#FFD27A', '#C9B8FF', '#FF8CC6', '#5CC8E6', '#E0A3FF', '#FF9E7A',
'#6b7280', '#c4b5a5', '#f8fafc']
}
},
{
id: 'prot',
Expand Down Expand Up @@ -122,7 +135,16 @@
momentAccents: { newNode: '#785EF0', backOnline: '#648FFF', recordLink: '#DC267F', busiest: '#FE6100' },
// #880 M3 — Live "Follow a packet" relay / observer dots, each >= 3:1
// on the light and the dark card (test-880-m3-follow-customizer.js).
followAccents: { relay: '#FE6100', observer: '#648FFF' }
followAccents: { relay: '#FE6100', observer: '#648FFF' },
// #882 M2 — Live scope colours, slots 1-12 then none / unknown / other,
// one list per base-map mode: the deut palette: the same blue / orange / purple / amber axes.
// Each slot >= 3:1 on the map tile (test-882-m2-scope-customizer.js).
scopePalette: {
light: ['#2F5FD0', '#C25000', '#6A3FC8', '#8F6400', '#B0175E', '#1D3D8F', '#6E4300', '#4B2A8A', '#C2338A', '#00607A', '#7D4F94', '#A33500',
'#a1a1aa', '#57534e', '#111827'],
dark: ['#648FFF', '#FE6100', '#A08CFF', '#FFB000', '#DC267F', '#9DB8FF', '#FFD27A', '#C9B8FF', '#FF8CC6', '#5CC8E6', '#E0A3FF', '#FF9E7A',
'#6b7280', '#c4b5a5', '#f8fafc']
}
},
{
id: 'trit',
Expand Down Expand Up @@ -160,7 +182,16 @@
momentAccents: { newNode: '#2A8F4C', backOnline: '#C04F7F', recordLink: '#B45AA6', busiest: '#CC6677' },
// #880 M3 — Live "Follow a packet" relay / observer dots, each >= 3:1
// on the light and the dark card (test-880-m3-follow-customizer.js).
followAccents: { relay: '#CC6677', observer: '#2A8F4C' }
followAccents: { relay: '#CC6677', observer: '#2A8F4C' },
// #882 M2 — Live scope colours, slots 1-12 then none / unknown / other,
// one list per base-map mode: Tol muted extended: rose / green / wine / teal (blue-yellow safe).
// Each slot >= 3:1 on the map tile (test-882-m2-scope-customizer.js).
scopePalette: {
light: ['#AA3344', '#117733', '#882255', '#7A6A00', '#AA4499', '#44706A', '#5E6B00', '#332288', '#006E8A', '#994455', '#666633', '#B8572A',
'#a1a1aa', '#57534e', '#111827'],
dark: ['#EE8899', '#44BB99', '#CC6699', '#DDCC77', '#DD88CC', '#88CCCC', '#BBCC33', '#9988EE', '#66CCEE', '#EEAA88', '#CCCC88', '#E0B0FF',
'#6b7280', '#c4b5a5', '#f8fafc']
}
},
{
id: 'achromat',
Expand Down Expand Up @@ -211,7 +242,19 @@
momentAccents: { newNode: '#777777', backOnline: '#858585', recordLink: '#6f6f6f', busiest: '#8f8f8f' },
// #880 M3 — Live "Follow a packet" relay / observer dots, each >= 3:1
// on the light and the dark card (test-880-m3-follow-customizer.js).
followAccents: { relay: '#8f8f8f', observer: '#6f6f6f' }
followAccents: { relay: '#8f8f8f', observer: '#6f6f6f' },
// #882 M2 — Live scope colours, slots 1-12 then none / unknown / other,
// one list per base-map mode: a luminance ramp, darkest first on light tiles, lightest first on dark.
// Luminance is the only cue, so the ramp is 14 even steps from black (white) to just above
// 3:1 on the tile: slots 1-12, then unknown and other, each step >= 1.13:1 from the next.
// "No scope" (most traffic) sits below 3:1, as in the stylesheet's light palette, and
// >= 1.79:1 from every slot. Each slot >= 3:1 on the map tile (test-882-m2-scope-customizer.js).
scopePalette: {
light: ['#000000', '#151515', '#222222', '#2c2c2c', '#363636', '#3f3f3f', '#484848', '#505050', '#595959', '#626262', '#6b6b6b', '#757575',
'#a2a2a2', '#7f7f7f', '#898989'],
dark: ['#ffffff', '#f0f0f0', '#e1e1e1', '#d3d3d3', '#c6c6c6', '#b9b9b9', '#adadad', '#a2a2a2', '#979797', '#8d8d8d', '#828282', '#797979',
'#525252', '#6f6f6f', '#666666']
}
}
];

Expand Down Expand Up @@ -326,6 +369,15 @@
if (fa[k]) style.setProperty('--mc-follow-' + k, fa[k]);
else style.removeProperty('--mc-follow-' + k);
});
// #882 M2 — Live scope colours per mode; style.css reads them through
// --scope-* so a customizer colour still wins.
var sp = p.scopePalette;
['light', 'dark'].forEach(function (mode) {
SCOPE_SUFFIXES.forEach(function (sx, i) {
if (sp && sp[mode] && sp[mode][i]) style.setProperty('--mc-scope-' + mode + '-' + sx, sp[mode][i]);
else style.removeProperty('--mc-scope-' + mode + '-' + sx);
});
});
// #1407 — ROLE_COLORS / ROLE_STYLE are now live getters in roles.js
// that read --mc-role-* directly, so no explicit sync is needed. The
// pre-#1407 code path kept them in sync as a workaround for the static
Expand Down Expand Up @@ -378,6 +430,9 @@
});
MOMENT_KINDS.forEach(function (k) { style.removeProperty(_momentVar(k)); });
FOLLOW_KINDS.forEach(function (k) { style.removeProperty('--mc-follow-' + k); });
['light', 'dark'].forEach(function (mode) {
SCOPE_SUFFIXES.forEach(function (sx) { style.removeProperty('--mc-scope-' + mode + '-' + sx); });
});
}
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof window.CustomEvent === 'function') {
try { window.dispatchEvent(new window.CustomEvent('cb-preset-changed', { detail: { id: null } })); } catch (e) {}
Expand Down Expand Up @@ -421,7 +476,8 @@
TILE_LIGHT: TILE_LIGHT,
TILE_DARK: TILE_DARK
},
STORAGE_KEY: STORAGE_KEY
STORAGE_KEY: STORAGE_KEY,
SCOPE_SUFFIXES: SCOPE_SUFFIXES
};
if (typeof window !== 'undefined') window.MeshCorePresets = api;
if (typeof module !== 'undefined') module.exports = api;
Expand Down
Loading
Loading