From 368a462bc744d8e9084eacfaddeb9afcaf7f7133 Mon Sep 17 00:00:00 2001 From: Samuel Johnson Date: Mon, 24 Nov 2025 13:53:18 -0500 Subject: Add session management --- static/app.css | 45 +++++++++++++++++++++++++++++++++++++++++++-- static/music_player.js | 12 +++++++----- 2 files changed, 50 insertions(+), 7 deletions(-) (limited to 'static') diff --git a/static/app.css b/static/app.css index 0148d24..7b2d083 100644 --- a/static/app.css +++ b/static/app.css @@ -8,6 +8,7 @@ header { header > h1 { padding: 0.5rem; + font-size: 2rem; } header > nav { @@ -16,8 +17,27 @@ header > nav { margin-left: 2em; } -a { +.flex-between { + display: flex; + flex-direction: row; +} + +.spacer { + visibility: hidden; + flex-grow: 1; +} + +.nav_tag { margin: 0.5em; +} + +.right { + float: right; + margin: auto; + margin-right: 2em; +} + +a { color: inherit; position: relative; display: inline-block; @@ -50,7 +70,7 @@ a:hover::after { .pane { margin: auto; - padding: 4px 10px; + padding: 0.2em 0.5em; width: 75%; background-color: black; @@ -66,6 +86,7 @@ a:hover::after { flex-direction: row; justify-content: center; align-content: center; + margin: 2em; } .topline > p { @@ -74,6 +95,16 @@ a:hover::after { margin-left: 2em; } +@media only screen and (max-width: 768px) { + header > h1 { + font-size: 1em; + } + + .topline > p { + display: none; + } +} + .card { border-top: 1px solid #fff; @@ -126,6 +157,16 @@ a:hover::after { right: 0; } +.margin_2rem { + margin: 2rem; +} + +.login_form { + margin-top: 2rem; + margin-bottom: 2rem; + padding: 0.5rem; +} + .vert_align { display: inline-block; vertical-align: middle; diff --git a/static/music_player.js b/static/music_player.js index 8fe89c2..33063d1 100644 --- a/static/music_player.js +++ b/static/music_player.js @@ -45,7 +45,7 @@ function mpSeek () { audio.currentTime = goal; } -async function mpUpdate () { +async function mpInit () { clearInterval(tick); const trackSelector = document.getElementById("mp_tracks"); @@ -61,6 +61,10 @@ async function mpUpdate () { ppButton.innerHTML = "Play"; tick = setInterval(mpTick, 1000); +} + +async function mpUpdate () { + mpInit(); mpPpTrack(); } @@ -90,7 +94,6 @@ function mpNext () { } mpUpdate(); - mpPpTrack(); } function mpPrevious () { @@ -103,7 +106,6 @@ function mpPrevious () { } mpUpdate(); - mpPpTrack(); } const trackList = await mpFetchAsync("/audio"); @@ -113,7 +115,7 @@ trackList.forEach((track) => { let option = document.createElement("option"); option.text = track; - trackSelector.add(option, 0); + trackSelector.append(option) }); document.getElementById("mp_tracks").addEventListener("change", mpUpdate, false); @@ -122,4 +124,4 @@ document.getElementById("mp_pp_track").addEventListener("click", mpPpTrack, fals document.getElementById("mp_prev_track").addEventListener("click", mpPrevious, false); document.getElementById("mp_next_track").addEventListener("click", mpNext, false); -mpUpdate(); +mpInit(); -- cgit v1.2.3