gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitdb258c11db258c11sync-components: copy icons/icons.hl + README (F4); testsmredb258c11/components/elements.hl

6.3 KB

  1. // components/elements.hl — `/elements`: every plain element the theme styles, with mock content: text, links, buttons,
  2. // fields, foldables, a drop zone, a table, pills and type colours, empty states and an overlong title.
  3. parent './main.hl'
  4. import SiteHeader from './site-header.hl'
  5. import SiteSidebar from './site-sidebar.hl'
  6. import ContentFirst from '../theme/shell/content-first.hl'
  7. __title = 'Elements · WorldAPI layouts'
  8. String dropped = 'Nothing dropped yet.'
  9. Style {
  10. 'elements-page section' { marginBottom = '2.5rem' }
  11. 'elements-page p.row' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.5rem' }
  12. 'elements-page section form' { display = 'grid' gap = '1rem' maxWidth = '32rem' }
  13. 'elements-page section form p' { margin = '0' }
  14. 'elements-page section input:not([type="checkbox"]):not([type="radio"]),
  15. elements-page section select' { width = '100%' }
  16. 'elements-page fieldset label' { display = 'inline-flex' alignItems = 'center' gap = '.4rem' marginRight = '1rem' fontWeight = '400' color = 'var(--color-text)' }
  17. }
  18. View {
  19. elementsPage {
  20. SiteHeader { current = "/elements" }
  21. ContentFirst {
  22. SiteSidebar { current = "/elements" }
  23. main {
  24. h1 { "Elements" }
  25. p { class = "muted" "Plain HTML, themed. No frames: a border appears only where it means something — the foldable and the drop zone below, and the focus ring." }
  26. section {
  27. h2 { "Text" }
  28. p { "Body text is light on dark. " strong { "Strong text and titles are white." } " Links take the accent: " a { href = "/elements" "a link to this page" } ". Inline " code { "code" } ", a key " kbd { "Ctrl" } " and " small { "small print" } "." }
  29. p { class = "muted" "Muted text says something secondary: updated 3 minutes ago." }
  30. h3 { "A third-level title" }
  31. ul { li { "First point" } li { "Second point, with a longer text that wraps onto the next line on a phone to show the indent of the list" } li { "Third point" } }
  32. pre { code { "inherit './theme/theme.hl'" } }
  33. }
  34. section {
  35. h2 { "Buttons" }
  36. p { class = "row"
  37. button { type = "button" class = "primary" "Save" }
  38. button { type = "button" "Cancel" }
  39. button { type = "button" class = "danger" "Delete" }
  40. button { type = "button" disabled = "disabled" "Disabled" }
  41. a { class = "button" href = "/elements" "A link as a button" }
  42. }
  43. p { class = "muted" "Quiet by default; the accent marks the one main action; danger says it destroys something." }
  44. }
  45. section {
  46. h2 { "Fields" }
  47. form { method = "get" action = "/elements"
  48. p { label { 'for' = "el-title" "Title" } input { id = "el-title" type = "text" name = "title" placeholder = "A title" } }
  49. p { label { 'for' = "el-mail" "E-mail (invalid)" } input { id = "el-mail" type = "email" name = "mail" value = "not an address" 'aria-invalid' = "true" } }
  50. p { label { 'for' = "el-kind" "Kind" } select { id = "el-kind" name = "kind" option { "Series" } option { "Movie" } option { "Show" } } }
  51. p { label { 'for' = "el-notes" "Notes" } textarea { id = "el-notes" name = "notes" placeholder = "Write…" } }
  52. fieldset {
  53. legend { "Show" }
  54. label { input { type = "checkbox" name = "watched" checked = "checked" } "Watched" }
  55. label { input { type = "radio" name = "order" value = "new" checked = "checked" } "Newest first" }
  56. label { input { type = "radio" name = "order" value = "old" } "Oldest first" }
  57. }
  58. p { button { type = "submit" "Send" } }
  59. }
  60. }
  61. section {
  62. h2 { "Foldables" }
  63. p { class = "muted" "The border is part of the foldable, like the tracker's seasons." }
  64. details { open = "open"
  65. summary { "Season 2 · 8 episodes" }
  66. ol { li { "The Fall" } li { "Lamia" } li { "Feral" } }
  67. }
  68. details {
  69. summary { "Season 1 · 10 episodes" }
  70. p { "Folded until opened." }
  71. }
  72. }
  73. section {
  74. h2 { "Drop zone" }
  75. dropZone { id = "el-drop" on dragover(e) { emit elDragOver(e) } on dragleave(e) { emit elDragLeave(e) } on drop(e) { emit elDrop(e) }
  76. "Drop a file here"
  77. }
  78. p { class = "muted" output { id = "el-dropped" dropped } }
  79. }
  80. section {
  81. h2 { "Table" }
  82. table {
  83. thead { tr { th { "Title" } th { "Type" } th { "Next" } } }
  84. tbody {
  85. tr { td { "Reacher" } td { span { class = "pill type-2" "Series" } } td { "S03E08" } }
  86. tr { td { "Dune: Part Two" } td { span { class = "pill type-1" "Movie" } } td { class = "muted" "watched" } }
  87. tr { td { "Late Night with the Devil" } td { span { class = "pill type-1" "Movie" } } td { "—" } }
  88. tr { td { "Taskmaster" } td { span { class = "pill type-3" "Show" } } td { "S18E02" } }
  89. }
  90. }
  91. }
  92. section {
  93. h2 { "Type colours and pills" }
  94. p { class = "muted" "Six slots an app names (the tracker: 1 Movie, 2 Series, 3 Show, 4 Genre, 5 Person). A pill is inverted: text on the colour." }
  95. p { class = "row"
  96. span { class = "pill type-1" "Movie" } span { class = "pill type-2" "Series" } span { class = "pill type-3" "Show" }
  97. span { class = "pill type-4" "Genre" } span { class = "pill type-5" "Person" } span { class = "pill type-6" "Type 6" }
  98. }
  99. p { class = "row"
  100. a { class = "type-1" href = "/elements" "Dune: Part Two" } a { class = "type-2" href = "/elements" "Reacher" } a { class = "type-3" href = "/elements" "Taskmaster" }
  101. a { class = "type-4" href = "/elements" "Science Fiction" } a { class = "type-5" href = "/elements" "Alan Ritchson" }
  102. }
  103. p { class = "row"
  104. span { class = "pill" "Accent" } span { class = "pill success" "Running" } span { class = "pill warning" "Paused" } span { class = "pill danger" "Ended" } span { class = "pill quiet" "Unknown" }
  105. }
  106. }
  107. section {
  108. h2 { "Empty state and an overlong title" }
  109. p { class = "empty" "No notes yet." }
  110. h3 { "Averyveryverylongtitlewithoutanyspacethatmustnotpushthepagesidewaysonaphone and then some more words to wrap" }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. on elDragOver(e) {
  117. e.preventDefault()
  118. e.currentTarget.classList.add('over')
  119. }
  120. on elDragLeave(e) { e.currentTarget.classList.remove('over') }
  121. on elDrop(e) {
  122. e.preventDefault()
  123. e.currentTarget.classList.remove('over')
  124. files = e.dataTransfer.files
  125. dropped = files.length > 0 ? 'Dropped: ' + files[0].name + ' (kept nowhere — a showcase)' : 'Dropped something without a file.'
  126. }

Branches

Latest commits

  • db258c11sync-components: copy icons/icons.hl + README (F4); testsmre
  • badc1879md-editor.hl: verbatim copy of components f3-mdvalue (an older text handed back is kept)mre
  • 867a8375md-editor.hl: verbatim copy of components f3-mdvalue (an outside value change is shown by the editor)mre
  • 5d8d2c67tests: wait for hydration before real clicks after a navigation (H2)mre
  • 99db79f0re-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
  • 30353f60tests: e2e-md-showcase Chrome range from LAYOUTS_GATE_CHROME_MD, default unchangedmre
  • 16a7878cre-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
  • 6af559e8docker-compose: nofile 65536 (Hybriel int 6+ boot opened >1024 files in the tracker)mre
  • 5599cf56deploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
  • 0bcc6294Mission 011: e2e-197, brief, report, LOGmre
  • 137303c5MainMenu marks the current page from the route (hybriel#197, server-rendered); current prop/item.current stay as fallback; tracker demo drops current; gate: SSR marker; docsmre
  • 9325b403Re-vendor Hybriel to master 7f13a82f (hl:web batch 2: #190 #193 #197 #194 named regions); plugins whole, bin/hybriel static build (git-ignored)mre
  • b31dc74dusage: calendar (theme 76f99f6-era ContentFirst, user menu, ☰ menu) and tracker (theme 76f99f6, modal + pagination current, own current marker until hybriel#197) rowsmre
  • 8a3d5d40Mission 010: brief, report, LOG, STATUSmre
  • a56abf1fSync components to components.hybriel 3794c59 (MdEditor real-key fixes); showcase real-key check on the md-editor pagemre
  • 76f99f64E2E in lisbeth's Chrome for the menu's current page (mission 009): tests/e2e-menu-current.mjs, reportmre
  • 159b1d53MainMenu/Sidebar: current page marked beyond colour, count badge, item current flag; gate 300/0 (mission 009)mre
  • 0573eed3usage: notes + tickets on MdEditor (md-editor.js retired), gitoria on theme dbe3de7, tracker theme oldermre
  • 78478f6eSync showcase to components.hybriel 1442e58: pick-mode page, comments attach, md-editor rows/files off; gates 285/0mre
  • dbe3de79Display bugs from a real Chrome walk (mission 007): Settings page and in-shell doc reader instead of raw .md links, closed phone search hidden whatever a page says, /elements form rules scoped, three-pane danger contrast; display audit gate (132 -> 244 checks), walk + Settings e2e toolsmre