so://phie

verbal

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

blob: c05b2c7196173ac794b1bf7b0a2806612a171f32 (1976 bytes)[doc][blame][raw]

1import {$lang} from '../utils.js';

2import VIcon from '../element/icon.js';

3import VPlayer from '../component/player.js';

4import VTab from '../component/tab.js';

5import VStation from '../component/station.js';

6

7export default {

8 props: ['state'],

9 data() {

10 return {

11 query: {

12 name: '',

13 page: 0

14 },

15 results: [],

16 loading: false,

17 more: false

18 };

19 },

20 components: {

21 VIcon,

22 VTab,

23 VPlayer,

24 VStation

25 },

26 methods: {

27 $lang

28 },

29 template: `

30 <v-tab id="search" :tab="state.tab">

31 <v-player :station="state.station"></v-player>

32 <input

33 v-model="query.name"

34 @keyup.enter="doSearch"

35 type="text"

36 :placeholder="$lang('search.input.placeholder')"

37 class="w-full h-[56px] px-5 text-lg rounded-lg bg-zinc-900 text-white font-medium placeholder:font-normal placeholder:text-gray-500 focus:placeholder:text-gray-600 outline-none"

38 >

39 <ul class="flex flex-col">

40 <li

41 :key="station.id"

42 v-for="station in results"

43 >

44 <v-station :station="station"></v-station>

45 </li>

46 </ul>

47 <div

48 v-show="loading"

49 class="w-[60px] h-[60px] select-none pointer-events-none mx-auto"

50 >

51 <v-icon

52 id="loader"

53 class="bg-gray-400 animate-spin"

54 style="animation-duration: 2s;"

55 size="80%"

56 ></v-icon>

57 </div>

58 <div

59 v-if="!more && results.length > 0"

60 class="text-zinc-400 text-md mx-auto pb-6"

61 >

62 {{$('search.list.end')}}

63 </div>

64 </v-tab>

65 `

66}