jukebox
All repositories: gitoria
11.4 KB
// components/styles.hl — the app's own CSS: the WorldAPI theme (theme/theme.hl, copied verbatim from layouts.worldapi.org; never edited here)// plus what the library screens need: the page that fills the screen under the header, the toolbar, the album head, the search results, and the// compact player bar. Tokens only, no written colours, no borders. MOBILE FIRST: the phone's rules outside a block; the one// `@media (min-width: 60rem)` block adds the wide layout.inherit '../theme/theme.hl'import { var } from 'hl:web/css'import { yellow } from '../shared/tokens.hl'colorAccent = var(yellow)// the player bar's height (0 until a song was picked); the screens take what is left of the viewport'.jb-app' { '--jb-bar' = '0rem' }'.jb-app.playing' { '--jb-bar' = '4.25rem' }'.jb-app.open' { '--jb-bar' = '0rem' }'@keyframes jb-mount' { 'from' { opacity = '.999' } to { opacity = '1' } }'jb-tick' { display = 'block' height = '0' animation = 'jb-mount 100ms linear infinite' }// a screen: as high as the viewport under the header minus the bar; its list scrolls inside, the header and the bar stay'jb-screen' { display = 'flex' flexDirection = 'column' height = 'calc(100dvh - var(--layout-header) - var(--jb-bar))' paddingInline = 'max(var(--layout-gutter), calc((100% - var(--layout-column)) / 2))' paddingTop = '.5rem' }'jb-screen > virtual-list' { flex = '1 1 auto' height = 'auto' minHeight = '0' marginInline = '-.6rem' }'jb-tools' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.35rem .6rem' paddingBottom = '.25rem' }'jb-tools select' { flex = '1 1 6rem' minWidth = '0' }'jb-tools input[type="search"]' { flex = '1 1 100%' }'jb-count input[type="number"]' { flex = 'none' width = '4.5rem' minHeight = '2.25rem' padding = '.2rem .5rem' textAlign = 'center' }'jb-tools button.jb-big' { flex = '1 1 100%' minHeight = '3.25rem' fontSize = '1.1rem' color = 'var(--color-accent-text)' background = 'var(--color-accent)' }'jb-count button, jb-head button' { minHeight = '2.25rem' padding = '.2rem .9rem' }'jb-head button' { margin = '.5rem 0 0' }'jb-tools button.on' { color = 'var(--color-accent-text)' background = 'var(--color-accent)' }'jb-count' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.25rem .5rem' minHeight = '1.75rem' color = 'var(--color-text-muted)' fontSize = '.9rem' }'jb-tabs' { display = 'flex' gap = '.4rem' paddingBottom = '.25rem' }'jb-tabs button.on' { color = 'var(--color-accent-text)' background = 'var(--color-accent)' }// the head of an artist or an album, above the rows (it scrolls away with them)'jb-head' { display = 'block' padding = '.25rem .6rem .75rem' }'jb-head h1' { margin = '0' fontSize = '1.3rem' }'jb-head p' { margin = '.1rem 0 0' color = 'var(--color-text-muted)' }'jb-head img, jb-head .jb-nocover' { display = 'block' width = 'min(100%, 18rem)' aspectRatio = '1 / 1' margin = '0 auto .75rem' objectFit = 'cover' borderRadius = 'var(--radius-large)' background = 'var(--color-surface)' }'jb-head.jb-album' { textAlign = 'center' }// the search screen's artists and albums, above the songs'jb-hits' { display = 'block' padding = '0 0 .25rem' }'jb-hits h2' { margin = '.5rem .6rem .15rem' fontSize = '.85rem' letterSpacing = '.04em' textTransform = 'uppercase' color = 'var(--color-text-muted)' }'jb-hits button' { display = 'flex' alignItems = 'center' gap = '.7rem' width = '100%' height = '3.25rem' minHeight = '0' margin = '0' padding = '0 .6rem' fontWeight = '400' textAlign = 'left' color = 'var(--color-text)' background = 'transparent' }'jb-hits button:hover' { background = 'var(--color-surface)' }'jb-hits button img, jb-hits button .jb-nopic' { flex = 'none' width = '2.25rem' height = '2.25rem' borderRadius = 'var(--radius-small)' background = 'var(--color-surface)' objectFit = 'cover' }'jb-hits button span.jb-name' { flex = '1 1 auto' minWidth = '0' overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' }'jb-hits button span.jb-note' { flex = 'none' fontSize = '.85rem' color = 'var(--color-text-muted)' }'jb-hits p' { margin = '.4rem .6rem' color = 'var(--color-text-muted)' }// THE PLAYER BAR, fixed at the bottom, compact: a thin seek line across the top, under it the small cover with title and artist, previous song, play / pause, next song (the// times from 60rem). The media player is `display: contents`, so its parts and the shell's own buttons are cells of the bar's grid.// A tap on the bar opens THE NOW-PLAYING OVERLAY: the same bar and the same parts, placed by the second grid below (full screen on the phone, a side panel from 60rem):// close button, large cover, title, artist, album, the seek line, previous / back 10 s / play / forward 10 s / next, the times, mute and speed, and the next 20 songs.'.jb-bar' { display = 'none' }'.jb-app.playing .jb-bar' { display = 'grid' position = 'fixed' left = '0' right = '0' bottom = '0' zIndex = '15' height = 'var(--jb-bar)' background = 'var(--color-background-sunken)' gridTemplateColumns = 'minmax(0, 1fr) auto auto auto' gridTemplateRows = '1rem 1fr' gridTemplateAreas = '"seek seek seek seek" "cover prev buttons next"' alignItems = 'center' }'.jb-bar media-player, .jb-bar media-player mp-buttons' { display = 'contents' }'.jb-bar media-player audio' { display = 'none' }'.jb-bar .jb-close, .jb-bar .jb-album' { display = 'none' }'.jb-bar button.jb-prev, .jb-bar button.jb-next' { display = 'inline-flex' alignItems = 'center' justifyContent = 'center' minWidth = '2.75rem' minHeight = '2.75rem' margin = '0' padding = '0' color = 'var(--color-text)' background = 'transparent' borderRadius = 'var(--radius-small)' }'.jb-bar button.jb-prev:hover, .jb-bar button.jb-next:hover, .jb-bar .jb-close:hover' { background = 'var(--color-surface)' }'.jb-bar button.jb-prev' { gridArea = 'prev' }'.jb-bar button.jb-next' { gridArea = 'next' marginRight = 'max(.25rem, calc((100vw - var(--layout-column)) / 2))' }'.jb-bar media-player .mp-cover' { gridArea = 'cover' display = 'flex' alignItems = 'center' gap = '.6rem' margin = '0' minWidth = '0' paddingInline = 'max(var(--layout-gutter), calc((100% - var(--layout-column)) / 2))' cursor = 'pointer' }'.jb-bar media-player .mp-cover img' { width = '2.5rem' height = '2.5rem' }'.jb-bar media-player .mp-cover div' { minWidth = '0' }'.jb-bar media-player .mp-cover h2' { margin = '0' fontSize = '.95rem' lineHeight = '1.3' fontWeight = '600' overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' }'.jb-bar media-player .mp-cover p' { margin = '0' fontSize = '.8rem' overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' }'.jb-bar media-player mp-buttons .mp-play' { gridArea = 'buttons' background = 'transparent' }'.jb-bar media-player mp-buttons .mp-back, .jb-bar media-player mp-buttons .mp-forward, .jb-bar media-player mp-buttons .mp-mute, .jb-bar media-player mp-buttons .mp-speed, .jb-bar media-player mp-buttons .mp-times' { display = 'none' }'.jb-bar media-player mp-seek' { gridArea = 'seek' }'.jb-app:not(.open) .jb-bar media-player mp-seek' { height = '1rem' margin = '0' }'.jb-app:not(.open) .jb-bar media-player mp-seek .mp-track' { top = '.375rem' left = '0' right = '0' height = '.25rem' borderRadius = '0' }'.jb-app:not(.open) .jb-bar media-player mp-seek .mp-thumb' { display = 'none' }'.jb-app:not(.open) .jb-bar media-player > div:not(.mp-cover)' { display = 'none' }// the overlay: a grid of seven rows (close, cover and title, album, seek, the five controls, times / mute / speed, the queue) and seven columns (the five controls in the middle)'.jb-app.open .jb-bar' { display = 'grid' position = 'fixed' top = '0' left = '0' right = '0' bottom = '0' zIndex = '40' height = 'auto' background = 'var(--color-background)' gridTemplateColumns = '1fr 3rem 3rem 3.5rem 3rem 3rem 1fr' gridTemplateRows = 'auto auto auto auto auto auto minmax(0, 1fr)' gridTemplateAreas = 'none' alignItems = 'center' justifyItems = 'center' touchAction = 'none' paddingBottom = 'env(safe-area-inset-bottom)' }'.jb-app.open .jb-bar .jb-close' { display = 'inline-flex' gridColumn = '1 / -1' gridRow = '1' justifySelf = 'end' alignItems = 'center' justifyContent = 'center' minWidth = '2.75rem' minHeight = '2.75rem' margin = '.25rem .5rem 0' padding = '0' color = 'var(--color-text)' background = 'transparent' borderRadius = 'var(--radius-small)' }'.jb-app.open .jb-bar media-player .mp-cover' { gridArea = 'auto' gridColumn = '1 / -1' gridRow = '2' flexDirection = 'column' gap = '.6rem' width = '100%' paddingInline = '1.5rem' cursor = 'default' textAlign = 'center' }'.jb-app.open .jb-bar media-player .mp-cover img' { width = 'min(calc(100vw - 3rem), 32dvh)' height = 'min(calc(100vw - 3rem), 32dvh)' maxWidth = '100%' }'.jb-app.open .jb-bar media-player .mp-cover h2' { fontSize = '1.25rem' overflow = 'visible' whiteSpace = 'normal' textAlign = 'center' }'.jb-app.open .jb-bar media-player .mp-cover p' { fontSize = '1rem' whiteSpace = 'normal' textAlign = 'center' }'.jb-app.open .jb-bar .jb-album' { display = 'block' gridColumn = '1 / -1' gridRow = '3' margin = '.1rem 1.5rem 0' textAlign = 'center' color = 'var(--color-text-muted)' }'.jb-app.open .jb-bar media-player mp-seek' { gridArea = 'auto' gridColumn = '1 / -1' gridRow = '4' justifySelf = 'stretch' marginInline = '1.25rem' }'.jb-app.open .jb-bar button.jb-prev' { gridArea = 'auto' gridColumn = '2' gridRow = '5' }'.jb-app.open .jb-bar media-player mp-buttons .mp-back' { display = 'inline-flex' gridColumn = '3' gridRow = '5' }'.jb-app.open .jb-bar media-player mp-buttons .mp-play' { gridArea = 'auto' gridColumn = '4' gridRow = '5' background = 'var(--color-surface)' }'.jb-app.open .jb-bar media-player mp-buttons .mp-forward' { display = 'inline-flex' gridColumn = '5' gridRow = '5' }'.jb-app.open .jb-bar button.jb-next' { gridArea = 'auto' gridColumn = '6' gridRow = '5' marginRight = '0' }'.jb-app.open .jb-bar media-player mp-buttons .mp-times' { display = 'inline-flex' gridColumn = '2 / 5' gridRow = '6' justifySelf = 'start' marginLeft = '0' }'.jb-app.open .jb-bar media-player mp-buttons .mp-mute' { display = 'inline-flex' gridColumn = '5' gridRow = '6' }'.jb-app.open .jb-bar media-player mp-buttons .mp-speed' { display = 'inline-flex' gridColumn = '6' gridRow = '6' }'.jb-app.open .jb-bar media-player > div:not(.mp-cover)' { display = 'block' gridColumn = '1 / -1' gridRow = '7' justifySelf = 'stretch' alignSelf = 'stretch' minHeight = '0' overflowY = 'auto' padding = '0 .75rem .75rem' touchAction = 'pan-y' }'.jb-app.open .jb-bar media-player .mp-queue-title' { margin = '.5rem .25rem .1rem' fontSize = '.85rem' letterSpacing = '.04em' textTransform = 'uppercase' color = 'var(--color-text-muted)' }'.jb-app.open .jb-bar media-player ol.mp-queue li:nth-child(n+22)' { display = 'none' }'.jb-app.open .jb-bar media-player ol.mp-queue .mp-q-title' { overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' overflowWrap = 'normal' }'@media (min-width: 60rem)' {'.jb-app.playing' { '--jb-bar' = '4.75rem' }'.jb-app.open' { '--jb-bar' = '0rem' }'jb-screen' { paddingTop = '1rem' }'jb-tools select' { flex = '0 0 14rem' }'.jb-app:not(.open) .jb-bar media-player mp-buttons .mp-times' { display = 'inline-flex' marginLeft = '.5rem' }'.jb-app.open .jb-bar' { top = 'var(--layout-header)' left = 'auto' width = '24rem' zIndex = '15' }'.jb-app.open jb-screen' { marginRight = '24rem' }'.jb-app.open .jb-bar media-player .mp-cover img' { width = 'min(18rem, 32dvh)' height = 'min(18rem, 32dvh)' }}
Branches
Latest commits
- 9daebb4bjukebox JB3b: shuffle, now-playing overlay, next and previous, play counting, media session, gates; keyboard left open (Hybriel gap)mre
- 59c1373ejukebox JB3 (work in progress): albums without folder and with disc markers folded, compilations, duplicate songs, own play counter, server-side shuffle queuemre
- 2a4cfc55jukebox: library screens (songs, artists, albums, artist, album, search, favourites), compact player bar, /stream with Range, thumbnails, virtual list vendored, ui gate and real-library checkmre
- 93a44212jukebox: report, numbers of the full scan, notes on the index key rulemre
- bf5167dajukebox: index keys without commas (mpackdb loses them after a reopen), comma fixture and gate checksmre
- 28a82fa2jukebox: README, STATUS, LOG, DECISIONSmre
- d13987dfjukebox: library scanner, ID3 reader, mpackdb database and JSON API, with fixtures and a gatemre