464 lines
13 KiB
PHP
464 lines
13 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="es">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="icon" type="image/svg+xml" href="img/favicon/favicon.svg">
|
|
|
|
<title>Perfil</title>
|
|
|
|
<!-- Bootstrap -->
|
|
<link
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
rel="stylesheet">
|
|
|
|
<!-- Bootstrap Icons -->
|
|
<link
|
|
rel="stylesheet"
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
|
|
<!-- Google Font: Fredoka -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap"
|
|
rel="stylesheet">
|
|
|
|
<!-- Tu CSS -->
|
|
<link rel="stylesheet" href="css/index.css">
|
|
<link rel="stylesheet" href="css/perfil.css">
|
|
<script src="js/jquery-4.0.0.min.js"></script>
|
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
|
<?php
|
|
include_once 'cabecera.php';
|
|
?>
|
|
|
|
|
|
<div class="perfil-container">
|
|
|
|
<div class="perfil-card">
|
|
|
|
<!-- ========================= -->
|
|
<!-- CABECERA -->
|
|
<!-- ========================= -->
|
|
|
|
<div class="perfil-header">
|
|
<i class="bi bi-person-circle"></i>
|
|
Mi perfil
|
|
</div>
|
|
|
|
|
|
<div class="perfil-content">
|
|
|
|
<div class="row align-items-center g-5">
|
|
|
|
|
|
<!-- ========================= -->
|
|
<!-- PERFIL -->
|
|
<!-- ========================= -->
|
|
|
|
<div class="col-md-6 text-center">
|
|
|
|
<!-- Nombre -->
|
|
|
|
<h1 id="nombre" class="nombre">
|
|
<?php echo $_SESSION['nombreUsuario'] ?>
|
|
</h1>
|
|
|
|
|
|
<!-- ========================= -->
|
|
<!-- FOTO DE PERFIL -->
|
|
<!-- ========================= -->
|
|
|
|
<div class="foto-container">
|
|
|
|
<img
|
|
id="fotoPerfil"
|
|
src="<?= htmlspecialchars($_SESSION['avatar'] ?? '') ?>"
|
|
alt="Foto de perfil"
|
|
class="avatar rounded-circle">
|
|
|
|
|
|
<!-- Botón lápiz -->
|
|
|
|
<button
|
|
type="button"
|
|
class="btn-foto"
|
|
onclick="seleccionarFoto()"
|
|
title="Cambiar foto de perfil"
|
|
aria-label="Cambiar foto de perfil">
|
|
|
|
<i class="bi bi-pencil-fill"></i>
|
|
|
|
</button>
|
|
|
|
|
|
<!-- Input oculto -->
|
|
|
|
<input
|
|
type="file"
|
|
id="inputFoto"
|
|
accept="image/*"
|
|
hidden>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ========================= -->
|
|
<!-- CAMBIAR NOMBRE -->
|
|
<!-- ========================= -->
|
|
|
|
<div class="formulario-nombre">
|
|
|
|
<label
|
|
for="nuevoNombre"
|
|
class="form-label">
|
|
|
|
Cambia tu nombre
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
type="text"
|
|
id="nuevoNombre"
|
|
class="form-control mb-3"
|
|
placeholder="Escribe tu nuevo nombre">
|
|
|
|
|
|
<div class="d-flex justify-content-center gap-2">
|
|
|
|
<button
|
|
type="button"
|
|
class="btn-perfil-cambiar"
|
|
onclick="cambiarNombre()">
|
|
|
|
<i class="bi bi-check-lg"></i>
|
|
Cambiar nombre
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
type="button"
|
|
class="btn-perfil-borrar"
|
|
onclick="borrarNombre()">
|
|
|
|
<i class="bi bi-x-lg"></i>
|
|
Borrar
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ========================= -->
|
|
<!-- ESTADÍSTICAS -->
|
|
<!-- ========================= -->
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="estadisticas">
|
|
|
|
<h2>
|
|
<i class="bi bi-bar-chart-fill"></i>
|
|
Estadísticas
|
|
</h2>
|
|
|
|
|
|
<div class="estadistica estadistica-victorias">
|
|
|
|
<i class="bi bi-trophy-fill"></i>
|
|
Victorias:
|
|
|
|
<strong id="victorias">
|
|
|
|
</strong>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="estadistica estadistica-derrotas">
|
|
|
|
<i class="bi bi-x-circle-fill"></i>
|
|
Derrotas:
|
|
|
|
<strong id="derrotas">
|
|
|
|
</strong>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="estadistica estadistica-aciertos">
|
|
|
|
<i class="bi bi-bullseye"></i>
|
|
Aciertos:
|
|
|
|
<strong id="aciertos">
|
|
|
|
</strong>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ========================= -->
|
|
<!-- CREAR PREGUNTA -->
|
|
<!-- ========================= -->
|
|
|
|
<div class="text-center mt-4">
|
|
|
|
<button
|
|
type="button"
|
|
class="btn btn-play-kahoot"
|
|
data-bs-toggle="modal"
|
|
data-bs-target="#modalCrearPregunta">
|
|
|
|
<i class="bi bi-plus-circle-fill"></i>
|
|
Crear pregunta
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ================================================= -->
|
|
<!-- MODAL CREAR PREGUNTA -->
|
|
<!-- ================================================= -->
|
|
|
|
<div
|
|
class="modal fade"
|
|
id="modalCrearPregunta"
|
|
tabindex="-1"
|
|
aria-labelledby="modalCrearPreguntaLabel"
|
|
aria-hidden="true">
|
|
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
|
|
<div class="modal-content modal-kahoot">
|
|
|
|
|
|
<!-- CABECERA DEL MODAL -->
|
|
|
|
<div class="modal-header modal-kahoot-header">
|
|
|
|
<h5
|
|
class="modal-title"
|
|
id="modalCrearPreguntaLabel">
|
|
|
|
<i class="bi bi-question-circle-fill me-2"></i>
|
|
Crear pregunta
|
|
|
|
</h5>
|
|
|
|
|
|
<button
|
|
type="button"
|
|
class="btn-close btn-close-white"
|
|
data-bs-dismiss="modal"
|
|
aria-label="Cerrar">
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- CUERPO DEL MODAL -->
|
|
|
|
<div class="modal-body p-4">
|
|
|
|
<form id="formCrearPregunta">
|
|
|
|
|
|
<!-- PREGUNTA -->
|
|
|
|
<div class="mb-4">
|
|
|
|
<label
|
|
for="pregunta"
|
|
class="form-label fw-semibold">
|
|
|
|
<i class="bi bi-question-lg me-1"></i>
|
|
Pregunta
|
|
|
|
</label>
|
|
|
|
<textarea
|
|
id="pregunta"
|
|
name="pregunta"
|
|
class="form-control input-kahoot"
|
|
rows="3"
|
|
placeholder="Escribe aquí la pregunta..."
|
|
required></textarea>
|
|
|
|
</div>
|
|
|
|
<!-- CATEGORÍA -->
|
|
|
|
<div class="mb-4">
|
|
|
|
<label
|
|
for="idCategoria"
|
|
class="form-label fw-semibold">
|
|
|
|
<i class="bi bi-folder-fill me-1"></i>
|
|
Categoría
|
|
|
|
</label>
|
|
|
|
<select
|
|
id="idCategoria"
|
|
name="idCategoria"
|
|
class="form-select input-kahoot"
|
|
required>
|
|
|
|
<option value="">
|
|
Selecciona una categoría
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- RESPUESTA CORRECTA -->
|
|
|
|
<div class="mb-3">
|
|
|
|
<label
|
|
for="respuestaCorrecta"
|
|
class="form-label fw-semibold text-success">
|
|
|
|
<i class="bi bi-check-circle-fill me-1"></i>
|
|
Respuesta correcta
|
|
|
|
</label>
|
|
|
|
<input
|
|
type="text"
|
|
id="respuestaCorrecta"
|
|
name="respuestaCorrecta"
|
|
class="form-control input-kahoot"
|
|
placeholder="Escribe la respuesta correcta..."
|
|
required>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- RESPUESTAS INCORRECTAS -->
|
|
|
|
<div class="mb-3">
|
|
|
|
<label
|
|
class="form-label fw-semibold text-danger">
|
|
|
|
<i class="bi bi-x-circle-fill me-1"></i>
|
|
Respuestas incorrectas
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
type="text"
|
|
id="respuestaIncorrecta1"
|
|
name="respuestaIncorrecta1"
|
|
class="form-control input-kahoot mb-2"
|
|
placeholder="Respuesta incorrecta 1"
|
|
required>
|
|
|
|
|
|
<input
|
|
type="text"
|
|
id="respuestaIncorrecta2"
|
|
name="respuestaIncorrecta2"
|
|
class="form-control input-kahoot mb-2"
|
|
placeholder="Respuesta incorrecta 2"
|
|
required>
|
|
|
|
|
|
<input
|
|
type="text"
|
|
id="respuestaIncorrecta3"
|
|
name="respuestaIncorrecta3"
|
|
class="form-control input-kahoot"
|
|
placeholder="Respuesta incorrecta 3"
|
|
required>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- PIE DEL MODAL -->
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button
|
|
type="button"
|
|
class="btn btn-secondary"
|
|
data-bs-dismiss="modal">
|
|
|
|
<i class="bi bi-x-lg me-1"></i>
|
|
Cancelar
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
type="submit"
|
|
form="formCrearPregunta"
|
|
class="btn btn-kahoot-login"
|
|
id="btnCrearPregunta">
|
|
|
|
<i class="bi bi-check-lg me-1"></i>
|
|
Crear pregunta
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Bootstrap JS -->
|
|
|
|
<script
|
|
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js">
|
|
</script>
|
|
|
|
|
|
<!-- Tu JavaScript -->
|
|
|
|
<script src="js/perfil.js"></script>
|
|
|
|
</body>
|
|
|
|
</html>
|