gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0b85f57e0b85f57elayouts: a standby container (port 45019, profile standby); deploy hands over through standby-swap.sh without a gapmre0b85f57e/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

  • 0b85f57elayouts: a standby container (port 45019, profile standby); deploy hands over through standby-swap.sh without a gapmre
  • 31e40b8bMerge dm3-media: range handling in the layouts media routemre
  • 856dcacbLayouts media route: read suffix ranges and ignore range lists and garbage, like the components route (the layouts copy still answered 416 for the last bytes)mre
  • ad5056eaMerge dm3-sync: components re-sync to c2834ddmre
  • 740e2abeRe-sync the components copy to c2834dd: media player fixes (state after a queue pick, cover-less audio, accessibility labels)mre
  • 7fe103bbMerge mp-player: the media player showcase pagemre
  • 7db43c4eMedia route: serve the showcase's media from committed files (storage/ is not in git)mre
  • f77b7d12Media player: re-sync components from 1c41293 (replay / forward 10 icons, play button surface on audio and video)mre
  • 40a9e69cMP: report, LOG linemre
  • 5b5dbf0fMedia player: the component from components.hybriel dd003e5 (sync-components), the showcase page /components/media-player with a queue, its media files served with ranges (lib/media.hl), theme rules (the seek bar, the queue's current item, the radii), the page in the overview listsmre
  • 9197159fTake components e54f83a: table lines and one-row desktop toolbar in the theme, Table button gates, a table in the md-editor demomre
  • e6322a44UX: report and LOG linemre
  • 58c2da6fUX: nav marker without bars; chat composer is one box (files-upload pick mode, showcase); comments state footer + closer reactions row; modal footer rule only for its own footer; gates for all of itmre
  • 956f107async components.hybriel 4922f9c: 44 px targets in month-view, date-picker, range-picker, pagination, modal, comments; names follow <html lang> (English default), UTC weekday fix; gate: 390 px target checks, 'edited' hit-area padding; comments showcase 'You are' is a labelled group (SY)mre
  • 49940371sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • 6f7bd392gate: the phone toolbar is two even rows (E2)mre
  • 3049c082sync components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre
  • b9a3f85fLOG: MLmre
  • 7979397creport ML-mobilemre
  • 85d2ed25gate: wordingmre