so://phie

verbal

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

blob: 5dae68e3d6b692b7e11a7bfa7ea06caa42372bd8 (3566 bytes)[doc][blame][raw]

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

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

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

4

5export default {

6 props: ['station'],

7 components: {

8 VButton,

9 VIcon

10 },

11 methods: {

12 $lang

13 },

14 template: `

15 <div class="w-full gap-4 group flex items-center">

16 <div class="w-[54px] h-[54px] min-w-[54px] bg-zinc-900 rounded-lg overflow-hidden">

17 <img

18 v-if="station.favicon"

19 :alt="station.name"

20 :src="station.favicon"

21 @error="() => station.favicon = null"

22 class="w-full h-full object-contain"

23 >

24 <v-icon

25 v-else

26 id="access-point"

27 size="65%"

28 class="bg-gray-400"

29 ></v-icon>

30 </div>

31 <div class="flex flex-col flex-1 min-w-0">

32 <p class="text-lg font-medium text-gray-100 pb-0 overflow-hidden text-ellipsis whitespace-nowrap">{{station.name}}</p>

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

34 <span

35 v-if="station.country"

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

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

38 >

39 <v-icon

40 id="world"

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

42 size="100%"

43 ></v-icon>

44 <p>{{station.country}}</p>

45 </span>

46 <span

47 v-if="station.votes"

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

49 :title="$lang('global.votes')"

50 >

51 <v-icon

52 id="thumb-up"

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

54 size="100%"

55 ></v-icon>

56 <p>{{station.votes}}</p>

57 </span>

58 <span

59 v-if="station.click_trend"

60 class="text-gray-400 hidden sm:inline-flex items-center gap-[5px]"

61 :title="$lang('global.trend')"

62 >

63 <v-icon

64 :id="[ station.click_trend >= 0 ? 'arrow-up-right' : 'arrow-down-right' ]"

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

66 ></v-icon>

67 <p>{{Math.abs(station.click_trend) ?? 'None'}}</p>

68 </span>

69 </span>

70 </div>

71 <div class="inline-flex gap-3 sm:gap-4">

72 <v-button

73 :icon="[ station.is_favorite ? 'heart-solid' : 'heart' ]"

74 :title="[ $lang(station.is_favorite ? 'global.unlike' : 'global.like') ]"

75 :active="station.is_favorite"

76 class="bg-zinc-900 hover:bg-white"

77 ></v-button>

78 <v-button

79 icon="player-play"

80 class="bg-zinc-900 hover:bg-white"

81 :title="$lang('global.play')"

82 ></v-button>

83 </div>

84 </div>

85 `

86}