Add ringtone
This commit is contained in:
parent
e18cb3854a
commit
5fdbde912b
@ -57,6 +57,7 @@
|
||||
<img id="send" src="./images/send.png">
|
||||
<img id="close" src="./images/cross.png">
|
||||
</div>
|
||||
<audio id="ringtone" src="./ringtone.mp3"></audio>
|
||||
<script src="https://danby.aniere.fr:3000/socket.io/socket.io.js"></script>
|
||||
<script src="https://unpkg.com/swiper@8/swiper-bundle.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
|
BIN
src/ringtone.mp3
Normal file
BIN
src/ringtone.mp3
Normal file
Binary file not shown.
@ -29,6 +29,11 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
});
|
||||
|
||||
socket.on("new-message", (data) => {
|
||||
|
||||
if(data.author != username) {
|
||||
document.getElementById("ringtone").play();
|
||||
}
|
||||
|
||||
addMessage(data.author, data.message);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user