Spaces:
Running
Running
Il tasto della lingua (IT/EN) non funziona - Follow Up Deployment
Browse files- index.html +58 -15
index.html
CHANGED
|
@@ -63,10 +63,16 @@
|
|
| 63 |
<button class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md font-medium transition duration-300">
|
| 64 |
Sign Up
|
| 65 |
</button>
|
| 66 |
-
<
|
| 67 |
-
<
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
<button class="md:hidden text-gray-700" id="mobile-menu-button">
|
| 71 |
<i class="fas fa-bars text-xl"></i>
|
| 72 |
</button>
|
|
@@ -78,9 +84,15 @@
|
|
| 78 |
<a href="#how-it-works" class="block py-2 text-gray-700 hover:text-green-600">How It Works</a>
|
| 79 |
<a href="#courses" class="block py-2 text-gray-700 hover:text-green-600">Courses</a>
|
| 80 |
<a href="#testimonials" class="block py-2 text-gray-700 hover:text-green-600">Testimonials</a>
|
| 81 |
-
<div class="
|
| 82 |
-
<
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
</div>
|
| 85 |
</div>
|
| 86 |
</nav>
|
|
@@ -546,16 +558,47 @@
|
|
| 546 |
|
| 547 |
<!-- Language Switcher Script -->
|
| 548 |
<script>
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 557 |
});
|
| 558 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 559 |
</script>
|
| 560 |
|
| 561 |
<!-- Mobile Menu Toggle Script -->
|
|
|
|
| 63 |
<button class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md font-medium transition duration-300">
|
| 64 |
Sign Up
|
| 65 |
</button>
|
| 66 |
+
<div class="relative">
|
| 67 |
+
<button id="language-switcher" class="flex items-center space-x-1 bg-gray-100 hover:bg-gray-200 px-3 py-2 rounded-md transition duration-300">
|
| 68 |
+
<i class="fas fa-globe text-gray-700"></i>
|
| 69 |
+
<span class="text-sm font-medium">IT/EN</span>
|
| 70 |
+
</button>
|
| 71 |
+
<div id="language-dropdown" class="hidden absolute right-0 mt-2 w-32 bg-white rounded-md shadow-lg z-50">
|
| 72 |
+
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-lang="it">Italiano</a>
|
| 73 |
+
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" data-lang="en">English</a>
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
| 76 |
<button class="md:hidden text-gray-700" id="mobile-menu-button">
|
| 77 |
<i class="fas fa-bars text-xl"></i>
|
| 78 |
</button>
|
|
|
|
| 84 |
<a href="#how-it-works" class="block py-2 text-gray-700 hover:text-green-600">How It Works</a>
|
| 85 |
<a href="#courses" class="block py-2 text-gray-700 hover:text-green-600">Courses</a>
|
| 86 |
<a href="#testimonials" class="block py-2 text-gray-700 hover:text-green-600">Testimonials</a>
|
| 87 |
+
<div class="py-2">
|
| 88 |
+
<div class="flex items-center py-1">
|
| 89 |
+
<i class="fas fa-globe text-gray-700 mr-2"></i>
|
| 90 |
+
<a href="#" class="text-gray-700 hover:text-green-600" data-lang="it">Italiano</a>
|
| 91 |
+
</div>
|
| 92 |
+
<div class="flex items-center py-1">
|
| 93 |
+
<i class="fas fa-globe text-gray-700 mr-2"></i>
|
| 94 |
+
<a href="#" class="text-gray-700 hover:text-green-600" data-lang="en">English</a>
|
| 95 |
+
</div>
|
| 96 |
</div>
|
| 97 |
</div>
|
| 98 |
</nav>
|
|
|
|
| 558 |
|
| 559 |
<!-- Language Switcher Script -->
|
| 560 |
<script>
|
| 561 |
+
// Toggle dropdown menu
|
| 562 |
+
document.getElementById('language-switcher').addEventListener('click', function(e) {
|
| 563 |
+
e.stopPropagation();
|
| 564 |
+
document.getElementById('language-dropdown').classList.toggle('hidden');
|
| 565 |
+
});
|
| 566 |
+
|
| 567 |
+
// Close dropdown when clicking elsewhere
|
| 568 |
+
document.addEventListener('click', function() {
|
| 569 |
+
document.getElementById('language-dropdown').classList.add('hidden');
|
| 570 |
+
});
|
| 571 |
+
|
| 572 |
+
// Handle language selection
|
| 573 |
+
document.querySelectorAll('[data-lang]').forEach(link => {
|
| 574 |
+
link.addEventListener('click', function(e) {
|
| 575 |
+
e.preventDefault();
|
| 576 |
+
const lang = this.getAttribute('data-lang');
|
| 577 |
+
|
| 578 |
+
// In a real implementation, you would:
|
| 579 |
+
// 1. Store the language preference in localStorage
|
| 580 |
+
localStorage.setItem('preferredLanguage', lang);
|
| 581 |
+
|
| 582 |
+
// 2. Either:
|
| 583 |
+
// - Reload the page with the new language version
|
| 584 |
+
// - Or fetch translations via AJAX and update the page
|
| 585 |
+
|
| 586 |
+
// For this example, we'll just show a confirmation
|
| 587 |
+
alert(`Language changed to ${lang === 'it' ? 'Italian' : 'English'}. In a real implementation, the page would update.`);
|
| 588 |
+
|
| 589 |
+
// Close dropdown
|
| 590 |
+
document.getElementById('language-dropdown').classList.add('hidden');
|
| 591 |
});
|
| 592 |
});
|
| 593 |
+
|
| 594 |
+
// Check for saved language preference on page load
|
| 595 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 596 |
+
const preferredLanguage = localStorage.getItem('preferredLanguage');
|
| 597 |
+
if (preferredLanguage) {
|
| 598 |
+
// In a real app, you would load the appropriate language here
|
| 599 |
+
console.log(`Preferred language: ${preferredLanguage}`);
|
| 600 |
+
}
|
| 601 |
+
});
|
| 602 |
</script>
|
| 603 |
|
| 604 |
<!-- Mobile Menu Toggle Script -->
|