gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain4099e64aMerge branch 'font-segoe-ui' into mainAtlasmain/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. elementsPage {
  11. section {
  12. marginBottom = '2.5rem'
  13. form {
  14. display = 'grid'
  15. gap = '1rem'
  16. maxWidth = '32rem'
  17. p { margin = '0' }
  18. }
  19. }
  20. fieldset {
  21. label {
  22. display = 'inline-flex'
  23. alignItems = 'center'
  24. gap = '.4rem'
  25. marginRight = '1rem'
  26. fontWeight = '400'
  27. color = 'var(--color-text)'
  28. }
  29. }
  30. }
  31. 'elements-page p.row' {
  32. display = 'flex'
  33. flexWrap = 'wrap'
  34. alignItems = 'center'
  35. gap = '.5rem'
  36. }
  37. 'elements-page section input:not([type="checkbox"]):not([type="radio"]),
  38. elements-page section select' { width = '100%' }
  39. }
  40. View {
  41. elementsPage {
  42. SiteHeader { current = "/elements" }
  43. ContentFirst {
  44. SiteSidebar { current = "/elements" }
  45. main {
  46. h1 { "Elements" }
  47. 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." }
  48. section {
  49. h2 { "Text" }
  50. 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" } "." }
  51. p { class = "muted" "Muted text says something secondary: updated 3 minutes ago." }
  52. h3 { "A third-level title" }
  53. 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" } }
  54. pre { code { "inherit './theme/theme.hl'" } }
  55. }
  56. section {
  57. h2 { "Buttons" }
  58. p { class = "row"
  59. button { type = "button" class = "primary" "Save" }
  60. button { type = "button" "Cancel" }
  61. button { type = "button" class = "danger" "Delete" }
  62. button { type = "button" disabled = "disabled" "Disabled" }
  63. a { class = "button" href = "/elements" "A link as a button" }
  64. }
  65. p { class = "muted" "Quiet by default; the accent marks the one main action; danger says it destroys something." }
  66. }
  67. section {
  68. h2 { "Fields" }
  69. form { method = "get" action = "/elements"
  70. p { label { 'for' = "el-title" "Title" } input { id = "el-title" type = "text" name = "title" placeholder = "A title" } }
  71. p { label { 'for' = "el-mail" "E-mail (invalid)" } input { id = "el-mail" type = "email" name = "mail" value = "not an address" 'aria-invalid' = "true" } }
  72. p { label { 'for' = "el-kind" "Kind" } select { id = "el-kind" name = "kind" option { "Series" } option { "Movie" } option { "Show" } } }
  73. p { label { 'for' = "el-notes" "Notes" } textarea { id = "el-notes" name = "notes" placeholder = "Write…" } }
  74. fieldset {
  75. legend { "Show" }
  76. label { input { type = "checkbox" name = "watched" checked = "checked" } "Watched" }
  77. label { input { type = "radio" name = "order" value = "new" checked = "checked" } "Newest first" }
  78. label { input { type = "radio" name = "order" value = "old" } "Oldest first" }
  79. }
  80. p { button { type = "submit" "Send" } }
  81. }
  82. }
  83. section {
  84. h2 { "Foldables" }
  85. p { class = "muted" "The border is part of the foldable, like the tracker's seasons." }
  86. details { open = "open"
  87. summary { "Season 2 · 8 episodes" }
  88. ol { li { "The Fall" } li { "Lamia" } li { "Feral" } }
  89. }
  90. details {
  91. summary { "Season 1 · 10 episodes" }
  92. p { "Folded until opened." }
  93. }
  94. }
  95. section {
  96. h2 { "Drop zone" }
  97. dropZone { id = "el-drop" on dragover(e) { emit elDragOver(e) } on dragleave(e) { emit elDragLeave(e) } on drop(e) { emit elDrop(e) }
  98. "Drop a file here"
  99. }
  100. p { class = "muted" output { id = "el-dropped" dropped } }
  101. }
  102. section {
  103. h2 { "Table" }
  104. table {
  105. thead { tr { th { "Title" } th { "Type" } th { "Next" } } }
  106. tbody {
  107. tr { td { "Reacher" } td { span { class = "pill type-2" "Series" } } td { "S03E08" } }
  108. tr { td { "Dune: Part Two" } td { span { class = "pill type-1" "Movie" } } td { class = "muted" "watched" } }
  109. tr { td { "Late Night with the Devil" } td { span { class = "pill type-1" "Movie" } } td { "—" } }
  110. tr { td { "Taskmaster" } td { span { class = "pill type-3" "Show" } } td { "S18E02" } }
  111. }
  112. }
  113. }
  114. section {
  115. h2 { "Type colours and pills" }
  116. 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." }
  117. p { class = "row"
  118. span { class = "pill type-1" "Movie" } span { class = "pill type-2" "Series" } span { class = "pill type-3" "Show" }
  119. span { class = "pill type-4" "Genre" } span { class = "pill type-5" "Person" } span { class = "pill type-6" "Type 6" }
  120. }
  121. p { class = "row"
  122. a { class = "type-1" href = "/elements" "Dune: Part Two" } a { class = "type-2" href = "/elements" "Reacher" } a { class = "type-3" href = "/elements" "Taskmaster" }
  123. a { class = "type-4" href = "/elements" "Science Fiction" } a { class = "type-5" href = "/elements" "Alan Ritchson" }
  124. }
  125. p { class = "row"
  126. span { class = "pill" "Accent" } span { class = "pill success" "Running" } span { class = "pill warning" "Paused" } span { class = "pill danger" "Ended" } span { class = "pill quiet" "Unknown" }
  127. }
  128. }
  129. section {
  130. h2 { "Empty state and an overlong title" }
  131. p { class = "empty" "No notes yet." }
  132. h3 { "Averyveryverylongtitlewithoutanyspacethatmustnotpushthepagesidewaysonaphone and then some more words to wrap" }
  133. }
  134. }
  135. }
  136. }
  137. }
  138. on elDragOver(e) {
  139. e.preventDefault()
  140. e.currentTarget.classList.add('over')
  141. }
  142. on elDragLeave(e) { e.currentTarget.classList.remove('over') }
  143. on elDrop(e) {
  144. e.preventDefault()
  145. e.currentTarget.classList.remove('over')
  146. files = e.dataTransfer.files
  147. dropped = files.length > 0 ? 'Dropped: ' + files[0].name + ' (kept nowhere — a showcase)' : 'Dropped something without a file.'
  148. }

Branches

Latest commits

  • 4099e64aMerge branch 'font-segoe-ui' into mainAtlas
  • e14fb795|||PR Theme font: Segoe UI first (his choice 2026-11-19)Atlas
  • 44071d2cMerge branch 'hl-standard-5' into mainAtlas
  • 5ea64202|||PR Gate: count the new-tab check's console errors tooAtlas
  • 2752ceddMerge branch 'hl-standard-4' into mainAtlas
  • ac552b81|||PR Gate: keyboard (Tab/Enter/Space) and Back/Forward/reload/new-tab checks (HL-STANDARD F5, F21)Atlas
  • 8cddcaa9Merge branch 'hl-standard-2' into mainAtlas
  • 2b480a64|||PR Type the route parameter of main-menu build (HL-STANDARD L10)Atlas
  • ab54a39dMerge branch 'hl-standard' into mainAtlas
  • 04d36fcf|||PR Type function parameters and drop unneeded let (HL-STANDARD L2, L10)Atlas
  • 220c8fa4Merge branch 'readme-audit' into mainAtlas
  • b78fb85a|||PR README matches the codemre
  • 9f351699Preserve comments and nest supported selectors without changing rendered outputmre
  • 97110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre
  • ce4a0baeKeep caller slot styles whole so minimal shell apps startmre
  • 12cd3992Re-vendor complete Hybriel plugins and runtime to day44mre
  • b05c20feBackup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 8d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre
  • ebd00b6cNest caller slot styles in three-panemre
  • 009991efNest caller slot styles in list-firstmre