A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
1
import {$lang} from '../utils.js';2
import VButton from '../element/button.js';4
export default {5
props: ['title', 'description', 'actions'],6
components: {7
VButton8
},9
methods: {10
$lang,11
open(info) {12
const {title, description, actions} = info;13
this.title = title;14
this.description = description;15
this.actions = actions;16
this.$refs.dialog.show();17
},18
close() {19
this.title = null;20
this.description = null;21
this.actions = null;22
this.$refs.dialog.close();23
}24
},25
mounted() {26
this.close();27
},28
template: `29
<dialog ref="dialog" class="z-40 fixed w-full h-full bg-black/80">30
<div class="flex flex-col fixed left-[50%] top-[50%] -translate-y-[50%] -translate-x-[50%] rounded-md bg-zinc-900 w-[500px] p-8">31
<h3 class="text-white text-[24px] font-bold pb-4">{{title}}</h3>32
<p class="text-md text-gray-400">{{description}}</p>33
<v-button34
v-for="action in actions"35
:icon="action.icon"36
:title="action.title"37
class="self-end"38
@click="action.handle"39
></v-button>40
</div>41
</dialog>42
`43
}
1
import {http} from './utils.js';1
import {http, $lang} from './utils.js';2
import VMenu from './component/menu.js';3
import VPlayer from './component/player.js';4
import VPopup from './component/popup.js';5
import VSearch from './page/search.js';6
import VFavorites from './page/favorites.js';7
import VAccount from './page/account.js';
29
VSearch,30
VFavorites,31
VAccount,31
VPlayer32
VPlayer,33
VPopup34
},35
mounted() {36
document.body.style.display = '';
49
}50
},51
updated() {50
// TODO: show update popup52
this.$refs.popup.open({53
title: $lang('global.update'),54
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.',55
actions: [56
{57
title: $lang('global.continue'),58
icon: 'arrow-right',59
handle: () => window.location.reload()60
}61
]62
});63
},64
onScroll() {65
if(state.tab === 'search') {
78
<v-search ref="search" :state="state"></v-search>79
<v-favorites ref="favorites" :state="state"></v-favorites>80
<v-account :state="state"></v-account>81
<v-popup ref="popup"></v-popup>82
</div>83
`84
});
35
<li36
:key="station.id"37
v-for="station in results"38
class="border-t sm:border-t-2 first:border-none border-zinc-900 py-5 first:pt-0"38
class="border-t sm:border-t-2 first:border-none border-zinc-900 py-4 first:pt-0"39
>40
<v-station :station="station"></v-station>41
</li>
134
<li135
:key="station.id"136
v-for="station in recommended"137
class="border-t sm:border-t-2 first:border-none border-zinc-900 py-5 first:pt-0"137
class="border-t sm:border-t-2 first:border-none border-zinc-900 py-4 first:pt-0"138
>139
<v-station :station="station"></v-station>140
</li>
16
"global.languages": "Languages",17
"global.state": "State",18
"global.playback-history": "Playback History",19
"global.update": "Update installed",20
"global.continue": "Continue",21
"player.loading": "Loading...",22
"player.no-song-title": "- No song title available -",23
"search.input.placeholder": "Search for stations",
51
"global.languages": "Sprachen",52
"global.state": "Bundesland",53
"global.playback-history": "Wiedergabeverlauf",54
"global.update": "Update wurde installiert",55
"global.continue": "Fortfahren",56
"player.loading": "Laden...",57
"player.no-song-title": "- Song Titel nicht verfügbar -",58
"search.input.placeholder": "Suche nach Sender",