so://phie

verbal

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

blob: 6da435463266718a716d3671c77d458ab1824948 (3604 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 class="bg-gray-400"

48 ></v-icon>

49 </div>

50 <div

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

52 >

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

54 {{station.name}}

55 </p>

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

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

58 </p>

59 </div>

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

61 <v-button

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

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

64 :active="station.is_favorite"

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

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

67 ></v-button>

68 <v-button

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

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

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

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

73 @click="setPlaying(!playing)"

74 ></v-button>

75 </div>

76 </div>

77 </div>

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

79 </div>

80 `

81}