so://phie

verbal

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

blob: cbf81289b77023a91429d15074c4858fe1cb14a7 (1539 bytes)[doc][blame][raw]

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

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

3

4export default {

5 props: ['title', 'description', 'actions'],

6 components: {

7 VButton

8 },

9 methods: {

10 $lang,

11 open(info) {

12 const {title, description, actions} = info;

13 this.title = title;

14 this.description = description;

15 this.actions = actions;

16 this.$refs.dialog.show();

17 },

18 close() {

19 this.title = null;

20 this.description = null;

21 this.actions = null;

22 this.$refs.dialog.close();

23 }

24 },

25 mounted() {

26 this.close();

27 },

28 template: `

29 <dialog ref="dialog" class="z-40 fixed w-full h-full bg-black/80">

30 <div class="flex flex-col fixed left-[50%] top-[50%] -translate-y-[50%] -translate-x-[50%] rounded-lg sm:rounded-md bg-zinc-900 w-[500px] max-w-[85vw] p-6 sm:p-8 pt-10 sm:pt-8">

31 <h3 class="text-white text-[24px] font-bold pb-4 text-center sm:text-left">{{title}}</h3>

32 <p class="text-md text-gray-400 text-center sm:text-left" v-html="description"></p>

33 <div class="flex gap-2 w-full justify-end">

34 <v-button

35 v-for="action in actions"

36 :icon="action.icon"

37 :title="action.title"

38 @click="action.handle"

39 ></v-button>

40 </div>

41 </div>

42 </dialog>

43 `

44}