A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: 78d01f0ee9024c32994bf79baf228bf744d50320 (4454 bytes)[doc][blame][raw]
1
import {$lang} from '../utils.js';2
import VPlayer from '../component/player.js';3
import VTab from '../component/tab.js';5
export default {6
props: ['state'],7
components: {8
VTab,9
VPlayer10
},11
methods: {12
$lang13
},14
template: `15
<v-tab id="favorites" :tab="state.tab">16
<v-player :station="state.station"></v-player>17
<!--18
<ul v-if="account.info" class="flex flex-col">19
<li v-bind:key="station.id" v-for="station in account.favorites" class="w-full py-5 gap-4 group flex items-center border-t sm:border-t-2 first:border-none border-zinc-900">20
<div class="w-[54px] h-[54px] min-w-[54px] bg-zinc-900 rounded-lg overflow-hidden">21
<img v-if="station.favicon" v-bind:src="station.favicon" v-on:error="doHideFavicon(station)" class="w-full h-full object-contain">22
<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>23
</div>24
<div class="flex flex-col flex-1 min-w-0">25
<p class="text-lg font-medium text-gray-100 pb-0 overflow-hidden text-ellipsis whitespace-nowrap">{{station.name}}</p>26
<span class="text-md text-gray-400 overflow-hidden flex gap-2 sm:gap-3">27
<span v-if="station.country" class="text-gray-400 inline-flex items-center gap-[5px]" v-bind:title="$('global.country')">28
<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>29
<p>{{station.country}}</p>30
</span>31
<span v-if="station.votes" class="text-gray-400 inline-flex items-center gap-[5px]" v-bind:title="$('global.votes')">32
<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>33
<p>{{station.votes}}</p>34
</span>35
<span v-if="station.click_trend" class="text-gray-400 hidden sm:inline-flex items-center gap-[5px]" v-bind:title="$('global.trend')">36
<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>37
<p>{{Math.abs(station.click_trend) ?? 'None'}}</p>38
</span>39
</span>40
</div>41
<div class="inline-flex gap-4">42
<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">43
<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>44
</button>45
<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">46
<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>47
</button>48
</div>49
</li>50
</ul>51
-->52
</v-tab>53
`54
}