Spaces:
Runtime error
Runtime error
ui: rename account chooser and open list upwards to avoid viewport cutoff
Browse files- Change label from 'Demo Accounts' to 'Choose Account'
- Make account dropdown open upwards (bottom: 100%) with proper animation
- Adjust toggle texts accordingly
- Increase z-index to ensure it overlays the container
- static/login.html +8 -8
static/login.html
CHANGED
|
@@ -184,17 +184,17 @@
|
|
| 184 |
|
| 185 |
.accounts-dropdown {
|
| 186 |
position: absolute;
|
| 187 |
-
|
| 188 |
left: 0;
|
| 189 |
right: 0;
|
| 190 |
background: white;
|
| 191 |
border: 1px solid var(--gray-200);
|
| 192 |
border-radius: var(--radius-xl);
|
| 193 |
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
|
| 194 |
-
z-index:
|
| 195 |
overflow: hidden;
|
| 196 |
opacity: 0;
|
| 197 |
-
transform: translateY(
|
| 198 |
transition: all 0.2s ease;
|
| 199 |
pointer-events: none;
|
| 200 |
}
|
|
@@ -333,7 +333,7 @@
|
|
| 333 |
|
| 334 |
<div class="demo-accounts">
|
| 335 |
<button class="demo-toggle" id="demoToggle" onclick="toggleDemoAccounts()">
|
| 336 |
-
|
| 337 |
</button>
|
| 338 |
|
| 339 |
<div class="accounts-dropdown" id="accountsDropdown">
|
|
@@ -368,10 +368,10 @@
|
|
| 368 |
|
| 369 |
if (dropdown.classList.contains('show')) {
|
| 370 |
dropdown.classList.remove('show');
|
| 371 |
-
toggle.textContent = '
|
| 372 |
} else {
|
| 373 |
dropdown.classList.add('show');
|
| 374 |
-
toggle.textContent = 'Hide
|
| 375 |
}
|
| 376 |
}
|
| 377 |
|
|
@@ -384,7 +384,7 @@
|
|
| 384 |
const dropdown = document.getElementById('accountsDropdown');
|
| 385 |
const toggle = document.getElementById('demoToggle');
|
| 386 |
dropdown.classList.remove('show');
|
| 387 |
-
toggle.textContent = '
|
| 388 |
|
| 389 |
// Visual feedback on selection
|
| 390 |
const button = event.target.closest('.account-item');
|
|
@@ -408,7 +408,7 @@
|
|
| 408 |
|
| 409 |
if (!demoSection.contains(event.target) && dropdown.classList.contains('show')) {
|
| 410 |
dropdown.classList.remove('show');
|
| 411 |
-
document.getElementById('demoToggle').textContent = '
|
| 412 |
}
|
| 413 |
});
|
| 414 |
|
|
|
|
| 184 |
|
| 185 |
.accounts-dropdown {
|
| 186 |
position: absolute;
|
| 187 |
+
bottom: 100%; /* open upwards to avoid being cut off at the bottom */
|
| 188 |
left: 0;
|
| 189 |
right: 0;
|
| 190 |
background: white;
|
| 191 |
border: 1px solid var(--gray-200);
|
| 192 |
border-radius: var(--radius-xl);
|
| 193 |
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
|
| 194 |
+
z-index: 20;
|
| 195 |
overflow: hidden;
|
| 196 |
opacity: 0;
|
| 197 |
+
transform: translateY(10px); /* animate from below upwards */
|
| 198 |
transition: all 0.2s ease;
|
| 199 |
pointer-events: none;
|
| 200 |
}
|
|
|
|
| 333 |
|
| 334 |
<div class="demo-accounts">
|
| 335 |
<button class="demo-toggle" id="demoToggle" onclick="toggleDemoAccounts()">
|
| 336 |
+
Choose Account β
|
| 337 |
</button>
|
| 338 |
|
| 339 |
<div class="accounts-dropdown" id="accountsDropdown">
|
|
|
|
| 368 |
|
| 369 |
if (dropdown.classList.contains('show')) {
|
| 370 |
dropdown.classList.remove('show');
|
| 371 |
+
toggle.textContent = 'Choose Account β';
|
| 372 |
} else {
|
| 373 |
dropdown.classList.add('show');
|
| 374 |
+
toggle.textContent = 'Hide Accounts β';
|
| 375 |
}
|
| 376 |
}
|
| 377 |
|
|
|
|
| 384 |
const dropdown = document.getElementById('accountsDropdown');
|
| 385 |
const toggle = document.getElementById('demoToggle');
|
| 386 |
dropdown.classList.remove('show');
|
| 387 |
+
toggle.textContent = 'Choose Account β';
|
| 388 |
|
| 389 |
// Visual feedback on selection
|
| 390 |
const button = event.target.closest('.account-item');
|
|
|
|
| 408 |
|
| 409 |
if (!demoSection.contains(event.target) && dropdown.classList.contains('show')) {
|
| 410 |
dropdown.classList.remove('show');
|
| 411 |
+
document.getElementById('demoToggle').textContent = 'Choose Account β';
|
| 412 |
}
|
| 413 |
});
|
| 414 |
|