mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-26 14:26:43 -06:00
60 lines
952 B
Vue
60 lines
952 B
Vue
|
<template>
|
||
|
<div class="mk-ui-notification">
|
||
|
<p>{{ message }}</p>
|
||
|
<div>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import Vue from 'vue';
|
||
|
import anime from 'animejs';
|
||
|
|
||
|
export default Vue.extend({
|
||
|
props: ['message'],
|
||
|
mounted() {
|
||
|
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.$destroy()
|
||
|
});
|
||
|
}, 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 rgba(#000, 0.6)
|
||
|
background rgba(#fff, 0.9)
|
||
|
border-radius 0 0 8px 8px
|
||
|
box-shadow 0 2px 4px rgba(#000, 0.2)
|
||
|
transform translateY(-64px)
|
||
|
opacity 0
|
||
|
|
||
|
> p
|
||
|
margin 0
|
||
|
line-height 64px
|
||
|
text-align center
|
||
|
|
||
|
</style>
|