blob: dafede4c36df083503d454a1494e50994d23d55e (
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
|
<template>
<div class="mk-ui-notification">
<p>{{ message }}</p>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import * as anime from 'animejs';
export default Vue.extend({
props: ['message'],
mounted() {
this.$nextTick(() => {
anime({
targets: this.$el,
opacity: 1,
translateY: [-64, 0],
easing: 'easeOutElastic',
duration: 500
});
setTimeout(() => {
anime({
targets: this.$el,
opacity: 0,
translateY: -64,
duration: 500,
easing: 'easeInElastic',
complete: () => this.destroyDom()
});
}, 6000);
});
}
});
</script>
<style lang="stylus" scoped>
.mk-ui-notification
display block
position fixed
z-index 10000
top -128px
left 0
right 0
margin 0 auto
padding 128px 0 0 0
width 500px
color var(--desktopNotificationFg)
background var(--desktopNotificationBg)
border-radius 0 0 8px 8px
box-shadow 0 2px 4px var(--desktopNotificationShadow)
transform translateY(-64px)
opacity 0
> p
margin 0
line-height 64px
text-align center
</style>
|