🎩😽 Checkpoint
./public/style.css:530995/181 ./views/room.handlebars:530995/703 ./room.js:530995/49
This commit is contained in:
parent
970897a2f0
commit
c0487b4a49
@ -56,8 +56,8 @@ footer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#buzzer {
|
#buzzer {
|
||||||
width: 500px;
|
width: 95vw;
|
||||||
height: 500px;
|
height: 95vw;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: 500px;
|
border-radius: 500px;
|
||||||
background: red;
|
background: red;
|
||||||
@ -78,6 +78,7 @@ h2 img {
|
|||||||
|
|
||||||
figure.participant {
|
figure.participant {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
transition: ease-in all .2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
figure.participant img {
|
figure.participant img {
|
||||||
@ -89,5 +90,6 @@ figure.participant figcaption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.buzzed {
|
.buzzed {
|
||||||
background: limegreen;
|
background: yellow;
|
||||||
|
transform: scale(1.3);
|
||||||
}
|
}
|
2
room.js
2
room.js
@ -50,7 +50,7 @@ function addAudienceWS(roomId, ws) {
|
|||||||
function buzz(roomId, participant) {
|
function buzz(roomId, participant) {
|
||||||
let room = getOrCreateRoom(roomId);
|
let room = getOrCreateRoom(roomId);
|
||||||
room.participants.forEach(p => {
|
room.participants.forEach(p => {
|
||||||
if (p.ws) {
|
if (p.ws && p.participantId !== participant.participantId) {
|
||||||
p.ws.send(JSON.stringify({
|
p.ws.send(JSON.stringify({
|
||||||
type: "buzz",
|
type: "buzz",
|
||||||
participant: participant.participantName
|
participant: participant.participantName
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
alert(`[error] ${error.message}`);
|
alert(`[error] ${error.message}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
document.getElementById('buzzer').addEventListener('click', function() {
|
document.getElementById('buzzer').addEventListener('touchstart', function() {
|
||||||
socket.send(JSON.stringify({
|
socket.send(JSON.stringify({
|
||||||
type: "buzz"
|
type: "buzz"
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user