Spaces:
Running
Running
Update index.html
Browse files- index.html +14 -2
index.html
CHANGED
|
@@ -163,7 +163,6 @@
|
|
| 163 |
<div class="flex flex-col space-y-2 mt-6">
|
| 164 |
<button id="loginButton" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300">Entrar</button>
|
| 165 |
<button id="registerButton" class="w-full bg-gray-600 hover:bg-gray-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300">Registrar</button>
|
| 166 |
-
<button id="googleLoginButton" class="w-full bg-red-600 hover:bg-red-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300">Entrar con Google</button>
|
| 167 |
<button id="anonymousLoginButton" class="w-full bg-gray-900 hover:bg-black text-blue-300 font-bold py-3 px-4 rounded-lg transition duration-300 border border-gray-700">Explorar como Anónimo</button>
|
| 168 |
</div>
|
| 169 |
</div>
|
|
@@ -298,8 +297,16 @@
|
|
| 298 |
};
|
| 299 |
|
| 300 |
// --- Gemini API Key helpers (local fallback) ---
|
|
|
|
|
|
|
|
|
|
| 301 |
function getLocalGeminiKey() {
|
| 302 |
-
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
}
|
| 304 |
function setLocalGeminiKey(k) {
|
| 305 |
try { localStorage.setItem('GEMINI_API_KEY', k || ''); } catch {}
|
|
@@ -372,6 +379,11 @@
|
|
| 372 |
geminiKeyStatus.textContent = 'Clave guardada localmente';
|
| 373 |
setTimeout(() => { geminiKeyStatus.textContent = ''; }, 2000);
|
| 374 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 375 |
}
|
| 376 |
|
| 377 |
async function initFirebase() {
|
|
|
|
| 163 |
<div class="flex flex-col space-y-2 mt-6">
|
| 164 |
<button id="loginButton" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300">Entrar</button>
|
| 165 |
<button id="registerButton" class="w-full bg-gray-600 hover:bg-gray-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300">Registrar</button>
|
|
|
|
| 166 |
<button id="anonymousLoginButton" class="w-full bg-gray-900 hover:bg-black text-blue-300 font-bold py-3 px-4 rounded-lg transition duration-300 border border-gray-700">Explorar como Anónimo</button>
|
| 167 |
</div>
|
| 168 |
</div>
|
|
|
|
| 297 |
};
|
| 298 |
|
| 299 |
// --- Gemini API Key helpers (local fallback) ---
|
| 300 |
+
// ADVERTENCIA: Incluir una clave por defecto en el cliente la expone públicamente.
|
| 301 |
+
// Úsalo solo si entiendes los riesgos. Recomendado: guardar por UI o usar backend con Secrets.
|
| 302 |
+
const DEFAULT_GEMINI_KEY = 'AIzaSyDmoQNpzgzW21f_WFCU9YbaAeI1fdOJMlo';
|
| 303 |
function getLocalGeminiKey() {
|
| 304 |
+
try {
|
| 305 |
+
const k = localStorage.getItem('GEMINI_API_KEY') || '';
|
| 306 |
+
return k || DEFAULT_GEMINI_KEY;
|
| 307 |
+
} catch {
|
| 308 |
+
return DEFAULT_GEMINI_KEY;
|
| 309 |
+
}
|
| 310 |
}
|
| 311 |
function setLocalGeminiKey(k) {
|
| 312 |
try { localStorage.setItem('GEMINI_API_KEY', k || ''); } catch {}
|
|
|
|
| 379 |
geminiKeyStatus.textContent = 'Clave guardada localmente';
|
| 380 |
setTimeout(() => { geminiKeyStatus.textContent = ''; }, 2000);
|
| 381 |
});
|
| 382 |
+
// Mostrar aviso si se está usando la clave por defecto embebida
|
| 383 |
+
if (!localStorage.getItem('GEMINI_API_KEY')) {
|
| 384 |
+
geminiKeyStatus.textContent = 'Usando clave por defecto embebida (no recomendado)';
|
| 385 |
+
setTimeout(() => { geminiKeyStatus.textContent = ''; }, 4000);
|
| 386 |
+
}
|
| 387 |
}
|
| 388 |
|
| 389 |
async function initFirebase() {
|