Ajout des boutons de simulation de buzzer et agrandissement de la fenêtre

This commit is contained in:
2026-01-23 18:50:58 +01:00
parent af58e9c30d
commit 5900b1faa1

View File

@@ -1,18 +1,18 @@
<template> <template>
<v-container class="v-container-style"> <v-container class="v-container-style">
<v-card tile outlined width="500"> <v-card tile outlined width="600">
<v-card-title class="card__title primary centered-title"> <v-card-title class="card__title primary centered-title">
<v-icon left class="pr-5 pl-2" size="30">mdi-send</v-icon> <v-icon left class="pr-5 pl-2" size="30">mdi-send</v-icon>
Publier un message Publier un message
</v-card-title> </v-card-title>
<div class="input-style"> <div class="input-style">
<v-select <v-text-field
label="Topic" label="Topic"
v-model="selectedTopic" v-model="selectedTopic"
:items="topics" :items="topics"
prepend-icon="mdi-target" prepend-icon="mdi-target"
></v-select> ></v-text-field>
<v-text-field <v-text-field
label="Message" label="Message"
@@ -30,6 +30,42 @@
Déblocage<br>Buzzer Déblocage<br>Buzzer
</v-btn> </v-btn>
<v-btn
rounded
color="RedBuzzer"
class="v-btn-style-standalone"
height="40"
@click="publishBuzzer('#d42828')"
>
Buzzer
</v-btn>
<v-btn
rounded
color="BlueBuzzer"
class="v-btn-style-standalone"
height="40"
@click="publishBuzzer('#2867d4')"
>
Buzzer
</v-btn>
<v-btn
rounded
color="YellowBuzzer"
class="v-btn-style-standalone"
height="40"
@click="publishBuzzer('#D4D100')"
>
Buzzer
</v-btn>
<v-btn
rounded
color="GreenBuzzer"
class="v-btn-style-standalone"
height="40"
@click="publishBuzzer('#28d42e')"
>
Buzzer
</v-btn>
<v-btn <v-btn
class="v-btn-style-validate" class="v-btn-style-validate"
height="50" height="50"
@@ -53,7 +89,8 @@ const topics = [
'display/control', 'display/control',
'sound/playsound', 'sound/playsound',
'game/score/update', 'game/score/update',
'game/score' 'game/score',
'/display/media'
]; ];
// Methods // Methods
@@ -62,7 +99,18 @@ const publisCustomMessage = () => {
}; };
const publishBuzzerUnblock = () => { const publishBuzzerUnblock = () => {
publishMessage('brainblast/buzzer/unlock', "0"); publishMessage('vulture/buzzer/unlock', "0");
};
const publishBuzzer = (inputColor) => {
publishMessage('vulture/buzzer/pressed/2',JSON.stringify({
buzzer_id: 1,
color: inputColor
}));
// Add a small delay before unlocking to ensure the score update is processed
setTimeout(() => {
publishMessage('/display/control', "pause");
}, 100);
}; };
</script> </script>