Kuautli's picture
Update templates/index.html
4a27f26 verified
raw
history blame
3.07 kB
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Análisis de Comentarios de YouTube</title>
<style>
body {
background-color: #121212; /* Fondo oscuro */
color: #e0e0e0; /* Texto claro */
font-family: Arial, sans-serif;
}
.container {
width: 80%;
margin: auto;
padding: 20px;
}
h1 {
color: #ffffff;
}
.video-details {
margin-top: 20px;
padding: 15px;
border: 1px solid #333;
background-color: #1e1e1e;
}
h2 {
font-size: 20px;
color: gray;
margin-top: 5px;
}
#processing-message {
display: none; /* Ocultamos el mensaje inicialmente */
color: yellow; /* Color del mensaje */
font-weight: bold; /* Estilo del mensaje */
margin-top: 10px; /* Espaciado */
}
</style>
</head>
<body>
<div class="container">
<h1>Análisis de Comentarios de YouTube</h1>
<h2>by Cuauhtémoc Bautista</h2>
<form method="POST" action="/" onsubmit="showProcessingMessage()">
<label for="url">Ingresa una URL de un video de YouTube:</label>
<input type="text" id="url" name="url" required>
<button type="submit">Analizar</button>
</form>
<div id="processing-message">Procesando, por favor espere...</div> <!-- Mensaje de procesamiento -->
{% if video_details %}
<div class="video-details">
<h2>Detalles del Video</h2>
<p><strong>Nombre del video:</strong> {{ video_details.title }}</p>
<p><strong>Canal:</strong> {{ video_details.channel_title }}</p>
<p><strong>Número de vistas:</strong> {{ video_details.view_count }}</p>
<p><strong>Número de comentarios:</strong> {{ video_details.comment_count }}</p>
<p><strong>Comentarios positivos:</strong> {{ sentiment_count.positivo }}</p>
<p><strong>Comentarios negativos:</strong> {{ sentiment_count.negativo }}</p>
<p><strong>Comentarios neutros:</strong> {{ sentiment_count.neutro }}</p>
</div>
{% endif %}
{% if sentiment_daily_graph %}
<h2>Evolución comentarios por sentimiento</h2>
<div>{{ sentiment_daily_graph | safe }}</div>
{% endif %}
{% if scores_graph %}
<h2>Gráfico de Scores</h2>
<div>{{ scores_graph | safe }}</div>
{% endif %}
{% if sankey_graph %}
<h2>Gráfico de Sankey</h2>
<div>{{ sankey_graph | safe }}</div>
{% endif %}
</div>
<script>
function showProcessingMessage() {
document.getElementById("processing-message").style.display = "block"; // Mostrar el mensaje
}
</script>
</body>
</html>