1{{/*2 topbar — what is on offer: the volume, the world, the lens, and the two3 buttons that change what the library holds.45 Volume and world are in the address, so changing either is a navigation6 rather than a session write: both selects ask /open, which answers with the7 page at the URL they name and pushes that URL. The lens is not in the8 address -- it is an arrangement of one world, not a different ground -- so it9 is an ordinary session post answering with the regions it touches.10*/}}11{{define "topbar"}}12<div class="brand" aria-label="Atlas — World explorer" title="World explorer">13 <svg viewBox="0 0 10 10" aria-hidden="true"><path d="M5 0 10 5 5 10 0 5z"/></svg>14 <strong>ATLAS</strong>15</div>16<div class="map-pickers">17 <label>18 <span>Volume</span>19 {{/*20 The empty hx-vals is this control saying it inherits nothing, and it is21 load-bearing. Values declared on an element replace the parameters its22 own name and value contributed, so the volume the shell declares --23 the volume the reader is leaving -- would otherwise overwrite the one24 they just chose, and every switch would navigate back to where it25 started. This is the one control on the page whose own value shares a26 name with the inherited one.27 */}}28 {{/*29 A crumb with one option is a fact, not a choice: it stays in the trail30 but stops offering itself -- no chevron, no focus, no menu of one.31 */}}32 <select id="volume-select" name="volume" aria-label="Volume" hx-vals='{}'33 {{if le (len .Library) 1}}disabled {{end}}hx-get="/open" hx-trigger="change"34 hx-target="#atlas-shell" hx-select="#atlas-shell"35 hx-swap="outerMorph" hx-push-url="true">36 {{range .Library}}<option value="{{.Slug}}"{{if .Current}} selected{{end}}>{{.Title}}</option>37 {{end}}38 </select>39 </label>40 {{with .Volume}}41 <label>42 <span>World</span>43 <select id="world-select" name="world" aria-label="World"44 {{if le (len .Worlds) 1}}disabled {{end}}hx-get="/open" hx-trigger="change"45 hx-vals='{"volume":"{{.Slug}}"}'46 hx-target="#atlas-shell" hx-select="#atlas-shell"47 hx-swap="outerMorph" hx-push-url="true">48 {{range .Worlds}}<option value="{{.Slug}}"{{if .Current}} selected{{end}}>{{.Title}}</option>49 {{end}}50 </select>51 </label>52 <label id="lens-field"{{if lt (len .Lenses) 2}} hidden{{end}}>53 <span>Lens</span>54 <select id="lens-select" name="lens" aria-label="World lens"55 hx-post="/session/lens" hx-trigger="change">56 {{range .Lenses}}<option value="{{.Name}}"{{if .Current}} selected{{end}}>{{.Name}}</option>57 {{end}}58 </select>59 </label>60 <button type="button" class="globe-toggle" id="globe-toggle"{{if not .Sphere}} hidden{{end}}61 aria-pressed="false" aria-label="View as globe" title="View as globe">62 <svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18"/></svg>63 </button>64 {{end}}65 <button type="button" class="icon-button add-bundles" id="add-bundles"66 aria-label="Add volumes" title="Add .atlas volumes"67 hx-post="/bundles/import" hx-swap="none">68 <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>69 </button>70</div>71<button type="button" class="icon-button mobile-legend" id="mobile-legend"72 aria-label="Toggle legend" aria-expanded="{{if .Session.Sidebar.Collapsed}}false{{else}}true{{end}}"73 hx-post="/session/sidebar" hx-vals:append='{"open":"{{if .Session.Sidebar.Collapsed}}1{{else}}0{{end}}"}'>74 <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16"/></svg>75</button>76{{end}}