gitoria

notes

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit9414ce599414ce59notes mission 014: merge theme 76f99f6, components 3794c59, strict single-press openAsk (fails on old open())mre9414ce59/theme/shell/main-menu.hl

3.0 KB

  1. // main-menu.hl — THE MAIN MENU: the app's top-level links, `Series | Shows | Movies` (docs/layouts/main-menu.md).
  2. // Write it twice from ONE list: in the header (shown from 60rem) and in the sidebar (shown on the phone, where the
  3. // header has no room). The link whose href is `current` (or a page below it) is marked: class `current` and
  4. // aria-current="page". Without a matching path the host says which one: `current = "/docs"` (the page /read/x is
  5. // under Docs) or `current = true` on the item itself. An item may carry a small count: `count = 3` (a badge, not text).
  6. //
  7. // static menu = [ { label = 'Series' href = '/series' } { label = 'Movies' href = '/movies' } ]
  8. // AppHeader { MainMenu { items = menu current = "/series" } }
  9. // Sidebar { desktop = "false" MainMenu { items = menu current = "/series" } }
  10. Hybrid items = []
  11. String current = ''
  12. String label = 'Main menu'
  13. Hybrid rows = build(items, current)
  14. // one row per link: the current one (the page itself or a page below it) is marked
  15. build(list, at) {
  16. out = []
  17. for (it of list) {
  18. let here = it.current == true || at == it.href || (it.href != '/' && at.startsWith(it.href + '/'))
  19. let n = it.count == null ? '' : '' + it.count
  20. out.push({ label = it.label href = it.href count = n has = n != '' cls = here ? 'current' : '' aria = here ? 'page' : 'false' })
  21. }
  22. return out
  23. }
  24. Style {
  25. 'main-menu' { display = 'block' }
  26. 'main-menu a' { display = 'flex' alignItems = 'center' minHeight = 'var(--layout-tap)' padding = '.55rem .75rem' fontWeight = '600' color = 'var(--color-text)' borderRadius = 'var(--radius-small)' }
  27. 'main-menu a:hover' { textDecoration = 'none' color = 'var(--color-text-strong)' background = 'var(--color-surface)' }
  28. // the marked link: accent text AND a bar in the accent (not colour alone), on the surface
  29. 'main-menu a.current' { color = 'var(--color-accent)' background = 'var(--color-surface)' boxShadow = 'inset .2rem 0 0 var(--color-accent)' }
  30. 'main-menu a span.count' { marginLeft = '.5rem' padding = '0 .45rem' minWidth = '1.4rem' textAlign = 'center' fontSize = '.8rem' fontWeight = '700' lineHeight = '1.4rem' color = 'var(--color-accent-text)' background = 'var(--color-accent)' borderRadius = 'var(--radius-small)' }
  31. // in the header: only from 60rem, the links in a row
  32. 'application-header main-menu' { display = 'none' }
  33. // in the sidebar: only on the phone, the links stacked
  34. 'app-sidebar main-menu' { marginBottom = '1rem' }
  35. '@media (min-width: 60rem)' {
  36. 'application-header main-menu' { display = 'block' marginLeft = 'auto' }
  37. 'application-header main-menu nav' { display = 'flex' gap = '.15rem' }
  38. 'application-header main-menu a' { minHeight = '2.25rem' padding = '.45rem .7rem' }
  39. 'application-header main-menu a.current' { boxShadow = 'inset 0 -.2rem 0 var(--color-accent)' }
  40. 'app-sidebar main-menu' { display = 'none' }
  41. }
  42. }
  43. View {
  44. mainMenu {
  45. nav { 'aria-label' = label
  46. for (r of rows) { a { href = r.href class = r.cls 'aria-current' = r.aria r.label if (r.has) { span { class = 'count' r.count } } } }
  47. }
  48. }
  49. }

Branches

Latest commits

  • 9414ce59notes mission 014: merge theme 76f99f6, components 3794c59, strict single-press openAsk (fails on old open())mre
  • c08c655anotes 013: theme re-copied from layouts 76f99f6 (menu marks the current page), current = true on the menu item, e2e marker checks, reportmre
  • 21c8f65dnotes mission 012: STATUSmre
  • 0bbb3dd9notes mission 012: delete section of the browser gate de-flaked (openAsk: calm wait, press again when the question closes by itself); report 012mre
  • f431bdf8notes mission 011: notes on the layouts theme (ListFirst shell), styles cut, check-theme gate, E2E extended; reportmre
  • 1a8603d1notes mission 011 WIP: deploy.sh gate summary also matches check-theme, browser.mjs logout via the user menumre
  • dae2e508notes mission 011 WIP: theme dbe3de7, shell on AppHeader/MainMenu/UserMenu/Sidebar + ListFirst, styles cut to the app's own, check-theme gate, e2e auditmre
  • fd36da27notes mission 010: the note editor is the Hybriel MdEditor block (components.hybriel 1442e58, verbatim); md-editor.js, its route, script tag and offlineFiles retired; gate 66/0, realdata-offline 12/0, round-trip and Chrome E2E tests; report 010mre
  • efa92170notes tests/identkit.mjs: refuse a taken ident port, cold-wait deadline, emit, identities; mission 009 reportmre
  • f3dec0f1Merge branch 'w7'mre
  • d1cf966dre-vendor hybriel 97bcf128: offlineFiles for the editor script, 44 px taps, 390 px offline checks, mission 008mre
  • 4a610a21paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • eeaea980report 007: say which runs included the removed checkmre
  • 8a8ad9banotes mission 007: report, LOG, STATUSmre
  • 2cce9c96code order: plain declarations where never reassigned (letcount 0 never); gate: scan every IndexedDB at log-out, soft mode for old-code runs, drop a check that could not failmre
  • 7f6a4090README: offline in Hybriel (hl:web offline, continuation, known md-editor gap); gate waits report instead of crash; realdata-offline checkmre
  • 632223f2notes#4: delete notes-offline.js and sw.js (hl:web's generated worker and kept state replace them)mre
  • 52a2acadgate: offline checks on hl:web's worker/queue, Chrome offline via CDP (reload offline first), one-offline conflict, log-out forgets the kept copymre
  • e5785b03notes#4: the notes page in Hybriel — hl:web offline = [Notes], queued faces notesPut/notesDrop, push notesChanged, value-form notesPull on a tick; notes-offline.js/sw.js no longer loaded or routedmre
  • 510aff75notes#4: server continues a run of saves of one login (by + since), loser keeps writing into its copy; notesFor listmre