From c6e722f62a0b34655a4b4fbead6b1697942946fd Mon Sep 17 00:00:00 2001 From: novatorem Date: Tue, 25 Aug 2020 19:21:33 -0400 Subject: [PATCH] Status string --- api/spotify.py | 3 +++ api/templates/preview.html | 13 ++++++++++++- api/templates/spotify.html.j2 | 11 +++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/api/spotify.py b/api/spotify.py index 616a4cc..f231a80 100644 --- a/api/spotify.py +++ b/api/spotify.py @@ -79,12 +79,14 @@ def makeSVG(data): if data == {}: #contentBar = "" #Shows/Hides the EQ bar if no song is currently playing + currentStatus = "Last seen playing:" recentPlays = recentlyPlayed() recentPlaysLength = len(recentPlays["items"]) itemIndex = random.randint(0, recentPlaysLength - 1) item = recentPlays["items"][itemIndex]["track"] else: item = data["item"] + currentStatus = "Vibing to:" image = loadImageB64(item["album"]["images"][1]["url"]) artistName = item["artists"][0]["name"].replace("&", "&") @@ -96,6 +98,7 @@ def makeSVG(data): "artistName": artistName, "songName": songName, "image": image, + "status": currentStatus } return render_template("spotify.html.j2", **dataDict) diff --git a/api/templates/preview.html b/api/templates/preview.html index faec3cb..22bc044 100644 --- a/api/templates/preview.html +++ b/api/templates/preview.html @@ -5,16 +5,25 @@ } .main { + margin-top: 40px; display: flex; width: 480px; height: 133px; } + .currentStatus { + position: static; + float: left; + font-size: 24px; + margin-top: -5px; + margin-left: 10px; + } + .container { border-radius: 5px; padding: 10px 10px 10px 0px; } - + .art { float: left; width: 27%; @@ -78,6 +87,8 @@ } +
Currently playing
+
diff --git a/api/templates/spotify.html.j2 b/api/templates/spotify.html.j2 index 154f2b1..88b7cd3 100644 --- a/api/templates/spotify.html.j2 +++ b/api/templates/spotify.html.j2 @@ -7,9 +7,18 @@ } .main { + margin-top: 40px; display: flex; } + .currentStatus { + position: static; + float: left; + font-size: 24px; + margin-top: -5px; + margin-left: 10px; + } + .container { border-radius: 5px; padding: 10px 10px 10px 0px; @@ -82,6 +91,8 @@