Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 99ceae2c5a | |||
| 7c77dcdd68 | |||
| b765181b3f | |||
| ab9f014baf |
+1
-1
@@ -71,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
|
||||||
<button type="button" class="btn btn-kahoot-register" id="btnCrearSala">Crear sala</button>
|
<button type="button" class="btn btn-kahoot-login" id="btnCrearSala">Crear sala</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -77,9 +77,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.btn-unirse:hover {
|
.btn-unirse:hover {
|
||||||
background-color: #1f6f09;
|
background-color: #0f56ab;
|
||||||
color: white;
|
color: white;
|
||||||
transform: translateY(-2px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-kahoot {
|
.modal-kahoot {
|
||||||
|
|||||||
@@ -401,18 +401,3 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.modal-kahoot {
|
|
||||||
border: none;
|
|
||||||
border-radius: 20px;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-kahoot-header {
|
|
||||||
background-color: var(--kahoot-purple);
|
|
||||||
color: white;
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
+1
-1
@@ -276,7 +276,7 @@ $(document).on("click", ".btn-abandonar-sala", function () {
|
|||||||
mensaje.text(
|
mensaje.text(
|
||||||
"Si abandonas la sala como anfitrión, la partida terminará para todos los jugadores.",
|
"Si abandonas la sala como anfitrión, la partida terminará para todos los jugadores.",
|
||||||
);
|
);
|
||||||
botonConfirmar.text("Sí, terminar partida");
|
botonConfirmar.text("Sí, abandonar");
|
||||||
} else {
|
} else {
|
||||||
titulo.text("¿Abandonar la sala?");
|
titulo.text("¿Abandonar la sala?");
|
||||||
mensaje.text(
|
mensaje.text(
|
||||||
|
|||||||
+5
-5
@@ -36,11 +36,11 @@ function renderizarTablaRanking(jugadores) {
|
|||||||
<thead class="table-dark">
|
<thead class="table-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" style="width: 10%;">#</th>
|
<th scope="col" style="width: 10%;">#</th>
|
||||||
<th scope="col" class="text-start" style="width: 30%;"><i class="fa-solid fa-user"></i> <br> Jugador</th>
|
<th scope="col" class="text-start" style="width: 35%;">Jugador</th>
|
||||||
<th scope="col" style="width: 15%;"><i class="fa-solid fa-trophy text-warning me-1"></i> <br> Victorias</th>
|
<th scope="col" style="width: 15%;"><i class="fa-solid fa-trophy text-warning me-1"></i> Vic</th>
|
||||||
<th scope="col" style="width: 15%;"><i class="fa-solid fa-xmark text-danger me-1"></i> <br> Derrotas</th>
|
<th scope="col" style="width: 15%;"><i class="fa-solid fa-xmark text-danger me-1"></i> Der</th>
|
||||||
<th scope="col" style="width: 15%;"><i class="fa-solid fa-bullseye text-success me-1"></i> <br> Aciertos</th>
|
<th scope="col" style="width: 15%;"><i class="fa-solid fa-bullseye text-success me-1"></i> Aciertos</th>
|
||||||
<th scope="col" style="width: 15%;"><i class="fa-solid fa-medal text-info me-1"></i> <br> Efectividad</th>
|
<th scope="col" style="width: 10%;"><i class="fa-solid fa-percent text-info me-1"></i> % Vic</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
+11
@@ -18,6 +18,8 @@ let preguntas = [];
|
|||||||
let indice = 0; // pregunta que se está mostrando
|
let indice = 0; // pregunta que se está mostrando
|
||||||
let bloqueado = false; // true mientras se envía una respuesta o se ve el feedback
|
let bloqueado = false; // true mientras se envía una respuesta o se ve el feedback
|
||||||
let numeroAciertos = 0; // número de aciertos del jugador
|
let numeroAciertos = 0; // número de aciertos del jugador
|
||||||
|
let tiempoRespuesta = 0;
|
||||||
|
let intervaloTiempo;
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
@@ -81,6 +83,11 @@ function cargarPreguntas() {
|
|||||||
|
|
||||||
// 2. Pintar la pregunta actual y sus respuestas
|
// 2. Pintar la pregunta actual y sus respuestas
|
||||||
function mostrarPregunta() {
|
function mostrarPregunta() {
|
||||||
|
console.log("entro en mostrarPregunta");
|
||||||
|
tiempoRespuesta = 0;
|
||||||
|
intervaloTiempo = setInterval(function () {
|
||||||
|
tiempoRespuesta++;
|
||||||
|
}, 100);
|
||||||
const pregunta = preguntas[indice];
|
const pregunta = preguntas[indice];
|
||||||
|
|
||||||
bloqueado = false;
|
bloqueado = false;
|
||||||
@@ -111,6 +118,9 @@ function mostrarPregunta() {
|
|||||||
|
|
||||||
// 3. El usuario pulsa una respuesta: se guarda y se enseña si ha acertado
|
// 3. El usuario pulsa una respuesta: se guarda y se enseña si ha acertado
|
||||||
function responder($botonPulsado) {
|
function responder($botonPulsado) {
|
||||||
|
console.log("entro en responder");
|
||||||
|
clearInterval(intervaloTiempo);
|
||||||
|
console.log("Tiempo de respuesta: " + tiempoRespuesta /10 + " segundos");
|
||||||
if (bloqueado) {
|
if (bloqueado) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -131,6 +141,7 @@ function responder($botonPulsado) {
|
|||||||
idPartida: idPartida,
|
idPartida: idPartida,
|
||||||
idPartidaxPregunta: pregunta.idPartidaxPregunta,
|
idPartidaxPregunta: pregunta.idPartidaxPregunta,
|
||||||
idRespuesta: idRespuesta,
|
idRespuesta: idRespuesta,
|
||||||
|
tiempoRespuesta: tiempoRespuesta,
|
||||||
},
|
},
|
||||||
success: function (datos) {
|
success: function (datos) {
|
||||||
if (datos.error) {
|
if (datos.error) {
|
||||||
|
|||||||
+1
-1
@@ -293,7 +293,7 @@ $avatarUsuario = htmlspecialchars($_SESSION['avatar'] ?? 'img/avatars/defaultPro
|
|||||||
Cancelar
|
Cancelar
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button type="submit" form="formCrearPregunta" class="btn btn-kahoot-register" id="btnCrearPregunta">
|
<button type="submit" form="formCrearPregunta" class="btn btn-kahoot-login" id="btnCrearPregunta">
|
||||||
<i class="bi bi-check-lg me-1"></i>
|
<i class="bi bi-check-lg me-1"></i>
|
||||||
Crear pregunta
|
Crear pregunta
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/conexionBD.php';
|
require_once 'includes/conexionBD.php';
|
||||||
|
|
||||||
$idPartida = intval($_GET['idPartida'] ?? 0);
|
$idPartida = intval($_GET['idPartida'] ?? 0);
|
||||||
if ($idPartida <= 0) {
|
if ($idPartida <= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user