Spaces:
Running
Running
yo why doesnt the laguage translator and currency exchange options not pop up (fix it now)
Browse files- index.html +60 -6
index.html
CHANGED
|
@@ -86,15 +86,27 @@
|
|
| 86 |
</div>
|
| 87 |
<div class="flex items-center space-x-4">
|
| 88 |
<div class="relative group">
|
| 89 |
-
<button class="flex items-center space-x-1 bg-black bg-opacity-50 px-3 py-2 rounded-lg border border-yellow-500">
|
| 90 |
<i data-feather="globe" class="text-yellow-500"></i>
|
| 91 |
<span class="text-white">EN</span>
|
| 92 |
</button>
|
| 93 |
-
<div class="absolute right-0 mt-2 w-48 bg-black border border-yellow-500 rounded-lg shadow-lg py-1 z-20 hidden
|
| 94 |
-
<a href="#" class="block px-4 py-2 text-white hover:bg-yellow-500 hover:text-black">English</a>
|
| 95 |
-
<a href="#" class="block px-4 py-2 text-white hover:bg-yellow-500 hover:text-black">Español</a>
|
| 96 |
-
<a href="#" class="block px-4 py-2 text-white hover:bg-yellow-500 hover:text-black">Français</a>
|
| 97 |
-
<a href="#" class="block px-4 py-2 text-white hover:bg-yellow-500 hover:text-black">Deutsch</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
</div>
|
| 99 |
</div>
|
| 100 |
|
|
@@ -504,6 +516,48 @@
|
|
| 504 |
</footer>
|
| 505 |
|
| 506 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 507 |
// Performance Dashboard Animation
|
| 508 |
document.addEventListener('DOMContentLoaded', function() {
|
| 509 |
const metrics = ['confidence-level', 'stress-level', 'focus-level'];
|
|
|
|
| 86 |
</div>
|
| 87 |
<div class="flex items-center space-x-4">
|
| 88 |
<div class="relative group">
|
| 89 |
+
<button id="language-btn" class="flex items-center space-x-1 bg-black bg-opacity-50 px-3 py-2 rounded-lg border border-yellow-500">
|
| 90 |
<i data-feather="globe" class="text-yellow-500"></i>
|
| 91 |
<span class="text-white">EN</span>
|
| 92 |
</button>
|
| 93 |
+
<div id="language-dropdown" class="absolute right-0 mt-2 w-48 bg-black border border-yellow-500 rounded-lg shadow-lg py-1 z-20 hidden">
|
| 94 |
+
<a href="#" class="block px-4 py-2 text-white hover:bg-yellow-500 hover:text-black" data-lang="en">English</a>
|
| 95 |
+
<a href="#" class="block px-4 py-2 text-white hover:bg-yellow-500 hover:text-black" data-lang="es">Español</a>
|
| 96 |
+
<a href="#" class="block px-4 py-2 text-white hover:bg-yellow-500 hover:text-black" data-lang="fr">Français</a>
|
| 97 |
+
<a href="#" class="block px-4 py-2 text-white hover:bg-yellow-500 hover:text-black" data-lang="de">Deutsch</a>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
<div class="relative group ml-2">
|
| 101 |
+
<button id="currency-btn" class="flex items-center space-x-1 bg-black bg-opacity-50 px-3 py-2 rounded-lg border border-blue-500">
|
| 102 |
+
<i data-feather="dollar-sign" class="text-blue-500"></i>
|
| 103 |
+
<span class="text-white">USD</span>
|
| 104 |
+
</button>
|
| 105 |
+
<div id="currency-dropdown" class="absolute right-0 mt-2 w-48 bg-black border border-blue-500 rounded-lg shadow-lg py-1 z-20 hidden">
|
| 106 |
+
<a href="#" class="block px-4 py-2 text-white hover:bg-blue-500 hover:text-black" data-currency="USD">USD ($)</a>
|
| 107 |
+
<a href="#" class="block px-4 py-2 text-white hover:bg-blue-500 hover:text-black" data-currency="EUR">EUR (€)</a>
|
| 108 |
+
<a href="#" class="block px-4 py-2 text-white hover:bg-blue-500 hover:text-black" data-currency="GBP">GBP (£)</a>
|
| 109 |
+
<a href="#" class="block px-4 py-2 text-white hover:bg-blue-500 hover:text-black" data-currency="JPY">JPY (¥)</a>
|
| 110 |
</div>
|
| 111 |
</div>
|
| 112 |
|
|
|
|
| 516 |
</footer>
|
| 517 |
|
| 518 |
<script>
|
| 519 |
+
// Dropdown Toggle Logic
|
| 520 |
+
document.getElementById('language-btn').addEventListener('click', function(e) {
|
| 521 |
+
e.stopPropagation();
|
| 522 |
+
const dropdown = document.getElementById('language-dropdown');
|
| 523 |
+
const currencyDropdown = document.getElementById('currency-dropdown');
|
| 524 |
+
dropdown.classList.toggle('hidden');
|
| 525 |
+
currencyDropdown.classList.add('hidden');
|
| 526 |
+
});
|
| 527 |
+
|
| 528 |
+
document.getElementById('currency-btn').addEventListener('click', function(e) {
|
| 529 |
+
e.stopPropagation();
|
| 530 |
+
const dropdown = document.getElementById('currency-dropdown');
|
| 531 |
+
const languageDropdown = document.getElementById('language-dropdown');
|
| 532 |
+
dropdown.classList.toggle('hidden');
|
| 533 |
+
languageDropdown.classList.add('hidden');
|
| 534 |
+
});
|
| 535 |
+
|
| 536 |
+
// Close dropdowns when clicking outside
|
| 537 |
+
document.addEventListener('click', function() {
|
| 538 |
+
document.getElementById('language-dropdown').classList.add('hidden');
|
| 539 |
+
document.getElementById('currency-dropdown').classList.add('hidden');
|
| 540 |
+
});
|
| 541 |
+
|
| 542 |
+
// Language and currency change handlers
|
| 543 |
+
document.querySelectorAll('#language-dropdown a').forEach(item => {
|
| 544 |
+
item.addEventListener('click', function(e) {
|
| 545 |
+
e.preventDefault();
|
| 546 |
+
const lang = this.getAttribute('data-lang');
|
| 547 |
+
document.getElementById('language-btn').querySelector('span').textContent = lang.toUpperCase();
|
| 548 |
+
// Here you would add actual language change logic
|
| 549 |
+
});
|
| 550 |
+
});
|
| 551 |
+
|
| 552 |
+
document.querySelectorAll('#currency-dropdown a').forEach(item => {
|
| 553 |
+
item.addEventListener('click', function(e) {
|
| 554 |
+
e.preventDefault();
|
| 555 |
+
const currency = this.getAttribute('data-currency');
|
| 556 |
+
document.getElementById('currency-btn').querySelector('span').textContent = currency;
|
| 557 |
+
// Here you would add actual currency conversion logic
|
| 558 |
+
});
|
| 559 |
+
});
|
| 560 |
+
|
| 561 |
// Performance Dashboard Animation
|
| 562 |
document.addEventListener('DOMContentLoaded', function() {
|
| 563 |
const metrics = ['confidence-level', 'stress-level', 'focus-level'];
|