From: Chris Fulljames Date: Thu, 16 Jan 2025 12:39:40 +0000 (-0500) Subject: Design work X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=b6c8c749175289094fd588066bdf6172b60452bc;p=littlesongplace.git Design work --- diff --git a/main.py b/main.py index 95efe86..aa2497f 100644 --- a/main.py +++ b/main.py @@ -44,8 +44,8 @@ app.logger.addHandler(handler) @app.route("/") def index(): - username = session.get("username", None) - return render_template("index.html") + users = [row["username"] for row in query_db("select username from users")] + return render_template("index.html", users=users) @app.get("/signup") def signup_get(): @@ -126,11 +126,6 @@ def logout(): return redirect("/") -@app.get("/users") -def users(): - users = [row["username"] for row in query_db("select username from users")] - return render_template("users.html", users=users) - @app.get("/users/") def users_profile(profile_username): username = session.get("username", None) diff --git a/static/player.js b/static/player.js index 75b639b..b6994af 100644 --- a/static/player.js +++ b/static/player.js @@ -18,6 +18,9 @@ function playCurrentSong() { console.log(song); var songData = JSON.parse(song.dataset.song); + var player = document.getElementById("player") + player.hidden = false; + var audio = document.getElementById("player-audio"); audio.pause(); audio.src = `/song/${songData.userid}/${songData.songid}`; diff --git a/static/styles.css b/static/styles.css index 3309e4a..a38b719 100644 --- a/static/styles.css +++ b/static/styles.css @@ -2,18 +2,72 @@ :root { --yellow: #e8e590; --purple: #9986a6; + --pink: #bc80af; + --blue: #8dcbc2; } body { background: var(--yellow); color: var(--purple); + font-family: sans-serif; + border-color: var(--purple); + max-width: 700px; + margin: auto; +} + +a { + color: var(--purple); +} + +h2 { + font-size: 20px; +} + +textarea { + font-family: sans-serif; + color: var(--purple); + border: 2px solid var(--blue); + border-radius: 10px; + padding: 10px; + background: var(--yellow); + height: 100px; + width: 100%; + box-sizing: border-box; + resize: vertical; +} + +.button { + font-family: sans-serif; + color: var(--yellow); + background: var(--pink); + border: 0px; + border-radius: 5px; + padding: 8px; } div.main { - max-width: 500px; + max-width: 700px; margin: auto; } +div.page-header { + box-shadow: 0px 0px 20px 0px; + border-radius: 10px; + margin: 10px; +} + +.flashes { + border: 3px solid var(--blue); + border-radius: 10px; + margin-top: 20px; +} + +.title-image { + image-rendering: pixelated; + width: 512px; + margin: 10px; +} + /* Navbar */ div.navbar { display: flex; @@ -22,6 +76,25 @@ div.navbar { justify-content: center; align-items: center; gap: 10px; + padding: 10px; +} + +/* Profile */ +.profile-name { + text-align: center; + font-size: 40px; +} + +.profile-action { + margin: 10px; +} + +.profile-edit-buttons { + display: flex; + justify-content: left; + align-items: center; + gap: 10px; + margin: 10px; } /* Filters on /songs page */ @@ -37,11 +110,13 @@ div.navbar { div.song-list { display: flex; flex-direction: column; - gap: 5px; + gap: 10px; } div.song { - border: 3px solid #000; + box-shadow: 0px 0px 5px 0px; + border-radius: 10px; + padding-left: 10px; } div.song-main { @@ -90,11 +165,16 @@ div.song-details { div.player { position: fixed; + max-width: 700px; + margin: auto; + margin-bottom: 10px; + box-shadow: 0px 0px 20px 0px; + border-radius: 10px; bottom: 0; left: 0; right: 0; height: 100px; - border: 3px solid #000; + /*border-top: 3px solid;*/ background: var(--yellow); } @@ -137,7 +217,7 @@ a.player-button img { #player-position-bar { position: absolute; display: inline-block; - background-color: #ccc; + background-color: var(--purple); left: 100; top: 23px; width: 100%; @@ -148,7 +228,7 @@ a.player-button img { position: absolute; display: inline-block; visibility: hidden; - background-color: #555; + background-color: var(--pink); top: 15px; width: 20px; height: 20px; diff --git a/templates/base.html b/templates/base.html index 0fbfaf9..ac7708b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,28 +7,38 @@ - -