yellowcab/template/embed.tmpl

111 lines
2.7 KiB
Cheetah

<!DOCTYPE html>
<html lang="en">
<head>
<title>Embed for {{.Username}}</title>
{{ template "partials/head" }}
<link rel="stylesheet" href="/css/embed.css" />
{{if .Refresh}}
{{if ne .Refresh 0}}
<meta http-equiv="refresh" content="{{.Refresh}}" />
{{
end
}}
{{
end
}}
</head>
<body class="theme-{{.Theme}} {{if .Mini}} mini {{end}}">
<main>
{{if .Playing.Cover}}
<img class="bg-image" src="{{.Playing.Cover}}" alt="" />
<img class="cover" src="{{.Playing.Cover}}" alt="" />
{{else}}
<div class="cover">
<svg
class="disc"
version="1.0"
preserveAspectRatio="xMidYMid"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1000 1000"
>
<path
d="M0 0h1000v1000H0Z"
fill="currentColor"
paint-order="markers stroke fill"
/>
<path
class="disc-inside"
fill="currentColor"
d="M500 250a250 250 0 0 0-250 250 250 250 0 0 0 250 250 250 250 0 0 0 250-250 250 250 0 0 0-250-250Zm0 152.5a97.5 97.5 0 0 1 97.5 97.5 97.5 97.5 0 0 1-97.5 97.5 97.5 97.5 0 0 1-97.5-97.5 97.5 97.5 0 0 1 97.5-97.5Z"
paint-order="markers stroke fill"
/>
</svg>
</div>
{{ end }}
<div class="details-wrapper">
<div class="details">
{{if eq .Playing.EstTimestamp "live"}}
<div class="title {{if .Mini}} sr-only {{end}}">Listening to</div>
{{else}}
<div class="title {{if .Mini}} sr-only {{end}}">Listened {{.Playing.EstTimestamp}}</div>
{{ end }}
{{if .Playing.Track.StreamURL}}
<a
target="_blank"
href="{{.Playing.Track.StreamURL}}"
class="track-name"
>{{.Playing.Track.Name}}</a
>
{{else}}
<p class="track-name">{{.Playing.Track.Name}}</p>
{{ end }}
<p class="track-bylines">
{{if .Playing.Artist.URL}}
<a
target="_blank"
href="{{.Playing.Artist.URL}}"
class="track-artist"
>
{{.Playing.Artist.Name}}
</a>
{{else}}
<span
class="track-artist"
>{{.Playing.Artist.Name}}</span
>
{{ end }}
{{if .Playing.Album}}
{{if .Playing.Album.URL}}
<span class="track-album-wrapper"
>(<a
href="{{.Playing.Album.URL}}"
class="track-album"
>{{.Playing.Album.Name}}</a
>)</span
>
{{else}}
<span class="track-album-wrapper"
>(<span
class="track-album"
>{{.Playing.Album.Name}}</span
>)</span
>
{{ end }}
{{ end }}
</p>
</div>
{{ if eq .Playing.FromScrobbler.Name "Spotify" }}
<div class="disclosure">
<a
target="_blank"
href="{{.Playing.Track.StreamURL}}"
>
Listen on Spotify
</a>
</div>
{{ end }}
</div>
</main>
</body>
</html>