From: Chris Fulljames Date: Sat, 26 Apr 2025 17:02:25 +0000 (-0400) Subject: Visual updates, update news X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=d747223a3d72a54494c6dfbe3fdf71c4236dfe84;p=littlesongplace.git Visual updates, update news --- diff --git a/src/littlesongplace/colors.py b/src/littlesongplace/colors.py index b10a857..c2202c5 100644 --- a/src/littlesongplace/colors.py +++ b/src/littlesongplace/colors.py @@ -1,5 +1,5 @@ BGCOLOR = "#e8e6b5" -FGCOLOR = "#695c73" -ACCOLOR = "#9373a9" +FGCOLOR = "#514659" +ACCOLOR = "#b36fab" DEFAULT_COLORS = dict(bgcolor=BGCOLOR, fgcolor=FGCOLOR, accolor=ACCOLOR) diff --git a/src/littlesongplace/songs.py b/src/littlesongplace/songs.py index 110643c..a8c25f8 100644 --- a/src/littlesongplace/songs.py +++ b/src/littlesongplace/songs.py @@ -23,6 +23,7 @@ bp = Blueprint("songs", __name__) class Song: songid: int userid: int + user: users.User threadid: int username: str title: str @@ -37,7 +38,8 @@ class Song: event_title: Optional[str] def json(self): - return json.dumps(vars(self)) + vs = vars(self) + return json.dumps({k: vs[k] for k in vs if not isinstance(vs[k], users.User)}) def get_comments(self): return comments.for_thread(self.threadid) @@ -204,6 +206,7 @@ def _from_db(query, args=()): songs.append(Song( songid=sd["songid"], userid=sd["userid"], + user=users.User.from_row(sd), threadid=sd["threadid"], username=sd["username"], title=sd["title"], diff --git a/src/littlesongplace/static/MatSaleh.otf b/src/littlesongplace/static/MatSaleh.otf new file mode 100644 index 0000000..242494f Binary files /dev/null and b/src/littlesongplace/static/MatSaleh.otf differ diff --git a/src/littlesongplace/static/Unageo-ExtraBold-Italic.ttf b/src/littlesongplace/static/Unageo-ExtraBold-Italic.ttf new file mode 100644 index 0000000..aca27f5 Binary files /dev/null and b/src/littlesongplace/static/Unageo-ExtraBold-Italic.ttf differ diff --git a/src/littlesongplace/static/Unageo-ExtraBold.ttf b/src/littlesongplace/static/Unageo-ExtraBold.ttf new file mode 100644 index 0000000..4a12295 Binary files /dev/null and b/src/littlesongplace/static/Unageo-ExtraBold.ttf differ diff --git a/src/littlesongplace/static/Unageo-Medium-Italic.ttf b/src/littlesongplace/static/Unageo-Medium-Italic.ttf new file mode 100644 index 0000000..6205886 Binary files /dev/null and b/src/littlesongplace/static/Unageo-Medium-Italic.ttf differ diff --git a/src/littlesongplace/static/Unageo-Medium.ttf b/src/littlesongplace/static/Unageo-Medium.ttf new file mode 100644 index 0000000..8d70fff Binary files /dev/null and b/src/littlesongplace/static/Unageo-Medium.ttf differ diff --git a/src/littlesongplace/static/nav.js b/src/littlesongplace/static/nav.js index cd695aa..b369974 100644 --- a/src/littlesongplace/static/nav.js +++ b/src/littlesongplace/static/nav.js @@ -192,19 +192,19 @@ async function checkForNewActivity() { // Check for new activity every 10s setInterval(checkForNewActivity, 10000); -function customImage(element) { +function customImage(source, target) { // Customize an image by performing a palette swap on the .gif // file. The source element must contain a data-img-b64 attribute // containing the base64 representation of a .gif file. The byte // indexes match .gifs from Aseprite, and may not work for all // .gif files. - var style = window.getComputedStyle(document.body); + var style = window.getComputedStyle(target); var bgcolor = style.getPropertyValue("--yellow"); var accolor = style.getPropertyValue("--purple"); // Convert base64 string to Uint8Array so we can modify it - var data = atob(element.dataset.imgB64); + var data = atob(source.dataset.imgB64); var bytes = Uint8Array.from(data, c => c.charCodeAt(0)); // Replace background color palette bytes in gif file @@ -228,7 +228,7 @@ function updateImageColors() { // Perform a palette swap on all gifs based on current page colors document.querySelectorAll(".img-data").forEach(e => { document.querySelectorAll(`.${e.id}`).forEach(t => { - t.src = customImage(e); + t.src = customImage(e, t); }); }); } diff --git a/src/littlesongplace/static/player.js b/src/littlesongplace/static/player.js index 174add7..e48fe81 100644 --- a/src/littlesongplace/static/player.js +++ b/src/littlesongplace/static/player.js @@ -198,17 +198,17 @@ document.addEventListener("DOMContentLoaded", (event) => { var miniButton = document.getElementById("mini-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); miniButton.className = "lsp_btn_pause02"; - miniButton.src = customImage(document.getElementById("lsp_btn_pause02")); + miniButton.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); miniButton.className = "lsp_btn_play02"; - miniButton.src = customImage(document.getElementById("lsp_btn_play02")); + miniButton.src = customImage(document.getElementById("lsp_btn_play02"), button); }) // Audio position scrubbing diff --git a/src/littlesongplace/static/styles.css b/src/littlesongplace/static/styles.css index 8a143ea..2133bd3 100644 --- a/src/littlesongplace/static/styles.css +++ b/src/littlesongplace/static/styles.css @@ -1,15 +1,46 @@ +/* Fonts */ +@font-face { + font-family: "Mat Saleh"; + src: url("/static/MatSaleh.otf"); +} + +@font-face { + font-family: "Unageo"; + src: url("/static/Unageo-Medium.ttf"); +} + +@font-face { + font-family: "Unageo"; + src: url("/static/Unageo-Medium-Italic.ttf"); + font-style: italic; +} + +@font-face { + font-family: "Unageo"; + src: url("/static/Unageo-ExtraBold.ttf"); + font-weight: bold; +} + +@font-face { + font-family: "Unageo"; + src: url("/static/Unageo-ExtraBold-Italic.ttf"); + font-weight: bold; + font-style: italic; +} + /* General */ :root { --yellow: #e8e6b5; - --purple: #9373a9; + --purple: #b36fab; --blue: #44b7b7; - --black: #695c73; + --black: #514659; + --radius: 5px; } body { background: var(--yellow); color: var(--black); - font-family: sans-serif; + font-family: "Unageo", sans-serif; border-color: var(--purple); max-width: 700px; margin: auto; @@ -21,22 +52,35 @@ a { h1, h2, h3, h4 { color: var(--purple); + font-family: "Mat Saleh", sans-serif; +} + +h1 { + font-size: 40px; + text-align: center; } h2 { - font-size: 20px; + font-size: 26px; + /*border: 2px solid var(--purple);*/ + box-shadow: 3px 3px 0px 0px var(--black); + background: var(--purple); + color: var(--yellow); + border-radius: var(--radius); + text-align: center; + padding: 5px; } h3 { - font-size: 16px; + font-size: 22px; } textarea { - font-family: sans-serif; + font-family: "Unageo", sans-serif; font-size: 16px; color: var(--black); border: 3px solid var(--purple); - border-radius: 10px; + border-radius: var(--radius); padding: 10px; background: var(--yellow); height: 200px; @@ -49,11 +93,11 @@ textarea { input[type=text], input[type=password], input[type=url], input[type=datetime-local] { background: var(--yellow); margin: 10px; - font-family: sans-serif; + font-family: "Unageo", sans-serif; font-size: 16px; color: var(--black); border: 3px solid var(--purple); - border-radius: 10px; + border-radius: var(--radius); padding: 5px; width: 300px; max-width: calc(100% - 40px); @@ -61,14 +105,14 @@ input[type=text], input[type=password], input[type=url], input[type=datetime-loc .button, input[type=submit] { cursor: pointer; - font-family: sans-serif; + font-family: "Unageo", sans-serif; font-size: 16px; font-weight: bold; text-decoration: none; color: var(--yellow); background: var(--purple); border: 0px; - border-radius: 5px; + border-radius: var(--radius); padding: 8px; } @@ -76,7 +120,7 @@ select { border: none; background-color: var(--purple); color: var(--yellow); - border-radius: 5px; + border-radius: var(--radius); font-size: 16px; padding: 8px; } @@ -88,14 +132,16 @@ div.main { } div.page-header { - box-shadow: 0px 0px 20px 0px; - border-radius: 10px; + box-shadow: 5px 5px 0px 0px var(--black); + border: 1px solid var(--black); + border-radius: var(--radius); margin: 10px; + padding: 5px; } .flashes { border: 3px solid var(--blue); - border-radius: 10px; + border-radius: var(--radius); margin: 20px; } @@ -103,7 +149,7 @@ div.page-header { box-sizing: border-box; margin: 10px; border-width: 3px; - border-radius: 10px; + border-radius: var(--radius); border-style: solid; padding: 10px; background-color: var(--yellow); @@ -125,18 +171,22 @@ div.page-header { display: flex; flex-wrap: wrap; gap: 10px; + justify-content: center; } .user-list-entry-container { - border-radius: 10px; - box-shadow: 0px 0px 5px 0px; + border-radius: var(--radius); + background: var(--black); + box-shadow: 2px 2px 0px 0px var(--black); + border: 1px solid var(--black); + overflow: hidden; } .user-list-entry { box-sizing: border-box; height: 100%; background: var(--yellow); - border-radius: 10px; + /*border-radius: var(--radius);*/ padding: 5px; display: flex; @@ -232,7 +282,7 @@ input[type=file] { max-width: 40%; background: var(--purple); padding: 5px; - border-radius: 10px; + border-radius: var(--radius); } .big-pfp { @@ -241,13 +291,13 @@ input[type=file] { margin: 0px; padding: 0px; display: block; - border-radius: 5px; + border-radius: calc(var(--radius) / 2); } .small-pfp { max-width: 32px; max-height: 32px; - border-radius: 5px; + border-radius: calc(var(--radius) / 2); border: solid 2px var(--purple); background-color: var(--purple); vertical-align: middle; @@ -270,8 +320,9 @@ input[type=file] { } .playlist-list-entry { - box-shadow: 0px 0px 5px 0px; - border-radius: 10px; + box-shadow: 3px 3px 0px 0px; + border-radius: var(--radius); + border: 1px solid var(--black); padding: 10px; margin: 10px 0px; } @@ -286,7 +337,7 @@ input[type=file] { .draggable-song { box-shadow: 0px 0px 5px 0px; - border-radius: 10px; + border-radius: var(--radius); padding: 5px 10px; margin: 10px 0px; display: flex; @@ -302,7 +353,7 @@ input[type=file] { height: 22px !important; left: 7px; right: auto; - border-radius: 5px; + border-radius: calc(var(--radius) / 2); } .clr-field input { @@ -329,11 +380,15 @@ div.song-list-songs { display: flex; flex-direction: column; gap: 10px; + font-size: 14px; } -.song-list-songs .song { - box-shadow: 0px 0px 5px 0px; - border-radius: 10px; +div.song { + background: var(--yellow); + box-shadow: 2px 2px 0px 0px; + border-radius: var(--radius); + border: 1px solid var(--black); + overflow: hidden; } div.song-main { @@ -347,6 +402,7 @@ div.song-main { } div.song-info { + font-family: "Unageo", sans-serif; display: flex; flex-wrap: wrap; flex-direction: row; @@ -410,7 +466,7 @@ div.top-level-comment { margin-top: 10px; padding: 10px; box-shadow: 0px 0px 5px 0px; - border-radius: 10px; + border-radius: var(--radius); } div.reply-comment { @@ -418,7 +474,7 @@ div.reply-comment { margin-bottom: 10px; padding: 10px; box-shadow: 0px 0px 5px 0px; - border-radius: 10px; + border-radius: var(--radius); } div.comment-button-container { @@ -450,7 +506,7 @@ div.player { padding: 10px; padding-bottom: 0px; box-shadow: 0px 0px 20px 0px; - border-radius: 10px; + border-radius: var(--radius); background: var(--yellow); } @@ -458,7 +514,7 @@ div.player { margin: 10px; padding-left: 10px; box-shadow: 0px 0px 20px 0px; - border-radius: 10px; + border-radius: var(--radius); background: var(--yellow); display: flex; @@ -528,13 +584,13 @@ div.player-info { #position-slider::-webkit-slider-thumb { height: 20px; width: 20px; - border-radius: 10px; + border-radius: var(--radius); } #position-slider::-moz-range-thumb { height: 20px; width: 20px; - border-radius: 10px; + border-radius: var(--radius); } .player-button img { @@ -558,7 +614,7 @@ div.comment-notification { margin: 10px; padding: 10px; box-shadow: 0px 0px 5px 0px; - border-radius: 10px; + border-radius: var(--radius); } /* Platform-specific global overrides */ @@ -567,3 +623,8 @@ div.comment-notification { display: none; } } + +/* Jam Events */ +.jam-event-list-title { + margin-left: 20px; +} diff --git a/src/littlesongplace/templates/about.html b/src/littlesongplace/templates/about.html index e453696..939e9b5 100644 --- a/src/littlesongplace/templates/about.html +++ b/src/littlesongplace/templates/about.html @@ -4,39 +4,47 @@ {% block body %} -

About littlesong.place

+

about littlesong.place

Hello there, thanks for stopping by!

+

the little place

This site is meant to be a little place for your songs. Of course, there are already lots of big places for songs out there. But I wanted somewhere to share music that was free from algorithms, ads, rankings, and the general noise that comes with most of those big places. A place that encourages and celebrates creativity, and a place for community with other -humans. If any of that resonates with you, then welcome! I hope you enjoy -your stay. +humans. +

+

+If any of that resonates with you, then welcome! I hope you enjoy your stay.

+

the dream

I also love Dreams, and the music community that formed there. But now that live service support for Dreams has ended, and given the uncertain future of Media Molecule and the games industry more broadly, I worry that it's only a matter of time before the servers shut down -for good. Part of my goal with this site is to give others a place to archive -their music from Dreams. But beyond that, I hope it can also eventually become -a similar platform for creativity and community of its own - albeit on a much -smaller scale. +for good. +

+

+Part of my goal with this site is to give others a place to archive +their music from Dreams. But beyond that, my hope is that it can also +eventually become a platform for creativity and community of its own - albeit +on a much smaller scale.

+

the code

The site is open source! You can view it on GitHub.

-

Contact Me!

+

contact me!

I'm always looking for new ways to improve the site! If you have ideas (or if diff --git a/src/littlesongplace/templates/activity.html b/src/littlesongplace/templates/activity.html index d4ceb76..19f8f25 100644 --- a/src/littlesongplace/templates/activity.html +++ b/src/littlesongplace/templates/activity.html @@ -5,7 +5,7 @@ {% block body %} {% if comments %} -

Activity

+

activity

{% for comment in comments %}
diff --git a/src/littlesongplace/templates/base.html b/src/littlesongplace/templates/base.html index a307593..a81552a 100644 --- a/src/littlesongplace/templates/base.html +++ b/src/littlesongplace/templates/base.html @@ -22,11 +22,13 @@