🌶🎥 Checkpoint

./views/room.handlebars:530995/80
./views/audience.handlebars:530995/371
./server.js:530995/328
./room.js:530995/345
./public/style.css:530995/79
This commit is contained in:
Glitch (hello-express)
2020-04-10 08:11:41 +00:00
parent 95137e2b1b
commit 6c1a308a03
5 changed files with 21 additions and 6 deletions

View File

@@ -35,6 +35,7 @@
socket.onmessage = function(event) {
let msg = JSON.parse(event.data);
if (msg.type === "buzz") {
beep();
let buzzed = document.getElementById(`p-${msg.participant.participantId}`);
buzzed.classList.add('buzzed');
setTimeout(() => buzzed.classList.remove('buzzed'), 5000)
@@ -42,10 +43,11 @@
window.location = window.location;
}
};
socket.onerror = function(error) {
alert(`[error] ${error.message}`);
};
function beep() {
window.navigator.vibrate(500);
new Audio("https://cdn.glitch.com/81aebabf-079d-4504-b844-d90d643962c4%2FGame-show-buzzer-sound-effect.mp3?v=1586451448374").play();
}
</script>
</body>
</html>

View File

@@ -62,6 +62,7 @@
});
function showMessage(msg) {
window.navigator.vibrate(500);
document.getElementById('buzzer').disabled = true;
let mb = document.getElementById('messageBox');
mb.innerHTML = msg;
@@ -73,6 +74,7 @@
}
function beep() {
window.navigator.vibrate(500);
new Audio("https://cdn.glitch.com/81aebabf-079d-4504-b844-d90d643962c4%2FGame-show-buzzer-sound-effect.mp3?v=1586451448374").play();
}
</script>