action sounds
This commit is contained in:
parent
9ffe44f477
commit
4081d805f0
BIN
frontend/src/assets/sounds/tap-kissy.mp3
Normal file
BIN
frontend/src/assets/sounds/tap-kissy.mp3
Normal file
Binary file not shown.
BIN
frontend/src/assets/sounds/tap-sizzle.mp3
Normal file
BIN
frontend/src/assets/sounds/tap-sizzle.mp3
Normal file
Binary file not shown.
@ -14,6 +14,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import message_sfx from '@/assets/sounds/tap-kissy.mp3'
|
||||
import notification_sfx from '@/assets/sounds/tap-sizzle.mp3'
|
||||
export default {
|
||||
name: 'Chat',
|
||||
data: () => ({
|
||||
@ -27,9 +29,11 @@ export default {
|
||||
if ((typeof msg === "string") && msg.indexOf('_') === 0) {
|
||||
let params = msg.split('|')
|
||||
let type = params.shift().substring(1)
|
||||
this.messages.push({text:this.$t(`chat.${type}`, params)})
|
||||
this.messages.push({text:this.$t(`chat.${type}`, params)});
|
||||
(new Audio(notification_sfx)).play();
|
||||
}else {
|
||||
this.messages.push(msg)
|
||||
(new Audio(message_sfx)).play();
|
||||
this.messages.push(msg);
|
||||
}
|
||||
let container = this.$el.querySelector("#chatbox");
|
||||
container.scrollTop = container.scrollHeight;
|
||||
|
Loading…
Reference in New Issue
Block a user