A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
3
www/asset/font/4
www/asset/lib/5
dist/6
media/8
config.toml9
Cargo.lock
2
import {http, $lang} from '../utils.js';3
import VButton from '../element/button.js';4
import VIcon from '../element/icon.js';5
import VImage from '../element/image.js';7
export default {8
props: ['station'],
19
},20
components: {21
VButton,21
VIcon22
VIcon,23
VImage24
},25
watch: {26
station(value) {
30
this.loading = true;31
this.title = null;32
this.updateMediaSession();31
this.open = true;33
}34
},35
open(value) {
136
}137
if(Math.abs(diff.y) >= SWIPE_THRESHOLD) {138
if(Math.abs(diff.y) >= SWIPE_THRESHOLD) {138
if(!this.open && this.target === this.$refs.button) {139
if(!this.open && this.target === this.$refs.button?.$refs.image) {140
if(diff.y < 0 && angle >= -30 && angle <= 30) {141
this.open = true;142
}
199
></v-button>200
</div>201
<div class="flex gap-8 items-center flex-col">201
<div202
<v-image203
:station="station"204
ref="button"203
class="h-[75vw] max-h-[400px] aspect-square bg-zinc-900 rounded-lg overflow-hidden z-10 fixed right-[50%] translate-x-[50%] translate-y-[100%] bottom-[calc(100vh-98px)] transition-modal"205
class="h-[75vw] max-h-[400px] aspect-square rounded-lg z-10 fixed right-[50%] translate-x-[50%] translate-y-[100%] bottom-[calc(100vh-98px-32px)] transition-modal"206
:class="{ 'slide-active': !open, 'slide-hidden': !station }"207
@click="open = true"208
>207
<img208
v-if="station?.icon"209
:src="station.icon"210
:alt="station.name"211
class="w-full h-full object-contain select-none pointer-events-none"212
>213
<v-icon214
v-else215
id="access-point"216
size="38px"217
class="text-gray-400 pointer-events-none"218
></v-icon>219
</div>220
<div class="h-[75vw] max-h-[400px]"></div>209
</v-image>210
<div class="h-[75vw] max-h-[400px] mt-[32px]"></div>211
<div212
v-if="station"213
class="flex flex-col flex-1 z-10 min-w-0 w-[75vw] max-w-[400px] transition-modal"
234
min="0"235
max="1"236
step="0.05"247
@change="setVolume"237
@input="setVolume"238
class="w-[200px]"239
>240
</div>
2
import {$lang, http} from '../utils.js';3
import VButton from '../element/button.js';4
import VIcon from '../element/icon.js';5
import VImage from '../element/image.js';7
export default {8
props: ['station'],9
components: {10
VButton,10
VIcon11
VIcon,12
VImage13
},14
methods: {15
$lang,
25
},26
setStation(station) {27
state.station = station;28
state.app.$refs.player.open = true;29
}30
},31
template: `32
<div class="w-full gap-4 group flex items-center">30
<div31
class="w-[54px] h-[54px] min-w-[54px] bg-zinc-900 rounded-md overflow-hidden cursor-pointer"33
<v-image34
:station="station"35
@click="() => setStation(station)"33
>34
<img35
v-if="station.icon"36
:alt="station.name"37
:src="station.icon"38
@error="() => station.icon = null"39
class="w-full h-full object-contain"40
>41
<v-icon42
v-else43
id="access-point"44
size="32px"45
class="text-gray-400"46
></v-icon>47
</div>36
class="w-[54px] h-[54px] min-w-[54px] cursor-pointer"37
></v-image>38
<div class="flex flex-col flex-1 min-w-0 cursor-pointer">39
<p40
:title="station.name"
1
import VIcon from './icon.js';3
export default {4
props: ['station'],5
components: {6
VIcon,7
},8
methods: {9
getIcon(station) {10
return station.is_icon ? `/media/${station.id}.jpg` : station.icon;11
},12
},13
template: `14
<div15
ref="image"16
class="bg-zinc-900 rounded-md overflow-hidden"17
@click="$emit('click')"18
>19
<img20
v-if="station?.icon"21
:alt="station?.name"22
:src="getIcon(station)"23
@error="() => station.icon = null"24
class="w-full h-full object-contain select-none pointer-events-none"25
>26
<v-icon27
v-else28
id="access-point"29
size="32px"30
class="text-gray-400 select-none pointer-events-none"31
></v-icon>32
</div>33
`34
}
46
print "version" $VERSION48
DIST_DIR="dist"49
MEDIA_DIR="media"51
if [[ -d "$DIST_DIR" ]]; then52
section "CLEAN"
54
print "remove" "$DIST_DIR/"55
fi57
section "MEDIA"58
mkdir -p "$MEDIA_DIR"59
print "create" "$MEDIA_DIR/"61
if [[ "$MODE" == "dev" ]]; then62
section "LINK"63
print "create" "$DIST_DIR/"
22
is_restricted BOOLEAN DEFAULT false,23
is_broken BOOLEAN DEFAULT false,24
is_no_track_info BOOLEAN DEFAULT false,25
is_hidden BOOLEAN DEFAULT false25
is_hidden BOOLEAN DEFAULT false,26
is_icon BOOLEAN DEFAULT false27
);29
ALTER TABLE station_status
38
pub is_restricted: Option<bool>,39
pub is_broken: Option<bool>,40
pub is_no_track_info: Option<bool>,41
pub is_icon: Option<bool>,42
// pub is_hidden: Option<bool>,43
}
32
station_status.is_broken,33
station_status.is_no_track_info,34
station_status.is_hidden,35
station_status.is_icon,36
CASE37
WHEN favorite.id IS NULL OR favorite.account_id != {account_id}38
THEN false
109
station_status.is_broken,110
station_status.is_no_track_info,111
station_status.is_hidden,112
station_status.is_icon,113
true as is_favorite114
FROM station115
LEFT JOIN favorite
179
station_status.is_broken,180
station_status.is_no_track_info,181
station_status.is_hidden,182
station_status.is_icon,183
CASE184
WHEN favorite.id IS NULL OR favorite.account_id != {account_id}185
THEN false
42
.serve_file("dist/www/manifest.json")?;43
app.at("/worker.js").serve_file("dist/www/worker.js")?;44
app.at("/asset").serve_dir("dist/www/asset/")?;45
app.at("/media").serve_dir("media/")?;46
app.at("/app").serve_dir("dist/app/")?;48
/* handle prefetch */