diff --git a/static/script.js b/static/script.js index 2109349..1336945 100644 --- a/static/script.js +++ b/static/script.js @@ -1,12 +1,12 @@ -const fullAbout = document.querySelector("#about #full_about") -const summary = document.querySelector("#about #summary") +const description = document.querySelector("#description > #full") +const summary = document.querySelector("#description > #summary") -function showAbout() { +function showDescription() { summary.classList.toggle("hidden") - fullAbout.classList.toggle("hidden") + description.classList.toggle("hidden") } -fullAbout && [fullAbout, summary].forEach(item => item.onclick = showAbout) +description && [description, summary].forEach(item => item.onclick = showDescription) window.addEventListener("load", () => { const geniusURL = "https://genius.com" + document.location.pathname + document.location.search diff --git a/style/artist.css b/style/artist.css index 2144fd0..9cbec55 100644 --- a/style/artist.css +++ b/style/artist.css @@ -1,25 +1,68 @@ -artist-albumlist #artist-albumlist p { - color: #181d31; - font-weight: 500; +#artist-albumlist { + color: #181d31; + font-weight: 500; + display: grid; + grid-template-columns: repeat(auto-fill, 150px); + gap: 1.5rem; +} + +#artwork-preview { + width: 150px; + height: 150px; + border-radius: 5px; + border: 1px solid #ddd; +} + +#artist-image { + border-radius: 50%; + border: 2px solid #ddd; +} + +#artist-name { + text-align: center; +} + +#artist-single-album { + color: #111; + display: flex; + flex-direction: column; + gap: 0.5rem; + text-align: center; } .dark #artist-albumlist p { - color: #ddd; + color: #ddd; } #artist-albumlist small { - font-size: 1.5rem; - color: #333; + font-size: 1.5rem; + color: #333; } .dark #artist-albumlist small { - color: #ccc; + color: #ccc; } #metadata p { - color: #171717; + color: #171717; } .dark #metadata p { - color: #ddd; + color: #ddd; +} + +#artist-section { + display: flex; + flex-direction: column; + gap: 1rem; +} + +#artist-sections { + display: flex; + flex-direction: column; + gap: 2rem; +} + +#artist-section h2 { + font-size: 2rem; } diff --git a/style/layout.css b/style/layout.css index 3fef342..ec126f9 100644 --- a/style/layout.css +++ b/style/layout.css @@ -5,15 +5,23 @@ } #container { - display: grid; padding: 5rem 0; - grid-template-columns: 24rem calc(1024px - 56rem) 24rem; width: 1024px; margin: 0 auto; - gap: 4rem; + display: grid; flex: 1; } +.trio-split { + grid-template-columns: 24rem calc(1024px - 56rem) 24rem; + gap: 4rem; +} + +.duo-split { + grid-template-columns: 24rem 1fr; + gap: 4rem; +} + .main { flex-grow: 1; } diff --git a/style/main.css b/style/main.css index 1f15feb..5b94c27 100644 --- a/style/main.css +++ b/style/main.css @@ -57,6 +57,10 @@ a { text-decoration: none; } +a:hover { + text-decoration: underline; +} + body.dark { background-color: #181d31; } diff --git a/utils/description.go b/utils/description.go new file mode 100644 index 0000000..4de94dd --- /dev/null +++ b/utils/description.go @@ -0,0 +1,9 @@ +package utils + +func TrimText(text string, keep int) string { + if len(text) > keep { + return text[0:keep] + "..." + } + + return text +} diff --git a/views/album.templ b/views/album.templ index 32e002c..bbb68ba 100644 --- a/views/album.templ +++ b/views/album.templ @@ -7,7 +7,7 @@ import ( templ AlbumPage(a data.Album) { @layout(fmt.Sprintf("%s - %s", a.Artist, a.Name)) { -
{ a.About[0] }
+{ a.About[0] }
{ a.About[1] }
@templ.Raw(a.Description)
+{ album.Name }
- ++ { utils.TrimText(a.Description, 500) } +
+{ a.Description }
+{ album.Name }
+ + } +{ s.About[0] }
+{ s.About[0] }
{ s.About[1] }