so://phie

verbal

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

blob: dd6f51b2e0745be528b01062024be0c5b930da38 (3556 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 data() {

8 return {

9 playing: false,

10 loading: false,

11 title: '- No song title available -',

12 locale: 'en'

13 };

14 },

15 components: {

16 VButton,

17 VIcon

18 },

19 methods: {

20 $lang

21 },

22 template: `

23 <div class="sticky top-[98px] z-30 -mb-6 sm:-mb-10">

24 <div

25 v-if="station"

26 class="flex flex-col bg-black pb-6"

27 >

28 <div class="p-5 bg-zinc-800 rounded-xl flex gap-5 items-center relative overflow-hidden shadow-2xl z-30">

29 <img

30 v-if="station.favicon"

31 :src="station.favicon"

32 :alt="station.name"

33 :class="{ 'animate-pulse': playing }"

34 class="w-full h-full object-cover absolute top-0 left-0 right-0 bottom-0 blur-2xl opacity-30 z-0 pointer-events-none select-none"

35 >

36 <div class="w-[64px] h-[64px] min-w-[64px] bg-zinc-900 rounded-lg overflow-hidden z-10">

37 <img

38 v-if="station.favicon"

39 :src="station.favicon"

40 :alt="station.name"

41 class="w-full h-full object-contain select-none"

42 >

43 <v-icon

44 v-else

45 id="access-point"

46 size="65%"

47 ></v-icon>

48 </div>

49 <div

50 class="flex flex-col flex-1 z-10 min-w-0 cursor-pointer"

51 >

52 <p class="text-xl font-semibold text-white pb-1 overflow-hidden text-ellipsis whitespace-nowrap select-none pointer-events-none">

53 {{station.name}}

54 </p>

55 <p class="text-md text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap select-none pointer-events-none">

56 {{title ?? $lang('player.loading')}}

57 </p>

58 </div>

59 <div class="inline-flex gap-4 z-10 pr-2">

60 <v-button

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

62 :title="$lang('global.favorites')"

63 :active="station.is_favorite"

64 class="bg-zinc-900 hover:bg-white focus:ring-[6px] ring-white/10"

65 @click="doToggleFavorite(station, !station.is_favorite)"

66 ></v-button>

67 <v-button

68 :icon="[ loading ? 'rotate-clockwise' : (playing ? 'player-pause' : 'player-play') ]"

69 :title="[ playing ? $lang('global.pause') : $lang('global.play') ]"

70 :animation="[ loading ? 'animate-spin' : '' ]"

71 class="bg-zinc-900 hover:bg-white focus:ring-[6px] ring-white/10"

72 @click="setPlaying(!playing)"

73 ></v-button>

74 </div>

75 </div>

76 </div>

77 <div class="bg-gradient-to-b from-black h-2 sm:h-4"></div>

78 </div>

79 `

80}