arimelody.me/views/music-gateway.html
ari melody cba791deba MORE REFACTORING!! + some improvements
Signed-off-by: ari melody <ari@arimelody.me>
2024-08-31 01:52:35 +01:00

167 lines
6.8 KiB
HTML

{{define "head"}}
<title>{{.GetTitle}} - {{.PrintArtists true true}}</title>
<link rel="icon" type="image/png" href="{{.GetArtwork}}">
<meta name="description" content="Stream &quot;{{.GetTitle}}&quot; by {{.PrintArtists true true}} on all platforms!">
<meta name="author" content="{{.PrintArtists true true}}">
<meta name="keywords" content="{{.PrintArtists true false}}, music, {{.GetTitle}}, {{.GetID}}, {{.GetReleaseYear}}">
<meta property="og:url" content="https://arimelody.me/music/{{.GetID}}">
<meta property="og:type" content="website">
<meta property="og:locale" content="en_IE">
<meta property="og:site_name" content="ari melody music">
<meta property="og.Title" content="{{.GetTitle}} - {{.PrintArtists true true}}">
<meta property="og:description" content="Stream &quot;{{.GetTitle}}&quot; by {{.PrintArtists true true}} on all platforms!">
<meta property="og:image" content="https://arimelody.me{{.GetArtwork}}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@funniduck">
<meta name="twitter:creator" content="@funniduck">
<meta property="twitter:domain" content="arimelody.me">
<meta property="twitter:url" content="https://arimelody.me/music/{{.GetID}}">
<meta name="twitter.Title" content="{{.PrintArtists true true}} - {{.GetTitle}}">
<meta name="twitter:description" content="Stream &quot;{{.GetTitle}}&quot; by {{.PrintArtists true true}} on all platforms!">
<meta name="twitter:image" content="https://arimelody.me{{.GetArtwork}}">
<meta name="twitter:image:alt" content="Cover art for &quot;{{.GetTitle}}&quot;">
<link rel="stylesheet" href="/style/main.css">
<link rel="stylesheet" href="/style/music-gateway.css">
{{end}}
{{define "content"}}
<main>
<script type="module" src="/script/music-gateway.js"></script>
<div id="background" style="background-image: url({{.GetArtwork}})"></div>
<a href="/music" swap-url="/music" id="go-back" title="back to arimelody.me">&lt;</a>
<br><br>
<div id="music-container">
<div id="art-container">
<div class="tilt-topleft"></div>
<div class="tilt-top"></div>
<div class="tilt-topright"></div>
<div class="tilt-right"></div>
<div class="tilt-bottomright"></div>
<div class="tilt-bottom"></div>
<div class="tilt-bottomleft"></div>
<div class="tilt-left"></div>
<img id="artwork" src="{{.GetArtwork}}" alt="{{.GetTitle}} artwork" width=240 height=240>
</div>
<div id="vertical-line"></div>
<div id="info">
<div id="overview">
<div id="title-container">
<h1 id="title">{{.GetTitle}}</h1>
<span id="year" title="{{.PrintReleaseDate}}">{{.GetReleaseYear}}</span>
</div>
<p id="artist">{{.PrintArtists true true}}</p>
<p id="type" class="{{.GetType}}">{{.GetType}}</p>
<ul id="links">
{{if .GetBuyLink}}
<li>
<a href="{{.GetBuyLink}}" class="buy">{{or .GetBuyName "buy"}}</a>
</li>
{{end}}
{{range .GetLinks}}
<li>
<a class="{{.NormaliseName}}" href="{{.GetURL}}">{{.GetName}}</a>
</li>
{{end}}
</ul>
{{if .GetDescription}}
<p id="description">
{{.GetDescription}}
</p>
{{end}}
<button id="share">share</button>
</div>
{{if .GetCredits}}
<div id="credits">
<h2>credits:</h2>
<ul>
{{range .GetCredits}}
{{$Artist := .GetArtist}}
{{if $Artist.GetWebsite}}
<li><strong><a href="{{$Artist.GetWebsite}}">{{$Artist.GetName}}</a></strong>: {{.GetRole}}</li>
{{else}}
<li><strong>{{$Artist.GetName}}</strong>: {{.GetRole}}</li>
{{end}}
{{end}}
</ul>
</div>
{{end}}
{{if .IsSingle}}
{{$Track := index .GetTracks 0}}
{{if $Track.GetLyrics}}
<div id="lyrics">
<h2>lyrics:</h2>
<p>{{$Track.GetLyrics}}</p>
</div>
{{end}}
{{else}}
<div id="tracks">
<h2>tracks:</h2>
{{range $i, $track := .GetTracks}}
<details>
<summary class="album-track-title">{{$track.GetNumber}}. {{$track.GetTitle}}</summary>
{{$track.GetLyrics}}
</details>
{{end}}
</div>
{{end}}
</div>
<div id="extras">
<ul>
<li><a href="#overview">overview</a></li>
{{if .GetCredits}}
<li><a href="#credits">credits</a></li>
{{end}}
{{if .IsSingle}}
{{$Track := index .GetTracks 0}}
{{if $Track.GetLyrics}}
<li><a href="#lyrics">lyrics</a></li>
{{end}}
{{else}}
<li><a href="#tracks">tracks</a></li>
{{end}}
</ul>
</div>
<!-- <div id="tracks"> -->
<!-- <% var file = `/audio/preview/${data.id}.webm` %> -->
<!-- <% if (data.tracks && typeof(data.tracks) == typeof([])) { %> -->
<!-- <% for( let i = 0; i < data.tracks.length; i++ ) { %> -->
<!-- <% -->
<!-- songid = data.tracks[i].title.toLowerCase().replace(/[^a-z0-9]/g, ""); -->
<!-- file = `/audio/preview/${data.id}-${songid}.webm`; -->
<!-- %> -->
<!---->
<!-- <div class="track-preview" id="preview-<%= songid %>"> -->
<!-- <i class="fa-solid fa-play play"></i> -->
<!-- <p><%= data.tracks[i].title %></p> -->
<!-- <audio src="<%= file %>"></audio> -->
<!-- </div> -->
<!---->
<!-- <% } %> -->
<!-- <% } else { %> -->
<!-- <div class="track-preview" id="preview-<%= data.id %>"> -->
<!-- <i class="fa-solid fa-play play"></i> -->
<!-- <p>{{.GetTitle}}</p> -->
<!-- <audio src="<%= file %>"></audio> -->
<!-- </div> -->
<!-- <% } %> -->
<!-- </div> -->
</div>
</main>
{{end}}