1
0
dwelling-radio/web/templates/index.pug

73 lines
3.7 KiB
Plaintext

:go:func Index(mainSite string, songsNum int, status *radio.IcecastStatus, songs *[]radio.Song, r *http.Request)
:go:import "dwelling-radio/internal/radio"
:go:import "dwelling-radio/pkg/utils"
doctype html
html(lang='en')
head
title Arav's dwelling / Radio
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
meta(name='theme-color' content='#cd2682')
meta(name='description' content='Internet-radio broadcasting from under my desk.')
link(rel='icon' href='/assets/img/favicon.svg' sizes='any' type='image/svg+xml')
link(href='/assets/css/main.css' rel='stylesheet')
script(src='/assets/js/main.js' defer='')
body
header
svg#logo(viewBox='0 -25 216 40')
text.logo Arav's dwelling
text.under(y='11') Welcome to my sacred place, wanderer
nav
a(href=mainSite) Back to main website
h1 Radio
section#stopit
video(playsinline='' autoplay='' loop='')
source(src="/assets/img/stopit.mp4", type="video/mp4")
section
small.player-links
a(href='/filelist') filelist
a(href='/playlist') playlist (.m3u)
a(href='/live/stream.ogg') direct link
a(href='http://radio.arav.su:8000/stream.ogg') direct link (http)
a(href='http://wsmkgnmhmzqm7kyzv7jnzzafvgm7xlmlfvzhgorpapd5or2arnhuktqd.onion/live/stream.ogg') direct link (Tor)
a(href='http://radio.arav.i2p/live/stream.ogg') direct link (I2P)
a(href="https://dir.xiph.org/search?q=arav's+dwelling") Xiph
| OGG 128 Kb/s
div#radio
div.player
button#play
small#cur-time
div #[button#vol-down 🔈] #[input#volume(type="range", name="volume" min="0" max="100")] #[button#vol-up 🔊]
audio(preload='none' controls='' playsinline='')
source(src='http://radio.arav.home.arpa/stream.ogg' type='audio/ogg')
| Your browser doesn't support an audio element, it's sad... But you always can take the #[a(href='/playlist') playlist]!
div
if status.ServerStartDate != ""
p#radio-status On-air since
time(datetime=status.ServerStartISO8601)= status.ServerStartDate
else
p#radio-status Radio is offline.
p Now playing: #[span#radio-song #{status.SongName}]
p Current/peak listeners: #[span#radio-listeners #{status.Listeners}] / #[span#radio-listener-peak #{status.ListenerPeak}]
p
small Notice: information updates every 45 seconds. But you can #[button(id='btn-update') update] it forcibly.
section
h2 Last #{songsNum} songs
table#last-played
each song in *songs
tr
td= song.Time
if song.Listeners != "0"
td= song.Listeners
else
td
td= song.Song
- ml := radio.MostListened()
if ml.Song != ""
p.right Most listened song was "#{ml.Song}" on #{utils.ToClientTimezone(ml.Date, r).Format(radio.MostListenedDateFormat)} with #[b #{ml.Listeners}] listeners.
footer
| 2017—2023 Alexander "Arav" Andreev <#[a(href='mailto:me@arav.su') me@arav.su]> #[a(href=mainSite+'/privacy') Privacy statements]