From e5c3a01a719808d8b40ff3746f22ba387d7c96ca Mon Sep 17 00:00:00 2001 From: novatorem Date: Sun, 19 Jul 2020 21:44:38 -0400 Subject: [PATCH] Restyled --- api/spotify-playing.py | 3 +- api/templates/preview.html | 106 ++++++++++++++++++++++++++++++++++ api/templates/spotify.html.j2 | 64 ++++++++++++-------- 3 files changed, 146 insertions(+), 27 deletions(-) create mode 100644 api/templates/preview.html diff --git a/api/spotify-playing.py b/api/spotify-playing.py index 57ce848..b6811f2 100644 --- a/api/spotify-playing.py +++ b/api/spotify-playing.py @@ -42,7 +42,6 @@ def refresh_token(): response = requests.post(SPOTIFY_URL_REFRESH_TOKEN, data=data, headers=headers) repsonse_json = response.json() - print(repsonse_json) return repsonse_json["access_token"] @@ -106,7 +105,7 @@ def make_svg(data): if data == {}: # Get recently play - title_text = "Currently playing" + title_text = "Last listening to" content_bar = "" recent_plays = get_recently_play() diff --git a/api/templates/preview.html b/api/templates/preview.html new file mode 100644 index 0000000..fdb35fc --- /dev/null +++ b/api/templates/preview.html @@ -0,0 +1,106 @@ +
+ +
+ +
+ +
+
+ +
+
Artist
+
Song
+
+
+
+ + +
\ No newline at end of file diff --git a/api/templates/spotify.html.j2 b/api/templates/spotify.html.j2 index 789500e..9ca473b 100644 --- a/api/templates/spotify.html.j2 +++ b/api/templates/spotify.html.j2 @@ -6,6 +6,15 @@ font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji; } + .main { + display: flex; + } + + .art { + float: left; + width: 33.33%; + } + .container { background-color: #121212; border-radius: 10px; @@ -27,17 +36,17 @@ .artist { font-weight: bold; - font-size: 20px; + font-size: 24px; color: #fff; - text-align: center; + text-align: left; margin-top: 5px; } .song { - font-size: 16px; + font-size: 20px; color: #b3b3b3; - text-align: center; - margin-top: 5px; + text-align: left; + margin-top: 15px; margin-bottom: 15px; } @@ -66,7 +75,7 @@ width: 3px; animation: sound 0ms -800ms linear infinite alternate; } - + @keyframes sound { 0% { opacity: .35; @@ -84,26 +93,31 @@ {% if song_name %} -
- - {{title_text}} on - -
-
{{artist_name}}
-
{{song_name}}
-
- {{content_bar|safe}} +
+ +
+ +
+
+ +
+
+ + {{title_text}} on + +
+
{{artist_name}}
+
{{song_name}}
+
+ {{content_bar|safe}} +
+
+ + {% else %} +
Nothing playing on Spotify
+ {% endif %}
- -
- -
-
- - {% else %} -
Nothing playing on Spotify
- {% endif %}