/* ============================================================
carino-navbar.js — the shared Carino navbar, self-injecting.
------------------------------------------------------------
Drop this file into any Carino Systems project and include it:
data-app is the little tag next to the brand; data-repo is the
GitHub repository the header's GitHub button points at. They
differ on the few sites whose repo name is longer than the tag
(Netplan/NetplanConfig, Setup/SimpleSetup, Software/
SoftwareCatalog, SyncSubs/SyncSubsStudio), so data-repo falls
back to data-app and, failing that, to the profile page.
It injects its own (scoped) styles + the canonical top-header
markup and runs the greeting. The live CLOCK (Local/UTC/Epoch/
TAI/.beats + click-to-cycle) lives in the companion file
carino-clock.js, which this script loads from the SAME site — both
files ship together in every project, so there is no external/CDN
dependency and each site works standalone/offline. To change the
clock, edit carino-clock.js and re-copy it to each site (see
propagate.sh). All styles are scoped under #carinoNav so nothing
leaks into (or clashes with) the app.
The Status diagnostics dropdown lives only on carino.systems
itself — every sub-project's navbar omits it.
Brand links: "Carino" goes to the hub (carino.systems); the
app-tag next to it links to the app's own root — clicking it
acts as a fresh reload of the current site.
Right-cluster order is fixed by CSS `order`, not by DOM
position, because four different scripts insert into it and
none of them can rely on the others having run yet. Read it
from the right edge inwards — the socials anchor the row and
language sits immediately beside them:
1 the app's own controls (.cn-actions)
2 status (carino-diag.js, or an app's own toggle)
3 language (carino-lang.js)
4 legal + GitHub + LinkedIn — always last
The shield in that last group opens carino.systems/legal.html, the one
legal notice, privacy and cookie page for every site. carino-lang.js
translates its tooltip (it finds the link by its id, #cnLegal).
The legal page itself leaves the shield out.
Fitting. The brand must never be squeezed out and the clock must stay
readable, at any width. When the right cluster would do either, items
fold into a generated "⋯" menu, in this order: first the legal/GitHub/
LinkedIn row; then the clock steps aside (as it already does below
900px), because an app's controls matter more than the time; last, the
app's own controls. Controls marked
data-priority="1" stay in the bar (an app's one main action), and
data-priority="2" ones too while there is room (a Live page's source
badge); without any mark, the first .btn-primary / .primary control
stays. If even those squeeze the brand, priority 2 folds, then 1. The real
nodes move (never clones) and return when there is room again, and the
menu sits inside #carinoNav, so `#carinoNav .cn-actions …` rules still
apply. If an app has moved .cn-actions somewhere else itself (Topo's
drawer), it is left alone.
Immersive mode (Games and ambient pages). Opt in on the script tag: