Spaces:
Paused
Paused
Update static/index.html
Browse files- static/index.html +202 -55
static/index.html
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>TrueEye -
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
| 9 |
<script>
|
|
@@ -12,25 +12,46 @@
|
|
| 12 |
theme: {
|
| 13 |
extend: {
|
| 14 |
colors: {
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
}
|
| 19 |
}
|
| 20 |
}
|
| 21 |
}
|
| 22 |
</script>
|
| 23 |
<style>
|
| 24 |
-
|
|
|
|
| 25 |
color: #f6ae2d;
|
| 26 |
text-decoration: underline;
|
| 27 |
}
|
| 28 |
-
.
|
|
|
|
|
|
|
|
|
|
| 29 |
color: #f6ae2d;
|
| 30 |
margin-top: 1rem;
|
| 31 |
margin-bottom: 0.5rem;
|
| 32 |
font-weight: bold;
|
| 33 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
.markdown-content p {
|
| 35 |
margin-bottom: 1rem;
|
| 36 |
}
|
|
@@ -41,18 +62,35 @@
|
|
| 41 |
.markdown-content li {
|
| 42 |
margin-bottom: 0.5rem;
|
| 43 |
}
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
background-color: rgba(246, 174, 45, 0.2);
|
| 46 |
padding: 0.2rem 0.4rem;
|
| 47 |
border-radius: 0.25rem;
|
| 48 |
}
|
| 49 |
-
.markdown-content pre {
|
| 50 |
background-color: rgba(246, 174, 45, 0.1);
|
| 51 |
padding: 1rem;
|
| 52 |
border-radius: 0.5rem;
|
| 53 |
overflow-x: auto;
|
| 54 |
margin-bottom: 1rem;
|
| 55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
.markdown-content blockquote {
|
| 57 |
border-left: 4px solid #f6ae2d;
|
| 58 |
padding-left: 1rem;
|
|
@@ -60,10 +98,17 @@
|
|
| 60 |
color: #777;
|
| 61 |
margin-bottom: 1rem;
|
| 62 |
}
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
font-weight: bold;
|
| 65 |
color: #f6ae2d;
|
| 66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
@keyframes pulse {
|
| 68 |
0%, 100% { opacity: 1; }
|
| 69 |
50% { opacity: 0.5; }
|
|
@@ -71,16 +116,114 @@
|
|
| 71 |
.loading-message {
|
| 72 |
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
| 73 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
</style>
|
| 75 |
</head>
|
| 76 |
-
<body class="bg-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
<header class="flex justify-between items-center mb-8">
|
| 79 |
<div>
|
| 80 |
-
<h1 class="text-4xl font-bold text-
|
| 81 |
-
<p class="text-lg text-gray-
|
| 82 |
</div>
|
| 83 |
-
<button id="theme-toggle" class="p-2 rounded-full bg-
|
| 84 |
<svg id="theme-icon-dark" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 85 |
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
|
| 86 |
</svg>
|
|
@@ -91,64 +234,68 @@
|
|
| 91 |
</header>
|
| 92 |
|
| 93 |
<main>
|
| 94 |
-
<div class="bg-
|
| 95 |
<div class="flex flex-col md:flex-row gap-4">
|
| 96 |
<input
|
| 97 |
id="input-url"
|
| 98 |
type="url"
|
| 99 |
-
placeholder="
|
| 100 |
-
class="flex-grow px-4 py-3 rounded-lg border border-
|
| 101 |
>
|
| 102 |
<button
|
| 103 |
id="analyze-btn"
|
| 104 |
-
class="px-6 py-3 bg-
|
| 105 |
>
|
| 106 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
| 107 |
<path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
|
| 108 |
</svg>
|
| 109 |
-
|
| 110 |
</button>
|
| 111 |
</div>
|
| 112 |
-
<div id="error-message" class="mt-2 text-red-
|
| 113 |
</div>
|
| 114 |
|
| 115 |
<div id="loading" class="hidden">
|
| 116 |
-
<div class="bg-
|
| 117 |
<div class="flex justify-center items-center mb-4">
|
| 118 |
-
<div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-
|
| 119 |
</div>
|
| 120 |
-
<p class="text-gray-
|
| 121 |
-
<p class="text-sm text-gray-
|
| 122 |
-
<div id="progress-timer" class="text-xs text-gray-
|
| 123 |
</div>
|
| 124 |
</div>
|
| 125 |
|
| 126 |
-
<div id="result-container" class="hidden bg-
|
| 127 |
-
<h2 class="text-2xl font-semibold text-
|
| 128 |
-
<div id="result" class="markdown-content text-gray-
|
| 129 |
</div>
|
| 130 |
|
| 131 |
-
<div id="info-box" class="mt-8 bg-
|
| 132 |
-
<h3 class="text-lg font-semibold text-
|
| 133 |
-
<p class="text-
|
| 134 |
-
TrueEye
|
| 135 |
-
|
| 136 |
-
|
| 137 |
</p>
|
| 138 |
</div>
|
| 139 |
</main>
|
| 140 |
|
| 141 |
-
<footer class="mt-12 text-center text-gray-
|
| 142 |
-
<p>© 2025 TrueEye.
|
| 143 |
</footer>
|
| 144 |
</div>
|
| 145 |
|
| 146 |
<script>
|
| 147 |
-
//
|
| 148 |
let analysisStartTime = null;
|
| 149 |
let timerInterval = null;
|
| 150 |
|
| 151 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
const themeToggle = document.getElementById('theme-toggle');
|
| 153 |
const themeIconDark = document.getElementById('theme-icon-dark');
|
| 154 |
const themeIconLight = document.getElementById('theme-icon-light');
|
|
@@ -177,7 +324,7 @@
|
|
| 177 |
}
|
| 178 |
});
|
| 179 |
|
| 180 |
-
//
|
| 181 |
const analyzeBtn = document.getElementById('analyze-btn');
|
| 182 |
const inputUrl = document.getElementById('input-url');
|
| 183 |
const resultContainer = document.getElementById('result-container');
|
|
@@ -190,12 +337,12 @@
|
|
| 190 |
const url = inputUrl.value.trim();
|
| 191 |
|
| 192 |
if (!url) {
|
| 193 |
-
showError('
|
| 194 |
return;
|
| 195 |
}
|
| 196 |
|
| 197 |
if (!isValidUrl(url)) {
|
| 198 |
-
showError('
|
| 199 |
return;
|
| 200 |
}
|
| 201 |
|
|
@@ -212,34 +359,34 @@
|
|
| 212 |
});
|
| 213 |
|
| 214 |
if (!response.ok) {
|
| 215 |
-
throw new Error(`
|
| 216 |
}
|
| 217 |
|
| 218 |
const data = await response.json();
|
| 219 |
|
| 220 |
if (!data.success && data.error) {
|
| 221 |
-
//
|
| 222 |
if (data.error === 'timeout') {
|
| 223 |
-
showError('
|
| 224 |
} else if (data.error === 'connection') {
|
| 225 |
-
showError('
|
| 226 |
} else {
|
| 227 |
-
showError(data.result || '
|
| 228 |
}
|
| 229 |
stopAnalysis();
|
| 230 |
return;
|
| 231 |
}
|
| 232 |
|
| 233 |
-
//
|
| 234 |
resultDiv.innerHTML = marked.parse(data.result);
|
| 235 |
resultContainer.classList.remove('hidden');
|
| 236 |
stopAnalysis();
|
| 237 |
|
| 238 |
-
//
|
| 239 |
resultContainer.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
| 240 |
|
| 241 |
} catch (error) {
|
| 242 |
-
showError('
|
| 243 |
console.error('Error:', error);
|
| 244 |
stopAnalysis();
|
| 245 |
}
|
|
@@ -251,12 +398,12 @@
|
|
| 251 |
analyzeBtn.disabled = true;
|
| 252 |
analysisStartTime = Date.now();
|
| 253 |
|
| 254 |
-
//
|
| 255 |
timerInterval = setInterval(() => {
|
| 256 |
const elapsed = Date.now() - analysisStartTime;
|
| 257 |
const minutes = Math.floor(elapsed / 60000);
|
| 258 |
const seconds = Math.floor((elapsed % 60000) / 1000);
|
| 259 |
-
progressTimer.textContent = `
|
| 260 |
}, 1000);
|
| 261 |
}
|
| 262 |
|
|
@@ -288,21 +435,21 @@
|
|
| 288 |
errorMessage.classList.add('hidden');
|
| 289 |
}
|
| 290 |
|
| 291 |
-
//
|
| 292 |
inputUrl.addEventListener('keypress', (e) => {
|
| 293 |
if (e.key === 'Enter' && !analyzeBtn.disabled) {
|
| 294 |
analyzeBtn.click();
|
| 295 |
}
|
| 296 |
});
|
| 297 |
|
| 298 |
-
//
|
| 299 |
const exampleUrls = [
|
| 300 |
'https://example.com/news-article',
|
| 301 |
'https://bbc.com/news/article-123',
|
| 302 |
'https://cnn.com/2025/01/article'
|
| 303 |
];
|
| 304 |
|
| 305 |
-
//
|
| 306 |
inputUrl.addEventListener('dblclick', () => {
|
| 307 |
inputUrl.value = exampleUrls[Math.floor(Math.random() * exampleUrls.length)];
|
| 308 |
});
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="es" class="dark">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>TrueEye - Sistema Inteligente de Alfabetización Mediática</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
| 9 |
<script>
|
|
|
|
| 12 |
theme: {
|
| 13 |
extend: {
|
| 14 |
colors: {
|
| 15 |
+
'trueeye-dark': '#420909',
|
| 16 |
+
'trueeye-gold': '#f6ae2d',
|
| 17 |
+
'trueeye-navbar': '#2a0606',
|
| 18 |
}
|
| 19 |
}
|
| 20 |
}
|
| 21 |
}
|
| 22 |
</script>
|
| 23 |
<style>
|
| 24 |
+
/* Estilos para modo oscuro */
|
| 25 |
+
.dark .markdown-content a {
|
| 26 |
color: #f6ae2d;
|
| 27 |
text-decoration: underline;
|
| 28 |
}
|
| 29 |
+
.dark .markdown-content h1,
|
| 30 |
+
.dark .markdown-content h2,
|
| 31 |
+
.dark .markdown-content h3,
|
| 32 |
+
.dark .markdown-content h4 {
|
| 33 |
color: #f6ae2d;
|
| 34 |
margin-top: 1rem;
|
| 35 |
margin-bottom: 0.5rem;
|
| 36 |
font-weight: bold;
|
| 37 |
}
|
| 38 |
+
|
| 39 |
+
/* Estilos para modo claro */
|
| 40 |
+
.markdown-content a {
|
| 41 |
+
color: #420909;
|
| 42 |
+
text-decoration: underline;
|
| 43 |
+
font-weight: 500;
|
| 44 |
+
}
|
| 45 |
+
.markdown-content h1,
|
| 46 |
+
.markdown-content h2,
|
| 47 |
+
.markdown-content h3,
|
| 48 |
+
.markdown-content h4 {
|
| 49 |
+
color: #420909;
|
| 50 |
+
margin-top: 1rem;
|
| 51 |
+
margin-bottom: 0.5rem;
|
| 52 |
+
font-weight: bold;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
.markdown-content p {
|
| 56 |
margin-bottom: 1rem;
|
| 57 |
}
|
|
|
|
| 62 |
.markdown-content li {
|
| 63 |
margin-bottom: 0.5rem;
|
| 64 |
}
|
| 65 |
+
|
| 66 |
+
/* Código en modo oscuro */
|
| 67 |
+
.dark .markdown-content code {
|
| 68 |
background-color: rgba(246, 174, 45, 0.2);
|
| 69 |
padding: 0.2rem 0.4rem;
|
| 70 |
border-radius: 0.25rem;
|
| 71 |
}
|
| 72 |
+
.dark .markdown-content pre {
|
| 73 |
background-color: rgba(246, 174, 45, 0.1);
|
| 74 |
padding: 1rem;
|
| 75 |
border-radius: 0.5rem;
|
| 76 |
overflow-x: auto;
|
| 77 |
margin-bottom: 1rem;
|
| 78 |
}
|
| 79 |
+
|
| 80 |
+
/* Código en modo claro */
|
| 81 |
+
.markdown-content code {
|
| 82 |
+
background-color: rgba(66, 9, 9, 0.1);
|
| 83 |
+
padding: 0.2rem 0.4rem;
|
| 84 |
+
border-radius: 0.25rem;
|
| 85 |
+
}
|
| 86 |
+
.markdown-content pre {
|
| 87 |
+
background-color: rgba(66, 9, 9, 0.05);
|
| 88 |
+
padding: 1rem;
|
| 89 |
+
border-radius: 0.5rem;
|
| 90 |
+
overflow-x: auto;
|
| 91 |
+
margin-bottom: 1rem;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
.markdown-content blockquote {
|
| 95 |
border-left: 4px solid #f6ae2d;
|
| 96 |
padding-left: 1rem;
|
|
|
|
| 98 |
color: #777;
|
| 99 |
margin-bottom: 1rem;
|
| 100 |
}
|
| 101 |
+
|
| 102 |
+
/* Strong text */
|
| 103 |
+
.dark .markdown-content strong {
|
| 104 |
font-weight: bold;
|
| 105 |
color: #f6ae2d;
|
| 106 |
}
|
| 107 |
+
.markdown-content strong {
|
| 108 |
+
font-weight: bold;
|
| 109 |
+
color: #420909;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
@keyframes pulse {
|
| 113 |
0%, 100% { opacity: 1; }
|
| 114 |
50% { opacity: 0.5; }
|
|
|
|
| 116 |
.loading-message {
|
| 117 |
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
| 118 |
}
|
| 119 |
+
|
| 120 |
+
/* Navbar fija */
|
| 121 |
+
.navbar {
|
| 122 |
+
background-color: #2a0606;
|
| 123 |
+
position: fixed;
|
| 124 |
+
top: 0;
|
| 125 |
+
left: 0;
|
| 126 |
+
right: 0;
|
| 127 |
+
z-index: 50;
|
| 128 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
/* Compensar el espacio de la navbar */
|
| 132 |
+
body {
|
| 133 |
+
padding-top: 64px;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
/* Botones de la navbar */
|
| 137 |
+
.nav-button {
|
| 138 |
+
background-color: #f6ae2d;
|
| 139 |
+
color: #420909;
|
| 140 |
+
padding: 0.5rem 1rem;
|
| 141 |
+
border-radius: 0.375rem;
|
| 142 |
+
font-weight: 600;
|
| 143 |
+
transition: all 0.3s;
|
| 144 |
+
}
|
| 145 |
+
.nav-button:hover {
|
| 146 |
+
background-color: #e09d1c;
|
| 147 |
+
transform: translateY(-1px);
|
| 148 |
+
box-shadow: 0 2px 8px rgba(246, 174, 45, 0.3);
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
/* Banner cards */
|
| 152 |
+
.feature-card {
|
| 153 |
+
transition: all 0.3s;
|
| 154 |
+
}
|
| 155 |
+
.dark .feature-card {
|
| 156 |
+
background-color: rgba(246, 174, 45, 0.1);
|
| 157 |
+
border: 1px solid rgba(246, 174, 45, 0.3);
|
| 158 |
+
}
|
| 159 |
+
.feature-card {
|
| 160 |
+
background-color: rgba(246, 174, 45, 0.1);
|
| 161 |
+
border: 1px solid rgba(66, 9, 9, 0.2);
|
| 162 |
+
}
|
| 163 |
+
.dark .feature-card:hover {
|
| 164 |
+
transform: translateY(-2px);
|
| 165 |
+
box-shadow: 0 4px 12px rgba(246, 174, 45, 0.2);
|
| 166 |
+
border-color: #f6ae2d;
|
| 167 |
+
}
|
| 168 |
+
.feature-card:hover {
|
| 169 |
+
transform: translateY(-2px);
|
| 170 |
+
box-shadow: 0 4px 12px rgba(66, 9, 9, 0.1);
|
| 171 |
+
border-color: #420909;
|
| 172 |
+
}
|
| 173 |
</style>
|
| 174 |
</head>
|
| 175 |
+
<body class="bg-white dark:bg-trueeye-dark min-h-screen transition-colors duration-300">
|
| 176 |
+
<!-- Navbar fija -->
|
| 177 |
+
<nav class="navbar">
|
| 178 |
+
<div class="container mx-auto px-4">
|
| 179 |
+
<div class="flex justify-between items-center h-16">
|
| 180 |
+
<!-- Logo y título -->
|
| 181 |
+
<div class="flex items-center space-x-3">
|
| 182 |
+
<img src="/static/te.png" alt="TrueEye Logo" class="h-10 w-10">
|
| 183 |
+
<span class="text-trueeye-gold text-xl font-bold">TrueEye Reports</span>
|
| 184 |
+
</div>
|
| 185 |
+
|
| 186 |
+
<!-- Botones de navegación -->
|
| 187 |
+
<div class="flex items-center space-x-4">
|
| 188 |
+
<a href="#" target="_blank" class="nav-button" id="my-web-btn">
|
| 189 |
+
Mi Web
|
| 190 |
+
</a>
|
| 191 |
+
<a href="#" target="_blank" class="nav-button" id="trueeye-project-btn">
|
| 192 |
+
Proyecto TrueEye
|
| 193 |
+
</a>
|
| 194 |
+
</div>
|
| 195 |
+
</div>
|
| 196 |
+
</div>
|
| 197 |
+
</nav>
|
| 198 |
+
|
| 199 |
+
<div class="container mx-auto px-4 py-8 max-w-6xl">
|
| 200 |
+
<!-- Banner de características -->
|
| 201 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
|
| 202 |
+
<div class="feature-card rounded-lg p-4">
|
| 203 |
+
<h3 class="text-trueeye-gold dark:text-trueeye-gold font-bold mb-2">Detección de Sesgos</h3>
|
| 204 |
+
<p class="text-sm text-gray-700 dark:text-gray-200">Identificación precisa de inclinaciones positivas, negativas o neutrales</p>
|
| 205 |
+
</div>
|
| 206 |
+
<div class="feature-card rounded-lg p-4">
|
| 207 |
+
<h3 class="text-trueeye-gold dark:text-trueeye-gold font-bold mb-2">Verificación de Hechos</h3>
|
| 208 |
+
<p class="text-sm text-gray-700 dark:text-gray-200">Detección de falacias, argumentos engañosos y desinformación</p>
|
| 209 |
+
</div>
|
| 210 |
+
<div class="feature-card rounded-lg p-4">
|
| 211 |
+
<h3 class="text-trueeye-gold dark:text-trueeye-gold font-bold mb-2">Análisis de Audiencia</h3>
|
| 212 |
+
<p class="text-sm text-gray-700 dark:text-gray-200">Perfil demográfico y psicográfico del público objetivo</p>
|
| 213 |
+
</div>
|
| 214 |
+
<div class="feature-card rounded-lg p-4">
|
| 215 |
+
<h3 class="text-trueeye-gold dark:text-trueeye-gold font-bold mb-2">Evaluación de Intencionalidad</h3>
|
| 216 |
+
<p class="text-sm text-gray-700 dark:text-gray-200">Análisis de manipulación y niveles de animosidad</p>
|
| 217 |
+
</div>
|
| 218 |
+
</div>
|
| 219 |
+
|
| 220 |
+
<!-- Header principal -->
|
| 221 |
<header class="flex justify-between items-center mb-8">
|
| 222 |
<div>
|
| 223 |
+
<h1 class="text-4xl font-bold text-trueeye-dark dark:text-trueeye-gold">TrueEye</h1>
|
| 224 |
+
<p class="text-lg text-gray-700 dark:text-gray-300">Sistema Inteligente de Alfabetización Mediática</p>
|
| 225 |
</div>
|
| 226 |
+
<button id="theme-toggle" class="p-2 rounded-full bg-trueeye-gold dark:bg-trueeye-dark text-trueeye-dark dark:text-trueeye-gold border-2 border-trueeye-dark dark:border-trueeye-gold">
|
| 227 |
<svg id="theme-icon-dark" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 228 |
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
|
| 229 |
</svg>
|
|
|
|
| 234 |
</header>
|
| 235 |
|
| 236 |
<main>
|
| 237 |
+
<div class="bg-trueeye-gold/10 dark:bg-trueeye-gold/10 border border-trueeye-dark/20 dark:border-trueeye-gold/30 rounded-lg shadow-lg p-6 mb-8 transition-colors duration-300">
|
| 238 |
<div class="flex flex-col md:flex-row gap-4">
|
| 239 |
<input
|
| 240 |
id="input-url"
|
| 241 |
type="url"
|
| 242 |
+
placeholder="Ingrese la URL a analizar..."
|
| 243 |
+
class="flex-grow px-4 py-3 rounded-lg border border-trueeye-dark/30 dark:border-trueeye-gold/30 focus:outline-none focus:ring-2 focus:ring-trueeye-gold dark:focus:ring-trueeye-gold bg-white dark:bg-trueeye-dark/50 text-black dark:text-white placeholder-gray-500 dark:placeholder-gray-400"
|
| 244 |
>
|
| 245 |
<button
|
| 246 |
id="analyze-btn"
|
| 247 |
+
class="px-6 py-3 bg-trueeye-gold hover:bg-trueeye-gold/90 text-trueeye-dark font-semibold rounded-lg transition-all duration-300 flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed hover:shadow-lg"
|
| 248 |
>
|
| 249 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
| 250 |
<path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
|
| 251 |
</svg>
|
| 252 |
+
Analizar
|
| 253 |
</button>
|
| 254 |
</div>
|
| 255 |
+
<div id="error-message" class="mt-2 text-red-600 dark:text-red-400 hidden"></div>
|
| 256 |
</div>
|
| 257 |
|
| 258 |
<div id="loading" class="hidden">
|
| 259 |
+
<div class="bg-trueeye-gold/10 dark:bg-trueeye-gold/10 border border-trueeye-dark/20 dark:border-trueeye-gold/30 rounded-lg shadow-lg p-8 text-center">
|
| 260 |
<div class="flex justify-center items-center mb-4">
|
| 261 |
+
<div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-trueeye-gold"></div>
|
| 262 |
</div>
|
| 263 |
+
<p class="text-gray-700 dark:text-gray-200 loading-message">Analizando contenido...</p>
|
| 264 |
+
<p class="text-sm text-gray-600 dark:text-gray-400 mt-2">Esto puede tomar algunos minutos mientras realizamos un análisis exhaustivo</p>
|
| 265 |
+
<div id="progress-timer" class="text-xs text-gray-500 dark:text-gray-500 mt-4">Tiempo transcurrido: 0:00</div>
|
| 266 |
</div>
|
| 267 |
</div>
|
| 268 |
|
| 269 |
+
<div id="result-container" class="hidden bg-trueeye-gold/10 dark:bg-trueeye-gold/10 border border-trueeye-dark/20 dark:border-trueeye-gold/30 rounded-lg shadow-lg p-6 transition-colors duration-300">
|
| 270 |
+
<h2 class="text-2xl font-semibold text-trueeye-dark dark:text-trueeye-gold mb-4">Resultado del Análisis</h2>
|
| 271 |
+
<div id="result" class="markdown-content text-gray-800 dark:text-gray-200"></div>
|
| 272 |
</div>
|
| 273 |
|
| 274 |
+
<div id="info-box" class="mt-8 bg-trueeye-gold/20 dark:bg-trueeye-gold/10 border border-trueeye-dark/20 dark:border-trueeye-gold/30 rounded-lg p-4">
|
| 275 |
+
<h3 class="text-lg font-semibold text-trueeye-dark dark:text-trueeye-gold mb-2">¿Cómo funciona?</h3>
|
| 276 |
+
<p class="text-gray-700 dark:text-gray-300 text-sm">
|
| 277 |
+
TrueEye analiza artículos de noticias y contenido web para detectar sesgos, identificar audiencias objetivo
|
| 278 |
+
y revelar agendas ocultas. Simplemente pegue una URL y deje que nuestro sistema impulsado por IA le proporcione
|
| 279 |
+
un informe completo de alfabetización mediática.
|
| 280 |
</p>
|
| 281 |
</div>
|
| 282 |
</main>
|
| 283 |
|
| 284 |
+
<footer class="mt-12 text-center text-gray-600 dark:text-gray-400">
|
| 285 |
+
<p>© 2025 TrueEye. Todos los derechos reservados.</p>
|
| 286 |
</footer>
|
| 287 |
</div>
|
| 288 |
|
| 289 |
<script>
|
| 290 |
+
// Variables globales
|
| 291 |
let analysisStartTime = null;
|
| 292 |
let timerInterval = null;
|
| 293 |
|
| 294 |
+
// Configurar URLs de los botones (cambiar estas URLs según necesites)
|
| 295 |
+
document.getElementById('my-web-btn').href = '#'; // Cambia esto a tu URL
|
| 296 |
+
document.getElementById('trueeye-project-btn').href = '#'; // Cambia esto a la URL del proyecto
|
| 297 |
+
|
| 298 |
+
// Cambio de tema
|
| 299 |
const themeToggle = document.getElementById('theme-toggle');
|
| 300 |
const themeIconDark = document.getElementById('theme-icon-dark');
|
| 301 |
const themeIconLight = document.getElementById('theme-icon-light');
|
|
|
|
| 324 |
}
|
| 325 |
});
|
| 326 |
|
| 327 |
+
// Funcionalidad de análisis
|
| 328 |
const analyzeBtn = document.getElementById('analyze-btn');
|
| 329 |
const inputUrl = document.getElementById('input-url');
|
| 330 |
const resultContainer = document.getElementById('result-container');
|
|
|
|
| 337 |
const url = inputUrl.value.trim();
|
| 338 |
|
| 339 |
if (!url) {
|
| 340 |
+
showError('Por favor ingrese una URL');
|
| 341 |
return;
|
| 342 |
}
|
| 343 |
|
| 344 |
if (!isValidUrl(url)) {
|
| 345 |
+
showError('Por favor ingrese una URL válida (incluya http:// o https://)');
|
| 346 |
return;
|
| 347 |
}
|
| 348 |
|
|
|
|
| 359 |
});
|
| 360 |
|
| 361 |
if (!response.ok) {
|
| 362 |
+
throw new Error(`El servidor retornó ${response.status}`);
|
| 363 |
}
|
| 364 |
|
| 365 |
const data = await response.json();
|
| 366 |
|
| 367 |
if (!data.success && data.error) {
|
| 368 |
+
// Manejar tipos de error específicos
|
| 369 |
if (data.error === 'timeout') {
|
| 370 |
+
showError('El análisis tardó demasiado tiempo. Por favor intente nuevamente con un artículo más simple o intente más tarde.');
|
| 371 |
} else if (data.error === 'connection') {
|
| 372 |
+
showError('No se pudo conectar con el servicio de análisis. Por favor verifique su conexión e intente nuevamente.');
|
| 373 |
} else {
|
| 374 |
+
showError(data.result || 'Ocurrió un error durante el análisis.');
|
| 375 |
}
|
| 376 |
stopAnalysis();
|
| 377 |
return;
|
| 378 |
}
|
| 379 |
|
| 380 |
+
// Mostrar resultados
|
| 381 |
resultDiv.innerHTML = marked.parse(data.result);
|
| 382 |
resultContainer.classList.remove('hidden');
|
| 383 |
stopAnalysis();
|
| 384 |
|
| 385 |
+
// Hacer scroll a los resultados
|
| 386 |
resultContainer.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
| 387 |
|
| 388 |
} catch (error) {
|
| 389 |
+
showError('Error al analizar la URL. Por favor intente más tarde.');
|
| 390 |
console.error('Error:', error);
|
| 391 |
stopAnalysis();
|
| 392 |
}
|
|
|
|
| 398 |
analyzeBtn.disabled = true;
|
| 399 |
analysisStartTime = Date.now();
|
| 400 |
|
| 401 |
+
// Actualizar timer cada segundo
|
| 402 |
timerInterval = setInterval(() => {
|
| 403 |
const elapsed = Date.now() - analysisStartTime;
|
| 404 |
const minutes = Math.floor(elapsed / 60000);
|
| 405 |
const seconds = Math.floor((elapsed % 60000) / 1000);
|
| 406 |
+
progressTimer.textContent = `Tiempo transcurrido: ${minutes}:${seconds.toString().padStart(2, '0')}`;
|
| 407 |
}, 1000);
|
| 408 |
}
|
| 409 |
|
|
|
|
| 435 |
errorMessage.classList.add('hidden');
|
| 436 |
}
|
| 437 |
|
| 438 |
+
// Permitir presionar Enter en el campo de entrada
|
| 439 |
inputUrl.addEventListener('keypress', (e) => {
|
| 440 |
if (e.key === 'Enter' && !analyzeBtn.disabled) {
|
| 441 |
analyzeBtn.click();
|
| 442 |
}
|
| 443 |
});
|
| 444 |
|
| 445 |
+
// URLs de ejemplo para pruebas
|
| 446 |
const exampleUrls = [
|
| 447 |
'https://example.com/news-article',
|
| 448 |
'https://bbc.com/news/article-123',
|
| 449 |
'https://cnn.com/2025/01/article'
|
| 450 |
];
|
| 451 |
|
| 452 |
+
// Agregar URL de ejemplo con doble clic (para pruebas)
|
| 453 |
inputUrl.addEventListener('dblclick', () => {
|
| 454 |
inputUrl.value = exampleUrls[Math.floor(Math.random() * exampleUrls.length)];
|
| 455 |
});
|