File size: 2,555 Bytes
a5559af
 
2ef59b2
a5559af
 
 
 
 
ec98a06
2ef59b2
a5559af
 
 
 
 
 
2ef59b2
a5559af
 
 
 
 
 
 
 
 
 
ec98a06
a5559af
 
 
 
 
 
 
ec98a06
a5559af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ec98a06
a5559af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ec98a06
a5559af
b1fe825
 
a5559af
 
 
 
 
 
2ef59b2
a5559af
 
 
 
 
 
 
 
 
 
 
 
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
<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>