so://phie

verbal

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

blob: 9b27c261751d5986a5048125bca99e34ec1a92fc (2765 bytes)[doc][blame][raw]

1import {state} from '../main.js';

2import {$lang, http} from '../utils.js';

3import VButton from '../element/button.js';

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

5import VImage from '../element/image.js';

6

7export default {

8 props: ['station', 'type'],

9 components: {

10 VButton,

11 VIcon,

12 VImage

13 },

14 methods: {

15 $lang,

16 setStation(station) {

17 state.station = station;

18 state.app.$refs.player.open = true;

19 },

20 openDetail(station) {

21 state.app.$refs.detail.load(station.id);

22 }

23 },

24 template: `

25 <div>

26 <div v-if="type === undefined || type === 'list'" class="w-full gap-4 group flex items-center">

27 <v-image

28 :station="station"

29 @click="() => setStation(station)"

30 class="w-[54px] h-[54px] min-w-[54px] cursor-pointer"

31 ></v-image>

32 <div

33 class="flex flex-col flex-1 min-w-0 cursor-pointer"

34 @click="() => openDetail(station)"

35 >

36 <p

37 :title="station.name"

38 class="text-lg font-medium text-gray-100 pb-0 overflow-hidden text-ellipsis whitespace-nowrap"

39 >

40 {{station.name}}

41 </p>

42 <span class="text-md text-gray-400 overflow-hidden flex gap-2 sm:gap-3">

43 <span

44 v-if="station.country"

45 class="text-gray-400 inline-flex items-center gap-[5px]"

46 :title="$lang('global.country')"

47 >

48 <v-icon

49 id="map-pin"

50 class="w-[18px] h-[18px] !min-w-[18px] inline-flex text-gray-400"

51 size="100%"

52 ></v-icon>

53 <p>{{station.state ? station.state + ', ' : ''}}{{station.country}}</p>

54 </span>

55 </span>

56 </div>

57 </div>

58 <div v-if="type === 'grid'" class="flex flex-col gap-3 group w-[160px] min-w-[160px]">

59 <v-image

60 :station="station"

61 @click="() => openDetail(station)"

62 class="w-full aspect-square min-w-full cursor-pointer"

63 ></v-image>

64 <p

65 :title="station.name"

66 class="text-md font-medium text-gray-100 pb-0 w-full"

67 >

68 {{station.name}}

69 </p>

70 </div>

71 </div>

72 `

73}