jukebox
All repositories: gitoria
1.6 KB
// components/album.hl — `/albums/<id>`: one album, the cover large on top, its songs in track order below; a tap plays from that song on.parent './main.hl'import VirtualList from './virtual-list/virtual-list.hl'import { rowsFor, albumInfo } from '../lib/rows.hl'id = nullinfo = albumInfo(id)__title = info.name + ' · Jukebox'Hybrid albumCtx = { kind = 'album' album = id }Hybrid firstRows = rowsFor({ kind = 'album' album = id }, 0, 100)Number listTotal = firstRows.totalHybrid chunk = firstRows.rowsNumber chunkFrom = 0String playingId = ''Boolean hasCover = info.img != ''Boolean noCover = info.img == ""String coverAlt = "Cover of " + info.nameon albumLoad(first, wanted) {let start = first - 20if (start < 0) { start = 0 }r = emit server jbRows(albumCtx, start, 100)listTotal = r.totalchunk = r.rowschunkFrom = r.offsetreturn null}loadRange = (first, wanted) => { emit albumLoad(first, wanted) }on albumShuffle(e) {emit jbShuffle({ kind = 'list' ctx = albumCtx })return null}picked = (rowId, index) => {playingId = rowIdemit jbPlay(albumCtx, index, rowId)emit albumLoad(index, 0)}View {jbScreen {VirtualList { itemCount = listTotal rowHeight = 56 loaded = chunk loadedFrom = chunkFrom onRange = loadRange onPick = picked selectedId = playingId thumbs = "false" listLabel = "Songs of the album"jbHead { class = "jb-album"if (hasCover) { img { id = "cover" src = info.img alt = coverAlt } }if (noCover) { div { class = "jb-nocover" 'aria-hidden' = "true" } }h1 { id = "name" info.name }p { info.artist }p { info.line }button { id = "shuffle" type = "button" on click(e) { emit albumShuffle(e) } "Shuffle" }}}}}
Branches
Latest commits
- b011f98eRecords: style form live on day35mre
- 60d90cb2Records: L1 woken for the restartmre
- 75ae544fRecords: restart waits for the connection to closemre
- e0b75951Records: L1 merged and pushed, restart waits for an open connectionmre
- f2b5db98styles: format styles with nested rules and bare queriesmre
- f036bab4search: format styles with nested rules and bare queriesmre
- ef9a9d4asongs: format styles with nested rules and bare queriesmre
- f22f9aacmain: format styles with nested rules and bare queriesmre
- f56cd7c7Sync icons from 8176eb1 and verify mixed component sourcesmre
- d56e5054Sync theme and shared tokens from layouts 17e0f03mre
- b1362547Re-vendor to Hybriel set day35mre
- 89e10f08Records: mission 002 rollback wordingmre
- 9485dee7Records: mission 002 brief (live step)mre
- 9ba68fe7Records: S1b reviewedmre
- 193dfff1Records: S1 result, S1b startedmre
- 028ed776Records: mission 001 continuation S1bmre
- 1838d7e8Records: S1 startedmre
- a43fca3fRecords: mission 001 decided pointsmre
- 41773828Records: statusmre
- a82c0805Records: mission 001 brief (Style form)mre