so://phie

verbal

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

blob: 89e1375b96f2a2f89b31baf991f4dc520229ee48 (3928 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 py-5 gap-4 group flex items-center border-t sm:border-t-2 first:border-none border-zinc-900">

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

17 <img v-if="station.favicon" :alt="station.name" :src="station.favicon" v-on:error="doHideFavicon(station)" class="w-full h-full object-contain">

18 <div v-else class="w-full h-full bg-gray-400 [mask:url('https://cdn.typable.dev/tabler/access-point')]" style="-webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: 65%;"></div>

19 </div>

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

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

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

23 <span v-if="station.country" class="text-gray-400 inline-flex items-center gap-[5px]" v-bind:title="$('global.country')">

24 <div class="w-[18px] h-[18px] min-w-[18px] inline-flex bg-gray-400 [mask:url(https://cdn.typable.dev/tabler/world)]" style="-webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: 100%;"></div>

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

26 </span>

27 <span v-if="station.votes" class="text-gray-400 inline-flex items-center gap-[5px]" v-bind:title="$('global.votes')">

28 <div class="w-[18px] h-[18px] inline-flex bg-gray-400 [mask:url(https://cdn.typable.dev/tabler/thumb-up)]" style="-webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: 100%;"></div>

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

30 </span>

31 <span v-if="station.click_trend" class="text-gray-400 hidden sm:inline-flex items-center gap-[5px]" v-bind:title="$('global.trend')">

32 <div class="w-[16px] h-[16px] inline-flex bg-gray-400" v-bind:class="[ station.click_trend >= 0 ? '[mask:url(https://cdn.typable.dev/tabler/arrow-up-right)]' : '[mask:url(https://cdn.typable.dev/tabler/arrow-down-right)]' ]" style="-webkit-mask-repeat: no-repeat; -webkit-mask-position: center;"></div>

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

34 </span>

35 </span>

36 </div>

37 <div class="inline-flex gap-4">

38 <button v-on:click="doToggleFavorite(station, !station.is_favorite)" v-bind:title="[ station.is_favorite ? $('global.unlike') : $('global.like') ]" class="w-[46px] h-[46px] bg-zinc-900 hover:bg-white rounded-full inline-flex justify-center items-center cursor-pointer transition-colors">

39 <div class="w-full h-full bg-gray-400 hover:bg-red-600 transition-colors" v-bind:class="[ station.is_favorite ? '[mask:url(https://cdn.typable.dev/tabler/heart-solid)]' : '[mask:url(https://cdn.typable.dev/tabler/heart)]' ]" style="-webkit-mask-repeat: no-repeat; -webkit-mask-position: center;"></div>

40 </button>

41 <button v-on:click="doPlay(station)" v-bind:title="$('global.play')" class="w-[46px] h-[46px] bg-zinc-900 hover:bg-white rounded-full inline-flex justify-center items-center cursor-pointer transition-colors">

42 <div class="w-full h-full bg-gray-400 hover:bg-gray-700 transition-colors [mask:url('https://cdn.typable.dev/tabler/player-play')]" style="-webkit-mask-repeat: no-repeat; -webkit-mask-position: center;"></div>

43 </button>

44 </div>

45 </div>

46 `

47}