Initial commit

This commit is contained in:
Cadence Ember 2025-03-31 17:51:14 +13:00
parent 5a8186a46c
commit 15ff7e5b47
25 changed files with 2703 additions and 0 deletions

24
pug/album_grid.pug Normal file
View file

@ -0,0 +1,24 @@
extends includes/layout.pug
block view
.mx-auto.w100.wmx11.fs-body1#content
.d-grid.gx8.gy12.jc-center(style="grid-template-columns: repeat(auto-fit, 210px)")
each item in items
div
a.album-grid-link(href=item.item_url)
img(loading="lazy" src=item.item_art_url width=210 height=210)
p.fs-body3.mb8= item.item_title
.d-flex.fw-wrap.g4
span.s-tag.s-tag__xs
span.s-tag--sponsor!= icons.get("compact-disc", 16)
= item.total_duration
a.s-tag.s-tag__xs(href=and({arrange: "track", filter_field: "item_id", filter: item.item_id}))
span.s-tag--sponsor!= icons.get("music-note", 16)
= item.track_count
a.s-tag.s-tag__xs(href=and({filter_field: "band_name", filter: item.band_name}))
span.s-tag--sponsor!= icons.get("people-tag", 16)
= item.band_name
- let label = item.band_url.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
a.s-tag.s-tag__xs(href=and({filter_field: "band_url", filter: label}))
span.s-tag--sponsor!= icons.get("component", 16)
= label

21
pug/album_list.pug Normal file
View file

@ -0,0 +1,21 @@
extends includes/layout.pug
block view
.mx-auto.w100.wmx11.fs-body1#content
.s-table-container
table.s-table.s-table__bx.duration-last-col
thead
th Album
th Artist
th Label
th Tracks
th Length
tbody
each item in items
tr
td= item.item_title
td= item.band_name
- let label = item.band_url.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
td= label
td= item.track_count
td= item.total_duration

27
pug/artist_grid.pug Normal file
View file

@ -0,0 +1,27 @@
extends includes/layout.pug
block view
.mx-auto.w100.wmx9.fs-body1#content
.d-flex.fd-column.g4
each item in items
.d-flex.g4
.fl-grow1.pb12
.fs-headline1= item.band_name
.d-flex.fw-wrap.g4
a.s-tag.s-tag__xs(href=and({arrange: "album", filter_field: "band_name", filter: item.band_name}))
span.s-tag--sponsor!= icons.get("album", 16)
= item.album_count
a.s-tag.s-tag__xs(href=and({arrange: "track", filter_field: "band_name", filter: item.band_name}))
span.s-tag--sponsor!= icons.get("music-note", 16)
= item.track_count
span.s-tag.s-tag__xs
span.s-tag--sponsor!= icons.get("compact-disc", 16)
= item.total_duration
- let labels = item.labels.split("|").map(x => x.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1"))
each label in labels
a.s-tag.s-tag__xs(href=and({filter_field: "band_url", filter: label}))
span.s-tag--sponsor!= icons.get("component", 16)
= label
each preview in item.previews
a.d-flex(href=preview.item_url)
img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px")

21
pug/artist_list.pug Normal file
View file

@ -0,0 +1,21 @@
extends includes/layout.pug
block view
.mx-auto.w100.wmx11.fs-body1#content
.s-table-container
table.s-table.s-table__bx.duration-last-col
thead
th Artist
th Label
th Albums
th Tracks
th Length
tbody
each item in items
tr
td= item.band_name
- let label = item.band_url.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
td= label
td= item.album_count
td= item.track_count
td= item.total_duration

95
pug/includes/layout.pug Normal file
View file

@ -0,0 +1,95 @@
mixin navi(key, value, icon, text)
a.s-navigation--item(href=and({[key]: value}) class={"is-selected": query[key] === value})&attributes(attributes)
if icon
!= icons.get(icon)
if text
span.ml4= text
block
doctype html
html
head
meta(charset="utf-8")
<meta name="viewport" content="width=device-width, initial-scale=1" />
title BC Explorer
link(rel="stylesheet" type="text/css" href="/static/stacks.min.css")
script(src="/static/htmx.js")
meta(name="htmx-config" content='{"requestClass":"is-loading"}')
style.
.themed {
--theme-base-primary-color-h: 191;
--theme-base-primary-color-s: 37%;
--theme-base-primary-color-l: 48%;
--theme-dark-primary-color-h: 191;
--theme-dark-primary-color-s: 45%;
--theme-dark-primary-color-l: 60%;
}
.s-navigation--item.is-loading svg, .s-tag.is-loading svg {
visibility: hidden;
}
.s-navigation__toggle.s-navigation {
--_na-item-bg: var(--black-150);
}
.duration-last-col td:last-child {
text-align: right;
white-space: pre;
}
.s-tag {
white-space: normal;
}
.s-sidebarwidget th {
font-weight: normal;
color: var(--black-400);
}
.album-grid-link {
--_li-fc: var(--black);
--_li-fc-visited: var(--black-400);
}
body.themed.theme-system.overflow-y-scroll(hx-boost="true")
header.s-topbar
.s-topbar--container.wmx9
.s-topbar--logo BC Explorer
.fl-grow1
nav
ul.s-navigation
li: +navi("arrange", "album", "album", "Album")
li: +navi("arrange", "artist", "people-tag", "Artist")
li: +navi("arrange", "label", "component", "Label")
li: +navi("arrange", "tag", "label", "Tag")
li: +navi("arrange", "track", "music-note", "Track")
.px16
nav
ul.s-navigation.s-navigation__toggle.g0
li: +navi("shape", "grid").brr0!= icons.get("view-grid")
li: +navi("shape", "list").blr0!= icons.get("table-rows")
.fl-grow1
#player(hx-preserve)
button.s-btn.s-btn__outlined.s-btn__xs!= icons.get("play")
.d-flex.py24.px16.g24.fs-body1
.fl-grow1
block view
div
.ps-sticky.t24.d-flex.fd-column.g12
if filter
.s-sidebarwidget.s-sidebarwidget__blue.d-flex.ai-center.gx16.jc-space-between.p8.pl16
!= icons.get("search")
div Searching for #[strong= filter]
.fl-grow1
a.s-btn.s-notice--btn(href=and({filter: null, filter_field: null})) Clear
.s-sidebarwidget.wmn3
.s-sidebarwidget--header Collection
table.s-sidebarwidget--content.s-sidebarwidget__items
tr.s-sidebarwidget--item
th albums
td= albumCount
tr.s-sidebarwidget--item
th singles
td= singleCount
tr.s-sidebarwidget--item
th tracks
td= trackCount
tr.s-sidebarwidget--item
th value
td #{displayCurrencySymbol}#{purchaseValue} #{displayCurrency}

27
pug/label_grid.pug Normal file
View file

@ -0,0 +1,27 @@
extends includes/layout.pug
block view
.mx-auto.w100.wmx9.fs-body1#content
.d-flex.fd-column.g4
each item in items
.d-flex.g4
.fl-grow1.pb12
- let minBandURL = item.band_url.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
- let label = item.display_name.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
.fs-headline1= label
.d-flex.fw-wrap.g4
a.s-tag.s-tag__xs(href=and({arrange: "album", filter_field: "band_url", filter: minBandURL}))
span.s-tag--sponsor!= icons.get("album", 16)
= item.album_count
a.s-tag.s-tag__xs(href=and({arrange: "artist", filter_field: "band_url", filter: minBandURL}))
span.s-tag--sponsor!= icons.get("people-tag", 16)
= item.artist_count
a.s-tag.s-tag__xs(href=and({arrange: "track", filter_field: "band_url", filter: minBandURL}))
span.s-tag--sponsor!= icons.get("music-note", 16)
= item.track_count
span.s-tag.s-tag__xs
span.s-tag--sponsor!= icons.get("compact-disc", 16)
= item.total_duration
each preview in item.previews
a.d-flex(href=preview.item_url)
img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px")

22
pug/label_list.pug Normal file
View file

@ -0,0 +1,22 @@
extends includes/layout.pug
block view
.mx-auto.w100.wmx11.fs-body1#content
.s-table-container
table.s-table.s-table__bx.duration-last-col
thead
th Label
th Albums
th Artists
th Tracks
th Length
tbody
each item in items
tr
- let minBandURL = item.band_url.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
- let label = item.display_name.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
td= label
td= item.album_count
td= item.artist_count
td= item.track_count
td= item.total_duration

25
pug/track_list.pug Normal file
View file

@ -0,0 +1,25 @@
extends includes/layout.pug
block view
.mx-auto.w100.wmx11#content
.s-table-container
table.s-table.s-table__bx
thead
th #
th Title
th Artist
th Album
th Label
tbody
each item in items
tr
td
if item.why && item.featured_track == item.track_id
| ☆
else
= item.track_number || "-"
td: a(href=item.item_url)= item.title
td= item.artist
td= item.item_title
- let label = item.band_url.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
td= label