so://phie

verbal

A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal

blob: d02c13369c8c0651d037296a634e095e9e4eeecb (1283 bytes)[doc][blame][raw]

1import {http} from './utils.js';

2import VMenu from './component/menu.js';

3import VSearch from './page/search.js';

4import VFavorites from './page/favorites.js';

5import VAccount from './page/account.js';

6

7export const state = {

8 app: null,

9 tab: 'search',

10 account: {

11 username: '',

12 language: 'en'

13 },

14 station: null

15};

16

17(async () => {

18 state.locale = await http`get::/asset/json/locale.json`();

19

20 new Vue({

21 el: '#app',

22 data: {

23 state

24 },

25 components: {

26 VMenu,

27 VSearch,

28 VFavorites,

29 VAccount

30 },

31 mounted() {

32 document.body.style.display = '';

33 state.app = this;

34 this.init();

35 },

36 methods: {

37 async init() {

38 state.account = await http`get::/api/account`();

39 }

40 },

41 template: `

42 <div class="px-4 sm:px-10 pb-8 sm:pb-[100px] max-w-[800px] mx-auto flex flex-col">

43 <v-menu :state="state"></v-menu>

44 <v-search :state="state"></v-search>

45 <v-favorites ref="favorites" :state="state"></v-favorites>

46 <v-account :state="state"></v-account>

47 </div>

48 `

49 });

50})();