d4223a9ef7
This fixes #28. Since we only use a single FontAwesome, I decided to just use the SVG (which FontAwesome considers the code comment within appropriate attribution). I further decided "screw it, let's inline it", because it avoids unnecessary complexity, and we can always punt it out to another file later if we need to. Co-authored-by: Jacob Weisz <inbox@jacobweisz.com> Reviewed-on: https://git.mills.io/prologic/tube/pulls/30 Co-authored-by: Jacob Weisz <ocdtrekkie@noreply@mills.io> Co-committed-by: Jacob Weisz <ocdtrekkie@noreply@mills.io>
60 lines
4.8 KiB
HTML
60 lines
4.8 KiB
HTML
{{ define "content" }}
|
|
{{ $playing := .Playing }}
|
|
<div id="player">
|
|
<div class="topnav" id="myTopnav">
|
|
<a href="javascript:void(0);" class="icon" onclick="myFunction()">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" style="fill: #f2f2f2; height: 14px;"><!-- Font Awesome Pro 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M512.1 191l-8.2 14.3c-3 5.3-9.4 7.5-15.1 5.4-11.8-4.4-22.6-10.7-32.1-18.6-4.6-3.8-5.8-10.5-2.8-15.7l8.2-14.3c-6.9-8-12.3-17.3-15.9-27.4h-16.5c-6 0-11.2-4.3-12.2-10.3-2-12-2.1-24.6 0-37.1 1-6 6.2-10.4 12.2-10.4h16.5c3.6-10.1 9-19.4 15.9-27.4l-8.2-14.3c-3-5.2-1.9-11.9 2.8-15.7 9.5-7.9 20.4-14.2 32.1-18.6 5.7-2.1 12.1.1 15.1 5.4l8.2 14.3c10.5-1.9 21.2-1.9 31.7 0L552 6.3c3-5.3 9.4-7.5 15.1-5.4 11.8 4.4 22.6 10.7 32.1 18.6 4.6 3.8 5.8 10.5 2.8 15.7l-8.2 14.3c6.9 8 12.3 17.3 15.9 27.4h16.5c6 0 11.2 4.3 12.2 10.3 2 12 2.1 24.6 0 37.1-1 6-6.2 10.4-12.2 10.4h-16.5c-3.6 10.1-9 19.4-15.9 27.4l8.2 14.3c3 5.2 1.9 11.9-2.8 15.7-9.5 7.9-20.4 14.2-32.1 18.6-5.7 2.1-12.1-.1-15.1-5.4l-8.2-14.3c-10.4 1.9-21.2 1.9-31.7 0zm-10.5-58.8c38.5 29.6 82.4-14.3 52.8-52.8-38.5-29.7-82.4 14.3-52.8 52.8zM386.3 286.1l33.7 16.8c10.1 5.8 14.5 18.1 10.5 29.1-8.9 24.2-26.4 46.4-42.6 65.8-7.4 8.9-20.2 11.1-30.3 5.3l-29.1-16.8c-16 13.7-34.6 24.6-54.9 31.7v33.6c0 11.6-8.3 21.6-19.7 23.6-24.6 4.2-50.4 4.4-75.9 0-11.5-2-20-11.9-20-23.6V418c-20.3-7.2-38.9-18-54.9-31.7L74 403c-10 5.8-22.9 3.6-30.3-5.3-16.2-19.4-33.3-41.6-42.2-65.7-4-10.9.4-23.2 10.5-29.1l33.3-16.8c-3.9-20.9-3.9-42.4 0-63.4L12 205.8c-10.1-5.8-14.6-18.1-10.5-29 8.9-24.2 26-46.4 42.2-65.8 7.4-8.9 20.2-11.1 30.3-5.3l29.1 16.8c16-13.7 34.6-24.6 54.9-31.7V57.1c0-11.5 8.2-21.5 19.6-23.5 24.6-4.2 50.5-4.4 76-.1 11.5 2 20 11.9 20 23.6v33.6c20.3 7.2 38.9 18 54.9 31.7l29.1-16.8c10-5.8 22.9-3.6 30.3 5.3 16.2 19.4 33.2 41.6 42.1 65.8 4 10.9.1 23.2-10 29.1l-33.7 16.8c3.9 21 3.9 42.5 0 63.5zm-117.6 21.1c59.2-77-28.7-164.9-105.7-105.7-59.2 77 28.7 164.9 105.7 105.7zm243.4 182.7l-8.2 14.3c-3 5.3-9.4 7.5-15.1 5.4-11.8-4.4-22.6-10.7-32.1-18.6-4.6-3.8-5.8-10.5-2.8-15.7l8.2-14.3c-6.9-8-12.3-17.3-15.9-27.4h-16.5c-6 0-11.2-4.3-12.2-10.3-2-12-2.1-24.6 0-37.1 1-6 6.2-10.4 12.2-10.4h16.5c3.6-10.1 9-19.4 15.9-27.4l-8.2-14.3c-3-5.2-1.9-11.9 2.8-15.7 9.5-7.9 20.4-14.2 32.1-18.6 5.7-2.1 12.1.1 15.1 5.4l8.2 14.3c10.5-1.9 21.2-1.9 31.7 0l8.2-14.3c3-5.3 9.4-7.5 15.1-5.4 11.8 4.4 22.6 10.7 32.1 18.6 4.6 3.8 5.8 10.5 2.8 15.7l-8.2 14.3c6.9 8 12.3 17.3 15.9 27.4h16.5c6 0 11.2 4.3 12.2 10.3 2 12 2.1 24.6 0 37.1-1 6-6.2 10.4-12.2 10.4h-16.5c-3.6 10.1-9 19.4-15.9 27.4l8.2 14.3c3 5.2 1.9 11.9-2.8 15.7-9.5 7.9-20.4 14.2-32.1 18.6-5.7 2.1-12.1-.1-15.1-5.4l-8.2-14.3c-10.4 1.9-21.2 1.9-31.7 0zM501.6 431c38.5 29.6 82.4-14.3 52.8-52.8-38.5-29.6-82.4 14.3-52.8 52.8z"/></svg>
|
|
</a>
|
|
<a {{ if eq $.Quality "" }}class="active"{{ end }} href="/v/{{ $playing.ID }}">fullHD</a>
|
|
<a {{ if eq $.Quality "720p" }}class="active"{{ end }} href="/v/{{ $playing.ID }}?quality=720p">720p</a>
|
|
<a {{ if eq $.Quality "480p" }}class="active"{{ end }} href="/v/{{ $playing.ID }}?quality=480p">480p</a>
|
|
<a {{ if eq $.Quality "360p" }}class="active"{{ end }} href="/v/{{ $playing.ID }}?quality=360p">360p</a>
|
|
<a {{ if eq $.Quality "240p" }}class="active"{{ end }} href="/v/{{ $playing.ID }}?quality=240p">240p</a>
|
|
</div>
|
|
|
|
{{ if $playing.ID }}
|
|
<video id="video" controls preload="metadata" poster="/t/{{ $playing.ID}}">
|
|
<source src="/v/{{ $playing.ID }}.mp4?quality={{ $.Quality }}" type="video/mp4" />
|
|
</video>
|
|
<h1>{{ $playing.Title }}</h1>
|
|
<h2>{{ $playing.Views }} views • {{ $playing.Modified }} • {{ $playing.Size | bytes }}</h2>
|
|
<p>{{ $playing.Description }}</p>
|
|
{{ else }}
|
|
<video id="video" controls></video>
|
|
{{ end }}
|
|
</div>
|
|
<div id="playlist">
|
|
<div class="nav">
|
|
<ul>
|
|
<li><a {{ if or (eq $.Sort "timestamp") (eq $.Sort "") }}class="active"{{ end }} href="?sort=timestamp">Recent</a></li>
|
|
<li><a {{ if eq $.Sort "views" }}class="active"{{ end }} href="?sort=views">Views</a></li>
|
|
</ul>
|
|
</div>
|
|
{{ range $m := .Playlist }}
|
|
{{ if eq $m.ID $playing.ID }}
|
|
<a href="/v/{{ $m.ID }}?sort={{ $.Sort }}" class="playing">
|
|
{{ else }}
|
|
<a href="/v/{{ $m.ID }}?sort={{ $.Sort }}">
|
|
{{ end }}
|
|
<img src="/t/{{ $m.ID }}">
|
|
<div>
|
|
<h1>{{ $m.Title }}</h1>
|
|
<h2>{{ $m.Views }} views • {{ $m.Modified }}</h2>
|
|
</div>
|
|
</a>
|
|
{{ end }}
|
|
</div>
|
|
{{end}}
|
|
{{ define "scripts" }}
|
|
<script type="application/javascript">
|
|
/* Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon */
|
|
function myFunction() {
|
|
var x = document.getElementById("myTopnav");
|
|
if (x.className === "topnav") {
|
|
x.className += " responsive";
|
|
} else {
|
|
x.className = "topnav";
|
|
}
|
|
}
|
|
</script>
|
|
{{ end }}
|