mirror of
https://github.com/Alvin-Zilverstand/novatorem.git
synced 2026-03-06 13:24:56 +01:00
Add spotify link for song and artist
- Added Spotify link to song title - Added Spotify logo svg that takes the user to Spotify to listen to the currently playing song - Added Spotify link to song artist
This commit is contained in:
committed by
Andrew Novac
parent
a301a69078
commit
0bf396a69f
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#MacOS
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
.env
|
||||||
@@ -84,6 +84,7 @@ def barGen(barCount):
|
|||||||
left += 4
|
left += 4
|
||||||
return barCSS
|
return barCSS
|
||||||
|
|
||||||
|
|
||||||
def getTemplate():
|
def getTemplate():
|
||||||
try:
|
try:
|
||||||
file = open("api/templates.json", "r")
|
file = open("api/templates.json", "r")
|
||||||
@@ -122,12 +123,16 @@ def makeSVG(data):
|
|||||||
|
|
||||||
artistName = item["artists"][0]["name"].replace("&", "&")
|
artistName = item["artists"][0]["name"].replace("&", "&")
|
||||||
songName = item["name"].replace("&", "&")
|
songName = item["name"].replace("&", "&")
|
||||||
|
songURI = item["external_urls"]["spotify"]
|
||||||
|
artistURI = item["artists"][0]["external_urls"]["spotify"]
|
||||||
|
|
||||||
dataDict = {
|
dataDict = {
|
||||||
"contentBar": contentBar,
|
"contentBar": contentBar,
|
||||||
"barCSS": barCSS,
|
"barCSS": barCSS,
|
||||||
"artistName": artistName,
|
"artistName": artistName,
|
||||||
"songName": songName,
|
"songName": songName,
|
||||||
|
"songURI": songURI,
|
||||||
|
"artistURI": artistURI,
|
||||||
"image": image,
|
"image": image,
|
||||||
"status": currentStatus,
|
"status": currentStatus,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.song {
|
.song {
|
||||||
|
width: 300px;
|
||||||
color: #f7f7f7;
|
color: #f7f7f7;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
@@ -42,6 +43,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.artist {
|
.artist {
|
||||||
|
width: 300px;
|
||||||
color: #9f9f9f;
|
color: #9f9f9f;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
@@ -72,6 +74,18 @@
|
|||||||
animation: sound 0ms -800ms linear infinite alternate;
|
animation: sound 0ms -800ms linear infinite alternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.spotify-logo {
|
||||||
|
position: fixed;
|
||||||
|
right: 20px;
|
||||||
|
top: 10px;
|
||||||
|
width: 25px;
|
||||||
|
filter: invert(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
div {
|
div {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
||||||
}
|
}
|
||||||
@@ -101,9 +115,16 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<a href="{{songURI}}" target="_blank">
|
||||||
<div class="song">{{songName}}</div>
|
<div class="song">{{songName}}</div>
|
||||||
|
</a>
|
||||||
|
<a href="{{artistURI}}" target="_blank">
|
||||||
<div class="artist">{{artistName}}</div>
|
<div class="artist">{{artistName}}</div>
|
||||||
|
</a>
|
||||||
<div id="bars">{{contentBar|safe}}</div>
|
<div id="bars">{{contentBar|safe}}</div>
|
||||||
|
<a href="{{songURI}}" class="spotify-logo">
|
||||||
|
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Spotify</title><path d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"/></svg>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -31,6 +31,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.song {
|
.song {
|
||||||
|
width: 300px;
|
||||||
color: #666;
|
color: #666;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.artist {
|
.artist {
|
||||||
|
width: 300px;
|
||||||
color: #b3b3b3;
|
color: #b3b3b3;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
@@ -71,6 +73,17 @@
|
|||||||
animation: sound 0ms -800ms linear infinite alternate;
|
animation: sound 0ms -800ms linear infinite alternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.spotify-logo {
|
||||||
|
position: fixed;
|
||||||
|
right: 20px;
|
||||||
|
top: 10px;
|
||||||
|
width: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
div {
|
div {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
||||||
}
|
}
|
||||||
@@ -100,9 +113,16 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<a href="{{songURI}}" target="_blank">
|
||||||
<div class="song">{{songName}}</div>
|
<div class="song">{{songName}}</div>
|
||||||
|
</a>
|
||||||
|
<a href="{{artistURI}}" target="_blank">
|
||||||
<div class="artist">{{artistName}}</div>
|
<div class="artist">{{artistName}}</div>
|
||||||
|
</a>
|
||||||
<div id="bars">{{contentBar|safe}}</div>
|
<div id="bars">{{contentBar|safe}}</div>
|
||||||
|
<a href="{{songURI}}" class="spotify-logo">
|
||||||
|
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Spotify</title><path d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"/></svg>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 4.6 KiB |
Reference in New Issue
Block a user