mirror of
https://github.com/Alvin-Zilverstand/novatorem.git
synced 2026-03-06 11:07:09 +01:00
Status string
This commit is contained in:
@@ -79,12 +79,14 @@ def makeSVG(data):
|
|||||||
|
|
||||||
if data == {}:
|
if data == {}:
|
||||||
#contentBar = "" #Shows/Hides the EQ bar if no song is currently playing
|
#contentBar = "" #Shows/Hides the EQ bar if no song is currently playing
|
||||||
|
currentStatus = "Last seen playing:"
|
||||||
recentPlays = recentlyPlayed()
|
recentPlays = recentlyPlayed()
|
||||||
recentPlaysLength = len(recentPlays["items"])
|
recentPlaysLength = len(recentPlays["items"])
|
||||||
itemIndex = random.randint(0, recentPlaysLength - 1)
|
itemIndex = random.randint(0, recentPlaysLength - 1)
|
||||||
item = recentPlays["items"][itemIndex]["track"]
|
item = recentPlays["items"][itemIndex]["track"]
|
||||||
else:
|
else:
|
||||||
item = data["item"]
|
item = data["item"]
|
||||||
|
currentStatus = "Vibing to:"
|
||||||
|
|
||||||
image = loadImageB64(item["album"]["images"][1]["url"])
|
image = loadImageB64(item["album"]["images"][1]["url"])
|
||||||
artistName = item["artists"][0]["name"].replace("&", "&")
|
artistName = item["artists"][0]["name"].replace("&", "&")
|
||||||
@@ -96,6 +98,7 @@ def makeSVG(data):
|
|||||||
"artistName": artistName,
|
"artistName": artistName,
|
||||||
"songName": songName,
|
"songName": songName,
|
||||||
"image": image,
|
"image": image,
|
||||||
|
"status": currentStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
return render_template("spotify.html.j2", **dataDict)
|
return render_template("spotify.html.j2", **dataDict)
|
||||||
|
|||||||
@@ -5,11 +5,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
|
margin-top: 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 480px;
|
width: 480px;
|
||||||
height: 133px;
|
height: 133px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.currentStatus {
|
||||||
|
position: static;
|
||||||
|
float: left;
|
||||||
|
font-size: 24px;
|
||||||
|
margin-top: -5px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 10px 10px 10px 0px;
|
padding: 10px 10px 10px 0px;
|
||||||
@@ -78,6 +87,8 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<div class="currentStatus">Currently playing</div>
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<a class="art" href="{}" target="_BLANK">
|
<a class="art" href="{}" target="_BLANK">
|
||||||
<center>
|
<center>
|
||||||
|
|||||||
@@ -7,9 +7,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
|
margin-top: 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.currentStatus {
|
||||||
|
position: static;
|
||||||
|
float: left;
|
||||||
|
font-size: 24px;
|
||||||
|
margin-top: -5px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 10px 10px 10px 0px;
|
padding: 10px 10px 10px 0px;
|
||||||
@@ -82,6 +91,8 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
<div class="currentStatus">{{status}}</div>
|
||||||
|
|
||||||
<a class="art" href="{}" target="_BLANK">
|
<a class="art" href="{}" target="_BLANK">
|
||||||
<center>
|
<center>
|
||||||
<img src="data:image/png;base64, {{image}}" class="cover" />
|
<img src="data:image/png;base64, {{image}}" class="cover" />
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.3 KiB |
Reference in New Issue
Block a user