A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: 20a1ff8c250f78065a39ae32f772ee00db31383a (2199 bytes)[doc][blame][raw]
1
import {$lang} from '../utils.js';2
import VButton from '../element/button.js';4
export default {5
props: ['title', 'description', 'actions'],6
data() {7
return {8
show: false9
};10
},11
components: {12
VButton13
},14
methods: {15
$lang,16
open(info) {17
const {title, description, actions} = info;18
this.title = title;19
this.description = description;20
this.actions = actions;21
this.show = true;22
},23
close() {24
this.show = false;25
}26
},27
computed: {28
opacity() {29
return {30
'opacity': `${this.show ? 1 : 0}`,31
'pointer-events': `${this.show ? 'all' : 'none'}`32
};33
},34
transform() {35
return {36
'opacity': `${this.show ? 1 : 0}`,37
'pointer-events': `${this.show ? 'all' : 'none'}`,38
'transform': `translate(-50%, calc(-50% + ${this.show ? '0' : '30'}px))`39
};40
}41
},42
template: `43
<div class="z-40">44
<div45
class="fixed top-0 bottom-0 left-0 right-0 bg-black/60 transition-opacity duration-300 ease-in-out"46
:style="opacity"47
>48
</div>49
<div50
class="z-50 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 transition-all duration-300 ease-in-out"51
:style="transform"52
>53
<h3 class="text-white text-[24px] font-bold pb-4 text-center sm:text-left">{{title}}</h3>54
<p class="text-md text-gray-400 text-center sm:text-left mb-7" v-html="description"></p>55
<div class="flex gap-2 w-full justify-end -mt-5">56
<v-button57
v-for="action in actions"58
:icon="action.icon"59
:title="action.title"60
@click="action.handle"61
></v-button>62
</div>63
</div>64
</div>65
`66
}