This commit is contained in:
Quentin ANIERE 2022-04-26 22:39:09 +02:00
parent 3a893d202e
commit 5937df3d40
4 changed files with 9 additions and 0 deletions

View File

@ -79,6 +79,10 @@ io.on("connection", (client) => {
messagesHistory.shift(); messagesHistory.shift();
} }
} else if(data.message === "/prout") {
io.sockets.emit("fart");
log(`${client.denisFanNumber} : have farted`);
} else { } else {
client.emit("warning"); client.emit("warning");
log(`${client.denisFanNumber} : ${data.message} (INVALID)`); log(`${client.denisFanNumber} : ${data.message} (INVALID)`);

BIN
src/fart.mp3 Normal file

Binary file not shown.

View File

@ -73,6 +73,7 @@
<img id="close" src="./images/cross.png"> <img id="close" src="./images/cross.png">
</div> </div>
<audio id="ringtone" src="./ringtone.mp3"></audio> <audio id="ringtone" src="./ringtone.mp3"></audio>
<audio id="fart" src="./fart.mp3"></audio>
<script src="https://danby.aniere.fr:3000/socket.io/socket.io.js"></script> <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="https://unpkg.com/swiper@8/swiper-bundle.min.js"></script>
<script src="script.js"></script> <script src="script.js"></script>

View File

@ -55,6 +55,10 @@ document.addEventListener("DOMContentLoaded", () => {
location.reload(); location.reload();
}); });
socket.on("fart", () => {
document.getElementById("fart").play();
})
socket.on("previous-messages", (data) => { socket.on("previous-messages", (data) => {
data.messages.forEach(message => { data.messages.forEach(message => {