blob: 5f94b91dddd6ec9086151110ae930fd5fddad92a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
<template>
<div class="mk-notify" :class="pos">
<div>
<mk-notification-preview :notification="notification"/>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import * as anime from 'animejs';
export default Vue.extend({
props: ['notification'],
computed: {
pos() {
return this.$store.state.device.mobileNotificationPosition;
}
},
mounted() {
this.$nextTick(() => {
anime({
targets: this.$el,
[this.pos]: '0px',
duration: 500,
easing: 'easeOutQuad'
});
setTimeout(() => {
anime({
targets: this.$el,
[this.pos]: `-${this.$el.offsetHeight}px`,
duration: 500,
easing: 'easeOutQuad',
complete: () => this.destroyDom()
});
}, 6000);
});
}
});
</script>
<style lang="stylus" scoped>
.mk-notify
$height = 78px
position fixed
z-index 10000
left 0
right 0
width 100%
max-width 500px
height $height
margin 0 auto
padding 8px
pointer-events none
font-size 80%
&.bottom
bottom -($height)
&.top
top -($height)
> div
height 100%
-webkit-backdrop-filter blur(2px)
backdrop-filter blur(2px)
background-color rgba(#000, 0.5)
border-radius 7px
overflow hidden
</style>
|