layouts
All repositories: gitoria
6.3 KB
// components/elements.hl — `/elements`: every plain element the theme styles, with mock content: text, links, buttons,// fields, foldables, a drop zone, a table, pills and type colours, empty states and an overlong title.parent './main.hl'import SiteHeader from './site-header.hl'import SiteSidebar from './site-sidebar.hl'import ContentFirst from '../theme/shell/content-first.hl'__title = 'Elements · WorldAPI layouts'String dropped = 'Nothing dropped yet.'Style {'elements-page section' { marginBottom = '2.5rem' }'elements-page p.row' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.5rem' }'elements-page section form' { display = 'grid' gap = '1rem' maxWidth = '32rem' }'elements-page section form p' { margin = '0' }'elements-page section input:not([type="checkbox"]):not([type="radio"]),elements-page section select' { width = '100%' }'elements-page fieldset label' { display = 'inline-flex' alignItems = 'center' gap = '.4rem' marginRight = '1rem' fontWeight = '400' color = 'var(--color-text)' }}View {elementsPage {SiteHeader { current = "/elements" }ContentFirst {SiteSidebar { current = "/elements" }main {h1 { "Elements" }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." }section {h2 { "Text" }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" } "." }p { class = "muted" "Muted text says something secondary: updated 3 minutes ago." }h3 { "A third-level title" }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" } }pre { code { "inherit './theme/theme.hl'" } }}section {h2 { "Buttons" }p { class = "row"button { type = "button" class = "primary" "Save" }button { type = "button" "Cancel" }button { type = "button" class = "danger" "Delete" }button { type = "button" disabled = "disabled" "Disabled" }a { class = "button" href = "/elements" "A link as a button" }}p { class = "muted" "Quiet by default; the accent marks the one main action; danger says it destroys something." }}section {h2 { "Fields" }form { method = "get" action = "/elements"p { label { 'for' = "el-title" "Title" } input { id = "el-title" type = "text" name = "title" placeholder = "A title" } }p { label { 'for' = "el-mail" "E-mail (invalid)" } input { id = "el-mail" type = "email" name = "mail" value = "not an address" 'aria-invalid' = "true" } }p { label { 'for' = "el-kind" "Kind" } select { id = "el-kind" name = "kind" option { "Series" } option { "Movie" } option { "Show" } } }p { label { 'for' = "el-notes" "Notes" } textarea { id = "el-notes" name = "notes" placeholder = "Write…" } }fieldset {legend { "Show" }label { input { type = "checkbox" name = "watched" checked = "checked" } "Watched" }label { input { type = "radio" name = "order" value = "new" checked = "checked" } "Newest first" }label { input { type = "radio" name = "order" value = "old" } "Oldest first" }}p { button { type = "submit" "Send" } }}}section {h2 { "Foldables" }p { class = "muted" "The border is part of the foldable, like the tracker's seasons." }details { open = "open"summary { "Season 2 · 8 episodes" }ol { li { "The Fall" } li { "Lamia" } li { "Feral" } }}details {summary { "Season 1 · 10 episodes" }p { "Folded until opened." }}}section {h2 { "Drop zone" }dropZone { id = "el-drop" on dragover(e) { emit elDragOver(e) } on dragleave(e) { emit elDragLeave(e) } on drop(e) { emit elDrop(e) }"Drop a file here"}p { class = "muted" output { id = "el-dropped" dropped } }}section {h2 { "Table" }table {thead { tr { th { "Title" } th { "Type" } th { "Next" } } }tbody {tr { td { "Reacher" } td { span { class = "pill type-2" "Series" } } td { "S03E08" } }tr { td { "Dune: Part Two" } td { span { class = "pill type-1" "Movie" } } td { class = "muted" "watched" } }tr { td { "Late Night with the Devil" } td { span { class = "pill type-1" "Movie" } } td { "—" } }tr { td { "Taskmaster" } td { span { class = "pill type-3" "Show" } } td { "S18E02" } }}}}section {h2 { "Type colours and pills" }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." }p { class = "row"span { class = "pill type-1" "Movie" } span { class = "pill type-2" "Series" } span { class = "pill type-3" "Show" }span { class = "pill type-4" "Genre" } span { class = "pill type-5" "Person" } span { class = "pill type-6" "Type 6" }}p { class = "row"a { class = "type-1" href = "/elements" "Dune: Part Two" } a { class = "type-2" href = "/elements" "Reacher" } a { class = "type-3" href = "/elements" "Taskmaster" }a { class = "type-4" href = "/elements" "Science Fiction" } a { class = "type-5" href = "/elements" "Alan Ritchson" }}p { class = "row"span { class = "pill" "Accent" } span { class = "pill success" "Running" } span { class = "pill warning" "Paused" } span { class = "pill danger" "Ended" } span { class = "pill quiet" "Unknown" }}}section {h2 { "Empty state and an overlong title" }p { class = "empty" "No notes yet." }h3 { "Averyveryverylongtitlewithoutanyspacethatmustnotpushthepagesidewaysonaphone and then some more words to wrap" }}}}}}on elDragOver(e) {e.preventDefault()e.currentTarget.classList.add('over')}on elDragLeave(e) { e.currentTarget.classList.remove('over') }on elDrop(e) {e.preventDefault()e.currentTarget.classList.remove('over')files = e.dataTransfer.filesdropped = files.length > 0 ? 'Dropped: ' + files[0].name + ' (kept nowhere — a showcase)' : 'Dropped something without a file.'}
Branches
Latest commits
- 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
- 98a311c0gate: 390 px checks for list rows, table word, edited tap target, code in titlesmre
- 769b99d7theme: table cells keep a word whole, code in a title stays text-sized, 'edited' is a 44 px tap target on the phonemre
- c36b7595list rows (notes, mail) stack their parts full width: the date no longer a one-letter column beside the titlemre
- 02aa74aasync components.hybriel 134b4e3: MdEditor builds an editor put into the page at once, redraws a surface put in anew (F5, hybriel#211)mre
- 268b1c87sync components.hybriel 6b0936a: the 'edited' foldable drops the theme's border and marginmre
- c51d039fsync components.hybriel 8d79ff7: bubble hugs its content, quiet 'edited' label; gate checksmre
- f4ad7eecsync components 9a: shared Icon (icons/icons.hl), md-editor toolbar icons + single focus ring (components f4-icons ba96735)mre
- 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