-
Notifications
You must be signed in to change notification settings - Fork 611
/
spotify.novatorem.html.j2
176 lines (144 loc) · 3.74 KB
/
spotify.novatorem.html.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<svg width="320" height="{{height}}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="cardTitle" role="img">
<title id="cardTitle">Now playing on Spotify</title>
<foreignObject width="320" height="{{height}}">
<style>
div {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
}
.container {
display: flex;
align-items: center;
border-radius: 10px;
padding: 10px 10px
}
.cover-link {
height: 80px;
}
.cover {
border-radius: 3px;
margin-right: 10px;
}
.playing {
display: flex;
justify-content: center;
align-items: center;
color: #53b14f;
font-weight: bold;
text-align: center;
margin-bottom: 8px;
}
.not-play {
color: #ff1616;
text-align: center;
margin-bottom: 0;
}
.text-container {
align-self: flex-end;
width: 200px;
height: 70px;
}
.artist {
color: #434343;
font-weight: 500;
font-size: 16px;
text-align: center;
margin-bottom: 3px;
}
.song {
color: #999;
font-size: 15px;
text-align: center;
margin-bottom: 28px;
}
@media (prefers-color-scheme: light) {
.artist{
color: #434343;
}
.song{
color: #999;
}
}
@media (prefers-color-scheme: dark) {
.artist{
color: #b9b9b9;
}
.song{
color: #999;
}
}
.song-container {
overflow: hidden;
white-space: nowrap;
}
.song-container::before {
content: '\00a0';
}
.scrolling {
{# animation: marquee 8s linear infinite;
display: block;
min-width: 100%;
position: absolute;
left: 0;
top: 0;
white-space: nowrap; #}
animation: marquee 8s linear infinite;
display: inline-block;
padding-right: 20px;
}
@keyframes marquee {
from {
transform: translateX(0);
}
to {
transform: translateX(-100%);
}
}
#bars {
position: absolute;
height: 14px;
width: 200px;
overflow: hidden;
margin: -14px 0 0 0px;
}
.bar {
background: #{{bar_color|safe}};
bottom: 1px;
height: 3px;
position: absolute;
width: 2px;
animation: sound 0ms -800ms linear infinite alternate;
}
@keyframes sound {
0% {
opacity: .35;
height: 3px;
}
100% {
opacity: 1;
height: 14px;
}
}
{{css_bar|safe}}
</style>
<div xmlns="http://www.w3.org/1999/xhtml" class="container">
{% if song_name %}
{% if cover_image %}
<a href="{}" target="_BLANK" class="cover-link">
<img src="data:image/png;base64, {{img}}" width="80" height="80" class="cover" />
</a>
{% endif %}
<div class="text-container">
<div class="artist">{{artist_name}}</div>
<div class="song-container">
<div class="song scrolling">{{song_name}}</div>
<div class="song scrolling" aria-hidden="true">{{song_name}}</div>
<div class="song scrolling" aria-hidden="true">{{song_name}}</div>
</div>
<div id='bars'>{{content_bar|safe}}</div>
</div>
{% else %}
<div class="playing not-play">Nothing playing on Spotify</div>
{% endif %}
</div>
</foreignObject>
</svg>