]> littlesong.place Git - littlesongplace.git/commitdiff
Minor visual tweaks
authorChris Fulljames <christianfulljames@gmail.com>
Sun, 23 Feb 2025 11:20:19 +0000 (06:20 -0500)
committerChris Fulljames <christianfulljames@gmail.com>
Sun, 23 Feb 2025 11:20:19 +0000 (06:20 -0500)
static/nav.js
static/styles.css
templates/index.html
templates/song-list.html

index 87715469291354d9f5b41350b0ee067972f5ce0f..78840dd337feae8b9f93b234a5036f59772c7dfa 100644 (file)
@@ -63,13 +63,14 @@ function urlIsOnSameSite(targetUrl) {
 
 async function handleAjaxResponse(response) {
     if (response.status != 200) {
+        // Got an error; redirect to the error page
         window.location.href = response.url;
     }
     // Update URL in browser window, minus request-type field
     var url = new URL(response.url);
     url.searchParams.delete("request-type");
 
-    // Get page content from XML response
+    // Get page content from response
     var text = await response.text();
     window.history.pushState(text, "", url);
 
index d8e46e0451c0315968b545349f091bbc38b0d16c..f9c02d140f051d20b8807d4fb3c181bf1c7d216b 100644 (file)
@@ -104,7 +104,6 @@ div.page-header {
 .profile-link {
     font-weight: bold;
     text-decoration: none;
-    /* color: var(--purple); */
 }
 
 .user-list {
@@ -113,21 +112,27 @@ div.page-header {
     gap: 10px;
 }
 
+.user-list-entry-container {
+    border-radius: 10px;
+    box-shadow: 0px 0px 5px 0px;
+}
+
 .user-list-entry {
+    box-sizing: border-box;
+    height: 100%;
     background: var(--yellow);
     border-radius: 10px;
-    box-shadow: 0px 0px 5px 0px;
-    height: 48px;
+    padding: 5px;
 
     display: flex;
     align-items: center;
     text-decoration: none;
+    gap: 5px;
 }
 
 .user-list-entry span {
-    line-height: 32px;
-    padding: 10px;
     font-weight: bold;
+    color: var(--purple);
 }
 
 /* Sliders (e.g. volume) */
@@ -219,10 +224,10 @@ input[type=file] {
 .small-pfp {
     max-width: 32px;
     max-height: 32px;
-    margin: 0px;
-    margin-left: 6px;
     border-radius: 5px;
     border: solid 2px var(--purple);
+    background-color: var(--purple);
+    vertical-align: middle;
 }
 
 .profile-bio {
@@ -317,7 +322,7 @@ div.song-info {
     gap: 10px;
     align-items: center;
     flex-grow: 1;
-    margin: 10px;
+    margin: 5px;
 }
 
 /* Artist on separate line for mobile */
@@ -353,6 +358,7 @@ div.song-buttons {
 .song-list-button img {
     image-rendering: pixelated;
     width: 32px;
+    vertical-align: middle;
 }
 
 div.song-details {
index 6a0875cec2d956bb6b2dd616f059c765f696626a..987f9223050befb3e68d18fe126f117f574f6419 100644 (file)
@@ -21,12 +21,14 @@ better, I'm open to any thoughts or feedback you have!  Just send me
 
 <div class="user-list">
     {% for user in users %}
-    <a href="/users/{{ user['username'] }}" class="user-list-entry" style="--yellow:{{ user['bgcolor'] }};--black:{{ user['fgcolor'] }};--purple:{{ user['accolor'] }};">
-        {% if user['has_pfp'] -%}
-        <img class="small-pfp" src="/pfp/{{ user['userid'] }}" />
-        {%- endif %}
-        <span>{{ user['username'] }}</span>
-    </a>
+    <div class="user-list-entry-container">
+        <a href="/users/{{ user['username'] }}" class="user-list-entry" style="--yellow:{{ user['bgcolor'] }};--black:{{ user['fgcolor'] }};--purple:{{ user['accolor'] }};">
+            {% if user['has_pfp'] -%}
+            <img class="small-pfp" src="/pfp/{{ user['userid'] }}" />
+            {%- endif %}
+            <span>{{ user['username'] }}</span>
+        </a>
+    </div>
     {% endfor %}
 </div>
 
index 1f53140db6bf8a2834900eae305f006f3c6d81e3..cca49298b8ba243340265be529c9f493c80f4e05 100644 (file)
@@ -2,12 +2,13 @@
 {% for song in songs %}
     <div class="song" data-song="{{ song.json() }}">
         <div class="song-main">
-            <!-- Profile Picture -->
-            {% if song.user_has_pfp -%}
-            <img class="small-pfp" src="/pfp/{{ song.userid }}" onerror="this.style.display = 'none'" />
-            {%- endif %}
-
             <div class="song-info">
+                {%- if song.user_has_pfp %}
+                <!-- Profile Picture -->
+                <img class="small-pfp" src="/pfp/{{ song.userid }}" onerror="this.style.display = 'none'" />
+                {%- else -%}
+                <div class="spacer"></div>
+                {%- endif %}
 
                 <!-- Song Title -->
                 <div class="song-title"><a href="/song/{{ song.userid }}/{{ song.songid }}?action=view">{{ song.title }}</a></div>