A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
27
},28
template: `29
<div class="w-full gap-4 group flex items-center">30
<div class="w-[54px] h-[54px] min-w-[54px] bg-zinc-900 rounded-lg overflow-hidden">30
<div31
class="w-[54px] h-[54px] min-w-[54px] bg-zinc-900 rounded-lg overflow-hidden cursor-pointer"32
@click="() => setStation(station)"33
>34
<img35
v-if="station.icon"36
:alt="station.name"
45
class="text-gray-400"46
></v-icon>47
</div>45
<div class="flex flex-col flex-1 min-w-0">46
<p :title="station.name" class="text-lg font-medium text-gray-100 pb-0 overflow-hidden text-ellipsis whitespace-nowrap">{{station.name}}</p>48
<div class="flex flex-col flex-1 min-w-0 cursor-pointer">49
<p50
:title="station.name"51
class="text-lg font-medium text-gray-100 pb-0 overflow-hidden text-ellipsis whitespace-nowrap"52
>53
{{station.name}}54
</p>55
<span class="text-md text-gray-400 overflow-hidden flex gap-2 sm:gap-3">56
<span57
v-if="station.country"
98
@click="() => setLike(!station.is_favorite)"99
class="bg-zinc-900 hover:bg-white"100
></v-button>93
<v-button94
icon="player-play"95
class="bg-zinc-900 hover:bg-white"96
:title="$lang('global.play')"97
@click="() => setStation(station)"98
></v-button>101
</div>102
</div>103
`
41
state.account = await http`get::/api/account`();42
document.addEventListener('scroll', this.onScroll);43
document.addEventListener('wheel', this.onScroll);44
if('serviceWorker' in navigator) {45
navigator.serviceWorker.register('/worker.js');46
navigator.serviceWorker.addEventListener('controllerchange', this.updated);47
}48
},49
updated() {50
// TODO: show update popup51
},52
onScroll() {53
if(state.tab === 'search') {
39
/* serve content */40
app.at("/").serve_file("www/index.html")?;41
app.at("/manifest.json").serve_file("www/manifest.json")?;42
app.at("/worker.js").serve_file("www/worker.js")?;43
app.at("/asset").serve_dir("www/asset/")?;44
app.at("/app").serve_dir("app/")?;
9
::-webkit-scrollbar {10
background-color: black;11
width: 12px;11
width: 0px;12
}14
::-webkit-scrollbar-track {
1
{2
"en": {3
"global.none": "-",4
"global.search": "Search",5
"global.favorites": "Favorites",
16
"global.languages": "Languages",17
"global.state": "State",18
"global.playback-history": "Playback History",19
"player.loading": "Loading...",20
"player.no-song-title": "- No song title available -",21
"search.input.placeholder": "Search for stations",22
"search.list.end": "You've reached the end",23
"search.list.empty": "No results found",24
"account.settings": "Settings",25
"account.username": "Username",26
"account.username.info": "This is your primary account name which is visible to everyone",
30
"account.playback-history": "Show Playback History",31
"account.playback-history.info": "Displays the recently played songs for the current station",32
"account.devices": "Devices"33
},34
"de": {35
"global.none": "-",36
"global.search": "Suche",37
"global.favorites": "Favoriten",
48
"global.languages": "Sprachen",49
"global.state": "Bundesland",50
"global.playback-history": "Wiedergabeverlauf",51
"player.loading": "Laden...",52
"player.no-song-title": "- Song Titel nicht verfügbar -",53
"search.input.placeholder": "Suche nach Sender",54
"search.list.end": "Du hast das Ende erreicht",55
"search.list.empty": "Keine Ergebnisse gefunden",56
"account.settings": "Einstellungen",57
"account.username": "Nutzername",58
"account.username.info": "Dies ist Ihr primärer Kontoname, der von allen gesehen werden kann",
62
"account.playback-history": "Wiedergabeverlauf anzeigen",63
"account.playback-history.info": "Zeigt die zuletzt gespielten Songs für den aktuellen Sender an",64
"account.devices": "Geräte"65
}66
}
8
<meta name="google" content="notranslate">9
<meta name="description" content="Online Radio App">10
<title>Verbal</title>11
<link rel="manifest" href="/manifest.json">12
<link rel="icon" type="image/png" href="/asset/img/favicon.png">13
<link rel="stylesheet" href="/asset/css/style.css">14
<link rel="stylesheet" href="/asset/css/output.css">
1
{2
"name": "Verbal",3
"short_name": "Verbal",4
"icons": [5
{6
"src": "/asset/img/icon-192x192.png",7
"sizes": "192x192",8
"type": "image/png"9
},10
{11
"src": "/asset/img/icon-512x512.png",12
"sizes": "512x512",13
"type": "image/png"14
}15
],16
"id": "/",17
"start_url": "/",18
"scope": "/",19
"theme_color": "#000000",20
"background_color": "#000000",21
"display": "standalone"22
}
1
const VERSION = '0.0.1';3
self.addEventListener('install', self.skipWaiting);5
self.addEventListener('activate', (event) => {6
event.waitUntil(caches.keys().then((keys) => {7
return Promise.all(keys.map((key) => {8
if(key === VERSION) return;9
return caches.delete(key);10
}));11
}));12
});14
self.addEventListener('fetch', (event) => {15
event.respondWith((async () => {16
const file = await caches.match(event.request);17
if(file) return file;18
const response = await fetch(event.request);19
if(!event.request.url.includes('/api')) {20
const cache = await caches.open(VERSION);21
cache.put(event.request, response.clone());22
}23
return response;24
})());25
});