From: Chris Fulljames Date: Tue, 11 Feb 2025 01:39:11 +0000 (-0500) Subject: Use song colors in song lists outside profile X-Git-Url: https://littlesong.place/gitweb/gitweb.cgi?a=commitdiff_plain;h=5652f48ccb4109e188eb497f1c6d8ca6b132820c;p=littlesongplace.git Use song colors in song lists outside profile --- diff --git a/main.py b/main.py index d777b48..72ef925 100644 --- a/main.py +++ b/main.py @@ -802,6 +802,9 @@ class Song: description: str tags: list[str] collaborators: list[str] + fgcolor: str + bgcolor: str + accolor: str def json(self): return json.dumps(vars(self)) @@ -857,7 +860,18 @@ class Song: for sd in songs_data: song_tags = [t["tag"] for t in tags[sd["songid"]]] song_collabs = [c["name"] for c in collabs[sd["songid"]]] - songs.append(cls(sd["songid"], sd["userid"], sd["username"], sd["title"], sanitize_user_text(sd["description"]), song_tags, song_collabs)) + songs.append(cls( + sd["songid"], + sd["userid"], + sd["username"], + sd["title"], + sanitize_user_text(sd["description"]), + song_tags, + song_collabs, + sd["fgcolor"], + sd["bgcolor"], + sd["accolor"], + )) return songs diff --git a/static/player.js b/static/player.js index 868e8dd..ab0327e 100644 --- a/static/player.js +++ b/static/player.js @@ -158,13 +158,13 @@ document.addEventListener("DOMContentLoaded", (event) => { var button = document.getElementById("play-pause-button"); audio.addEventListener("play", (event) => { button.className = "lsp_btn_pause02"; - button.src = customImage(document.getElementById("lsp_btn_pause02")); + button.src = customImage(document.getElementById("lsp_btn_pause02"), button); }) // Show play button when audio is paused audio.addEventListener("pause", (event) => { button.className = "lsp_btn_play02"; - button.src = customImage(document.getElementById("lsp_btn_play02")); + button.src = customImage(document.getElementById("lsp_btn_play02"), button); }) // Audio position scrubbing diff --git a/static/styles.css b/static/styles.css index 130bc63..2d118ba 100644 --- a/static/styles.css +++ b/static/styles.css @@ -244,6 +244,7 @@ div.song-list { div.song { box-shadow: 0px 0px 5px 0px; border-radius: 10px; + background-color: var(--yellow); } div.song-main { @@ -262,6 +263,10 @@ div.song-info { margin: 10px; } +div.song-info-sep { + color: var(--black); +} + /* Artist on separate line for mobile */ @media screen and (max-width: 480px) { div.song-info { @@ -293,6 +298,10 @@ div.song-buttons { width: 32px; } +.collab-name { + color: var(--black); +} + div.song-details { display: flex; flex-direction: column; diff --git a/templates/base.html b/templates/base.html index 693afd3..fe17aee 100644 --- a/templates/base.html +++ b/templates/base.html @@ -17,19 +17,19 @@