gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc5b8fde9c5b8fde9jukebox JB3b: keyboard gap repro as a reportmrec5b8fde9/components/styles.hl

11.4 KB

  1. // components/styles.hl — the app's own CSS: the WorldAPI theme (theme/theme.hl, copied verbatim from layouts.worldapi.org; never edited here)
  2. // 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
  3. // compact player bar. Tokens only, no written colours, no borders. MOBILE FIRST: the phone's rules outside a block; the one
  4. // `@media (min-width: 60rem)` block adds the wide layout.
  5. inherit '../theme/theme.hl'
  6. import { var } from 'hl:web/css'
  7. import { yellow } from '../shared/tokens.hl'
  8. colorAccent = var(yellow)
  9. // the player bar's height (0 until a song was picked); the screens take what is left of the viewport
  10. '.jb-app' { '--jb-bar' = '0rem' }
  11. '.jb-app.playing' { '--jb-bar' = '4.25rem' }
  12. '.jb-app.open' { '--jb-bar' = '0rem' }
  13. '@keyframes jb-mount' { 'from' { opacity = '.999' } to { opacity = '1' } }
  14. 'jb-tick' { display = 'block' height = '0' animation = 'jb-mount 100ms linear infinite' }
  15. // a screen: as high as the viewport under the header minus the bar; its list scrolls inside, the header and the bar stay
  16. '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' }
  17. 'jb-screen > virtual-list' { flex = '1 1 auto' height = 'auto' minHeight = '0' marginInline = '-.6rem' }
  18. 'jb-tools' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.35rem .6rem' paddingBottom = '.25rem' }
  19. 'jb-tools select' { flex = '1 1 6rem' minWidth = '0' }
  20. 'jb-tools input[type="search"]' { flex = '1 1 100%' }
  21. 'jb-count input[type="number"]' { flex = 'none' width = '4.5rem' minHeight = '2.25rem' padding = '.2rem .5rem' textAlign = 'center' }
  22. 'jb-tools button.jb-big' { flex = '1 1 100%' minHeight = '3.25rem' fontSize = '1.1rem' color = 'var(--color-accent-text)' background = 'var(--color-accent)' }
  23. 'jb-count button, jb-head button' { minHeight = '2.25rem' padding = '.2rem .9rem' }
  24. 'jb-head button' { margin = '.5rem 0 0' }
  25. 'jb-tools button.on' { color = 'var(--color-accent-text)' background = 'var(--color-accent)' }
  26. 'jb-count' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.25rem .5rem' minHeight = '1.75rem' color = 'var(--color-text-muted)' fontSize = '.9rem' }
  27. 'jb-tabs' { display = 'flex' gap = '.4rem' paddingBottom = '.25rem' }
  28. 'jb-tabs button.on' { color = 'var(--color-accent-text)' background = 'var(--color-accent)' }
  29. // the head of an artist or an album, above the rows (it scrolls away with them)
  30. 'jb-head' { display = 'block' padding = '.25rem .6rem .75rem' }
  31. 'jb-head h1' { margin = '0' fontSize = '1.3rem' }
  32. 'jb-head p' { margin = '.1rem 0 0' color = 'var(--color-text-muted)' }
  33. '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)' }
  34. 'jb-head.jb-album' { textAlign = 'center' }
  35. // the search screen's artists and albums, above the songs
  36. 'jb-hits' { display = 'block' padding = '0 0 .25rem' }
  37. 'jb-hits h2' { margin = '.5rem .6rem .15rem' fontSize = '.85rem' letterSpacing = '.04em' textTransform = 'uppercase' color = 'var(--color-text-muted)' }
  38. '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' }
  39. 'jb-hits button:hover' { background = 'var(--color-surface)' }
  40. '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' }
  41. 'jb-hits button span.jb-name' { flex = '1 1 auto' minWidth = '0' overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' }
  42. 'jb-hits button span.jb-note' { flex = 'none' fontSize = '.85rem' color = 'var(--color-text-muted)' }
  43. 'jb-hits p' { margin = '.4rem .6rem' color = 'var(--color-text-muted)' }
  44. // 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
  45. // 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.
  46. // 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):
  47. // 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.
  48. '.jb-bar' { display = 'none' }
  49. '.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' }
  50. '.jb-bar media-player, .jb-bar media-player mp-buttons' { display = 'contents' }
  51. '.jb-bar media-player audio' { display = 'none' }
  52. '.jb-bar .jb-close, .jb-bar .jb-album' { display = 'none' }
  53. '.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)' }
  54. '.jb-bar button.jb-prev:hover, .jb-bar button.jb-next:hover, .jb-bar .jb-close:hover' { background = 'var(--color-surface)' }
  55. '.jb-bar button.jb-prev' { gridArea = 'prev' }
  56. '.jb-bar button.jb-next' { gridArea = 'next' marginRight = 'max(.25rem, calc((100vw - var(--layout-column)) / 2))' }
  57. '.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' }
  58. '.jb-bar media-player .mp-cover img' { width = '2.5rem' height = '2.5rem' }
  59. '.jb-bar media-player .mp-cover div' { minWidth = '0' }
  60. '.jb-bar media-player .mp-cover h2' { margin = '0' fontSize = '.95rem' lineHeight = '1.3' fontWeight = '600' overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' }
  61. '.jb-bar media-player .mp-cover p' { margin = '0' fontSize = '.8rem' overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' }
  62. '.jb-bar media-player mp-buttons .mp-play' { gridArea = 'buttons' background = 'transparent' }
  63. '.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' }
  64. '.jb-bar media-player mp-seek' { gridArea = 'seek' }
  65. '.jb-app:not(.open) .jb-bar media-player mp-seek' { height = '1rem' margin = '0' }
  66. '.jb-app:not(.open) .jb-bar media-player mp-seek .mp-track' { top = '.375rem' left = '0' right = '0' height = '.25rem' borderRadius = '0' }
  67. '.jb-app:not(.open) .jb-bar media-player mp-seek .mp-thumb' { display = 'none' }
  68. '.jb-app:not(.open) .jb-bar media-player > div:not(.mp-cover)' { display = 'none' }
  69. // 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)
  70. '.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)' }
  71. '.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)' }
  72. '.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' }
  73. '.jb-app.open .jb-bar media-player .mp-cover img' { width = 'min(calc(100vw - 3rem), 32dvh)' height = 'min(calc(100vw - 3rem), 32dvh)' maxWidth = '100%' }
  74. '.jb-app.open .jb-bar media-player .mp-cover h2' { fontSize = '1.25rem' overflow = 'visible' whiteSpace = 'normal' textAlign = 'center' }
  75. '.jb-app.open .jb-bar media-player .mp-cover p' { fontSize = '1rem' whiteSpace = 'normal' textAlign = 'center' }
  76. '.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)' }
  77. '.jb-app.open .jb-bar media-player mp-seek' { gridArea = 'auto' gridColumn = '1 / -1' gridRow = '4' justifySelf = 'stretch' marginInline = '1.25rem' }
  78. '.jb-app.open .jb-bar button.jb-prev' { gridArea = 'auto' gridColumn = '2' gridRow = '5' }
  79. '.jb-app.open .jb-bar media-player mp-buttons .mp-back' { display = 'inline-flex' gridColumn = '3' gridRow = '5' }
  80. '.jb-app.open .jb-bar media-player mp-buttons .mp-play' { gridArea = 'auto' gridColumn = '4' gridRow = '5' background = 'var(--color-surface)' }
  81. '.jb-app.open .jb-bar media-player mp-buttons .mp-forward' { display = 'inline-flex' gridColumn = '5' gridRow = '5' }
  82. '.jb-app.open .jb-bar button.jb-next' { gridArea = 'auto' gridColumn = '6' gridRow = '5' marginRight = '0' }
  83. '.jb-app.open .jb-bar media-player mp-buttons .mp-times' { display = 'inline-flex' gridColumn = '2 / 5' gridRow = '6' justifySelf = 'start' marginLeft = '0' }
  84. '.jb-app.open .jb-bar media-player mp-buttons .mp-mute' { display = 'inline-flex' gridColumn = '5' gridRow = '6' }
  85. '.jb-app.open .jb-bar media-player mp-buttons .mp-speed' { display = 'inline-flex' gridColumn = '6' gridRow = '6' }
  86. '.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' }
  87. '.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)' }
  88. '.jb-app.open .jb-bar media-player ol.mp-queue li:nth-child(n+22)' { display = 'none' }
  89. '.jb-app.open .jb-bar media-player ol.mp-queue .mp-q-title' { overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' overflowWrap = 'normal' }
  90. '@media (min-width: 60rem)' {
  91. '.jb-app.playing' { '--jb-bar' = '4.75rem' }
  92. '.jb-app.open' { '--jb-bar' = '0rem' }
  93. 'jb-screen' { paddingTop = '1rem' }
  94. 'jb-tools select' { flex = '0 0 14rem' }
  95. '.jb-app:not(.open) .jb-bar media-player mp-buttons .mp-times' { display = 'inline-flex' marginLeft = '.5rem' }
  96. '.jb-app.open .jb-bar' { top = 'var(--layout-header)' left = 'auto' width = '24rem' zIndex = '15' }
  97. '.jb-app.open jb-screen' { marginRight = '24rem' }
  98. '.jb-app.open .jb-bar media-player .mp-cover img' { width = 'min(18rem, 32dvh)' height = 'min(18rem, 32dvh)' }
  99. }

Branches

Latest commits

  • c5b8fde9jukebox JB3b: keyboard gap repro as a reportmre
  • 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