mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-07-06 03:20:55 +00:00
notification sound fixes
This commit is contained in:
parent
1a08e6e5d5
commit
830ae0f9f5
3 changed files with 54 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="{server: true, 'add-server': mode === 'ADD_SERVER'}">
|
<div :class="{server: true, 'add-server': mode === 'ADD_SERVER'}">
|
||||||
<div class="small-view">
|
<div :class="{'small-view': true, notifyAnimation: notification}">
|
||||||
<profile-picture size="50px" v-if="!mode" :url="tempImage"/>
|
<profile-picture size="50px" v-if="!mode" :url="tempImage"/>
|
||||||
<div class="add-icon" v-if="mode === 'ADD_SERVER'">
|
<div class="add-icon" v-if="mode === 'ADD_SERVER'">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
|
|
@ -83,12 +83,53 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
user() {
|
user() {
|
||||||
return this.$store.getters.user;
|
return this.$store.getters.user;
|
||||||
|
},
|
||||||
|
notification() {
|
||||||
|
const notifications = this.$store.getters.notifications;
|
||||||
|
const channels = this.$store.getters.channels
|
||||||
|
const notification = notifications.find(e => {
|
||||||
|
return channels[e.channelID] && channels[e.channelID].server_id && this.ServerData && channels[e.channelID].server_id === this.ServerData.server_id
|
||||||
|
})
|
||||||
|
return notification;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
|
||||||
|
.notifyAnimation:before{
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
z-index: -1;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
animation: notifyAnime;
|
||||||
|
animation-duration: 1s;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
}
|
||||||
|
@keyframes notifyAnime {
|
||||||
|
0%{
|
||||||
|
background: rgba(255, 0, 0, 0.198);
|
||||||
|
}
|
||||||
|
40%{
|
||||||
|
background: rgba(255, 0, 0, 0.411);
|
||||||
|
}
|
||||||
|
60%{
|
||||||
|
background: rgba(255, 0, 0, 0.411);
|
||||||
|
}
|
||||||
|
100%{
|
||||||
|
background: rgba(255, 0, 0, 0.198);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.server {
|
.server {
|
||||||
color: white;
|
color: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,12 @@ const config = [
|
||||||
date: "27/05/2019",
|
date: "27/05/2019",
|
||||||
headColor: "rgba(155, 244, 66, 0.77)",
|
headColor: "rgba(155, 244, 66, 0.77)",
|
||||||
new: [
|
new: [
|
||||||
"When switching from server to direct message tab (and vice versa), the channels should now be seperated.",
|
"Notifications for servers has been added."
|
||||||
],
|
],
|
||||||
fix: [
|
fix: [
|
||||||
''
|
"Fixed notification bug where server notification are shown in dms",
|
||||||
|
"When switching from server to direct message tab (and vice versa), the channels should now be separated.",
|
||||||
|
'You can now only create 30 invites per server.'
|
||||||
],
|
],
|
||||||
next: [""]
|
next: [""]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,20 @@ import {
|
||||||
store
|
store
|
||||||
} from '@/store/index';
|
} from '@/store/index';
|
||||||
|
|
||||||
|
//init audio
|
||||||
|
const notificationAudio = new Audio(notificationSound);
|
||||||
|
|
||||||
|
const newFriendAudio = new Audio(newFriendSound);
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
notification: () => {
|
notification: () => {
|
||||||
if (isBusy()) return;
|
if (isBusy()) return;
|
||||||
const audio = new Audio(notificationSound);
|
notificationAudio.play();
|
||||||
audio.play();
|
|
||||||
},
|
},
|
||||||
newFriend: () => {
|
newFriend: () => {
|
||||||
if (isBusy()) return;
|
if (isBusy()) return;
|
||||||
const audio = new Audio(newFriendSound);
|
newFriendAudio.play();
|
||||||
audio.play();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue