PastFm-Backend / templates /default_theme.html
arpy8's picture
feat: add user and color parameters to live banner and update template styling
ec98a06
Raw History Blame Contribute Delete
2.56 kB
<svg
width="320"
height="435"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-labelledby="cardTitle"
role="img"
>
<title id="cardTitle">LastFm Card</title>
<foreignObject width="320" height="435">
<style>
div {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
}
.container {
background-color: #000000;
border-radius: 10px;
padding: 10px 10px
}
.playing {
display: flex;
justify-content: center;
align-items: center;
color: #{{color|safe}};
font-weight: bold;
text-align: center;
margin-bottom: 8px;
}
.not-play {
color: #{{color|safe}};
text-align: center;
margin-bottom: 0;
}
.artist {
color: #fff;
font-weight: bold;
font-size: 20px;
text-align: center;
margin-bottom: 5px;
}
.song {
color: #b3b3b3;
font-size: 16px;
text-align: center;
margin-bottom: 22px;
}
.logo {
margin-left: 5px;
}
.cover {
border-radius: 5px;
}
#bars {
height: 30px;
margin: -29px 0 0 0px;
position: absolute;
width: 40px;
}
.bar {
background: #{{color|safe}};
bottom: 1px;
height: 3px;
position: absolute;
width: 3px;
animation: sound 0ms -800ms linear infinite alternate;
}
@keyframes sound {
0% {
opacity: .35;
height: 3px;
}
100% {
opacity: 1;
height: 22px;
}
}
{{css_bar|safe}}
</style>
<div xmlns="http://www.w3.org/1999/xhtml" class="container">
{% if song_name %}
<div class="playing">
{{title_text|safe}}
</div>
<div class="artist">{{song_name|safe}}</div>
<div class="song">{{artist_name|safe}}</div>
<div id="bars">{{content_bar|safe}}</div>
{% if cover_image %}
<a href="{{url}}" target="_BLANK">
<center>
<img
src="data:image/png;base64, {{thumbnail|safe}}"
width="300"
height="300"
class="cover"
/>
</center>
</a>
{% endif %} {% else %}
<div class="playing not-play">Nothing playing on Youtube Music</div>
{% endif %}
</div>
</foreignObject>
</svg>