Status string

This commit is contained in:
novatorem
2020-08-25 19:21:33 -04:00
parent 0778b7adde
commit c6e722f62a
3 changed files with 26 additions and 1 deletions

View File

@@ -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)

View File

@@ -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 @@
}
</style>
<div class="currentStatus">Currently playing</div>
<div class="main">
<a class="art" href="{}" target="_BLANK">
<center>

View File

@@ -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 @@
</style>
<div class="main">
<div class="currentStatus">{{status}}</div>
<a class="art" href="{}" target="_BLANK">
<center>
<img src="data:image/png;base64, {{image}}" class="cover" />

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB