A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: 86e7e5e1e4d26e391e2c32fe6ed22e1907277d16 (2219 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
console.log(info);18
const {title, description, actions} = info;19
this.title = title;20
this.description = description;21
this.actions = actions;22
this.show = true;23
},24
close() {25
this.show = false;26
}27
},28
computed: {29
opacity() {30
return {31
'opacity': `${this.show ? 1 : 0}`,32
'pointer-events': `${this.show ? 'all' : 'none'}`33
};34
},35
transform() {36
return {37
'opacity': `${this.show ? 1 : 0}`,38
'pointer-events': `${this.show ? 'all' : 'none'}`,39
'transform': `translate(-50%, calc(-50% + ${this.show ? '0' : '30'}px))`40
};41
}42
},43
template: `44
<div class="z-40">45
<div46
class="fixed top-0 bottom-0 left-0 right-0 bg-black/60 transition-opacity duration-300 ease-in-out"47
:style="opacity"48
>49
</div>50
<div51
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-500 ease-in-out"52
:style="transform"53
>54
<h3 class="text-white text-[24px] font-bold pb-4 text-center sm:text-left">{{title}}</h3>55
<p class="text-md text-gray-400 text-center sm:text-left" v-html="description"></p>56
<div class="flex gap-2 w-full justify-end">57
<v-button58
v-for="action in actions"59
:icon="action.icon"60
:title="action.title"61
@click="action.handle"62
></v-button>63
</div>64
</div>65
</div>66
`67
}