Spaces:
Running
Running
Update index.html
Browse files- index.html +13 -0
index.html
CHANGED
|
@@ -189,6 +189,9 @@
|
|
| 189 |
<span class="text-green-400">ECOTAGS</span>
|
| 190 |
</h1>
|
| 191 |
|
|
|
|
|
|
|
|
|
|
| 192 |
<div id="mainAuthButtons" class="flex items-center">
|
| 193 |
<button id="mainLoginButton" class="bg-blue-600 text-white px-3 py-1 rounded text-sm mr-2" title="Iniciar sesión">Iniciar sesión</button>
|
| 194 |
<button id="mainLogoutButton" class="bg-red-600 text-white px-3 py-1 rounded text-sm mr-2" style="display:none" title="Cerrar sesión">Cerrar sesión</button>
|
|
@@ -395,6 +398,7 @@
|
|
| 395 |
const anonymousLoginButton = document.getElementById('anonymousLoginButton');
|
| 396 |
const mainLoginButton = document.getElementById('mainLoginButton');
|
| 397 |
const mainLogoutButton = document.getElementById('mainLogoutButton');
|
|
|
|
| 398 |
|
| 399 |
// show/hide password
|
| 400 |
showPasswordCheck.addEventListener('change', () => {
|
|
@@ -600,6 +604,11 @@
|
|
| 600 |
isAuthReady = true;
|
| 601 |
isAnonymous = user.isAnonymous;
|
| 602 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 603 |
if (user.isAnonymous) {
|
| 604 |
console.log("Usuario es anónimo.");
|
| 605 |
userProfile = { username: "Anónimo" };
|
|
@@ -639,6 +648,10 @@
|
|
| 639 |
|
| 640 |
mainLoginButton.style.display = 'inline-block';
|
| 641 |
mainLogoutButton.style.display = 'none';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 642 |
}
|
| 643 |
});
|
| 644 |
} catch (error) {
|
|
|
|
| 189 |
<span class="text-green-400">ECOTAGS</span>
|
| 190 |
</h1>
|
| 191 |
|
| 192 |
+
<div class="flex items-center gap-2">
|
| 193 |
+
<span id="authStatus" class="text-xs text-gray-300 hidden"></span>
|
| 194 |
+
</div>
|
| 195 |
<div id="mainAuthButtons" class="flex items-center">
|
| 196 |
<button id="mainLoginButton" class="bg-blue-600 text-white px-3 py-1 rounded text-sm mr-2" title="Iniciar sesión">Iniciar sesión</button>
|
| 197 |
<button id="mainLogoutButton" class="bg-red-600 text-white px-3 py-1 rounded text-sm mr-2" style="display:none" title="Cerrar sesión">Cerrar sesión</button>
|
|
|
|
| 398 |
const anonymousLoginButton = document.getElementById('anonymousLoginButton');
|
| 399 |
const mainLoginButton = document.getElementById('mainLoginButton');
|
| 400 |
const mainLogoutButton = document.getElementById('mainLogoutButton');
|
| 401 |
+
const authStatus = document.getElementById('authStatus');
|
| 402 |
|
| 403 |
// show/hide password
|
| 404 |
showPasswordCheck.addEventListener('change', () => {
|
|
|
|
| 604 |
isAuthReady = true;
|
| 605 |
isAnonymous = user.isAnonymous;
|
| 606 |
|
| 607 |
+
if (authStatus) {
|
| 608 |
+
authStatus.classList.remove('hidden');
|
| 609 |
+
authStatus.textContent = isAnonymous ? 'Estado: Anónimo' : `Estado: Autenticado (${user.email || 'Google'})`;
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
if (user.isAnonymous) {
|
| 613 |
console.log("Usuario es anónimo.");
|
| 614 |
userProfile = { username: "Anónimo" };
|
|
|
|
| 648 |
|
| 649 |
mainLoginButton.style.display = 'inline-block';
|
| 650 |
mainLogoutButton.style.display = 'none';
|
| 651 |
+
if (authStatus) {
|
| 652 |
+
authStatus.textContent = 'Estado: No autenticado';
|
| 653 |
+
authStatus.classList.remove('hidden');
|
| 654 |
+
}
|
| 655 |
}
|
| 656 |
});
|
| 657 |
} catch (error) {
|