main #19

Merged
artem merged 39 commits from main into dev 2023-09-22 14:13:12 +02:00
4 changed files with 31 additions and 6 deletions
Showing only changes of commit 9e4e7d4697 - Show all commits

View File

@ -127,7 +127,11 @@
</router-view> </router-view>
</div> </div>
<div id="popup-collection"> <div id="popup-collection">
<PopUp v-for="(popup, i) in $store.state.popups" :key="i" :item="popup" /> <PopUp
v-for="popup in $store.state.popups"
:key="popup.time"
:item="popup"
/>
</div> </div>
<Player ref="player" /> <Player ref="player" />
<Users ref="dialogUsers" /> <Users ref="dialogUsers" />

View File

@ -299,7 +299,7 @@ export default {
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index: 1000; z-index: 1000;
animation: fadeIn ease 0.15s; animation: fadeIn ease 0.20s;
} }
.dialog-window { .dialog-window {
box-shadow: 0px 8px 32px var(--shadow); box-shadow: 0px 8px 32px var(--shadow);

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="popup-control flex-column shadow ma8"> <div class="popup-control flex-column shadow ma8" :class="{fadeOut: fadeout}">
<div class="flex-row" :class="item.type"> <div class="flex-row" :class="item.type">
<awesome-icon icon="circle-info" size="2x" class="ma" /> <awesome-icon icon="circle-info" size="2x" class="ma" />
<div class="flex-column pa8-top ma8-bottom ma8-right"> <div class="flex-column pa8-top ma8-bottom ma8-right">
@ -11,6 +11,11 @@
</template> </template>
<script> <script>
export default { export default {
data() {
return {
fadeout: false,
};
},
props: { props: {
item: { item: {
type: Object, type: Object,
@ -22,9 +27,12 @@ export default {
}, },
}, },
mounted() { mounted() {
setTimeout(() => {
this.fadeout = true;
setTimeout(() => { setTimeout(() => {
this.$store.dispatch("removePopUp", this.item); this.$store.dispatch("removePopUp", this.item);
}, 5000); }, 1000);
}, 4000);
}, },
}; };
</script> </script>
@ -53,4 +61,16 @@ export default {
border-radius: 8px; border-radius: 8px;
background-color: var(--success); background-color: var(--success);
} }
.fadeOut {
animation: fadeOut ease 1s;
}
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
</style> </style>

View File

@ -27,7 +27,8 @@ export default {
state.serverInfo = info; state.serverInfo = info;
}, },
addPopUp(state, item) { addPopUp(state, item) {
state.popups.push(item); item.time = Date.now();
state.popups.unshift(item);
}, },
removePopUp(state, item) { removePopUp(state, item) {
let index = state.popups.indexOf(item); let index = state.popups.indexOf(item);