fmlemos commited on
Commit
fe2eb79
·
verified ·
1 Parent(s): 620eb46

Add 1 files

Browse files
Files changed (1) hide show
  1. index.html +162 -178
index.html CHANGED
@@ -7,261 +7,245 @@
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
  <style>
10
- /* Custom animations */
 
 
 
 
 
 
 
 
 
11
  @keyframes fadeIn {
12
  from { opacity: 0; transform: translateY(10px); }
13
  to { opacity: 1; transform: translateY(0); }
14
  }
15
 
16
- .page-transition {
17
- animation: fadeIn 0.5s ease-out forwards;
18
- }
19
-
20
  /* Custom active nav link style */
21
  .nav-link.active {
22
- position: relative;
 
23
  }
24
 
25
- .nav-link.active::after {
26
- content: '';
27
- position: absolute;
28
- bottom: -5px;
29
- left: 0;
30
- width: 100%;
31
- height: 2px;
32
- background-color: #3b82f6;
33
- border-radius: 2px;
34
  }
35
  </style>
36
  </head>
37
- <body class="bg-gray-50 min-h-screen flex flex-col">
38
- <!-- Navigation -->
39
  <nav class="bg-white shadow-lg sticky top-0 z-10">
40
- <div class="container mx-auto px-4 py-3">
41
- <div class="flex justify-between items-center">
42
- <div class="text-2xl font-bold text-blue-600 flex items-center">
43
- <i class="fas fa-globe mr-2"></i>
44
- <span>MultiPage</span>
45
  </div>
46
-
47
- <div class="hidden md:flex space-x-6">
48
- <a href="#" class="nav-link active text-blue-600 font-medium" data-page="page1">Initial Page</a>
49
- <a href="#" class="nav-link text-gray-600 hover:text-blue-600 transition font-medium" data-page="page2">Second Page</a>
50
- <a href="#" class="nav-link text-gray-600 hover:text-blue-600 transition font-medium" data-page="page3">Third Page</a>
 
 
 
 
 
51
  </div>
52
-
53
- <button class="md:hidden text-gray-600 focus:outline-none" id="mobile-menu-button">
54
  <i class="fas fa-bars text-2xl"></i>
55
  </button>
56
  </div>
57
-
58
- <!-- Mobile menu -->
59
- <div class="md:hidden hidden py-2" id="mobile-menu">
60
- <a href="#" class="block nav-link active text-blue-600 py-2 px-4" data-page="page1">Initial Page</a>
61
- <a href="#" class="block nav-link text-gray-600 hover:text-blue-600 py-2 px-4" data-page="page2">Second Page</a>
62
- <a href="#" class="block nav-link text-gray-600 hover:text-blue-600 py-2 px-4" data-page="page3">Third Page</a>
 
 
 
 
 
63
  </div>
64
  </div>
65
  </nav>
66
 
67
  <!-- Page Content -->
68
- <main class="flex-grow container mx-auto px-4 py-8">
69
- <!-- Page 1 (Initial Page) - Default visible -->
70
- <div id="page1" class="page-content page-transition">
71
- <div class="max-w-3xl mx-auto text-center">
72
- <h1 class="text-4xl md:text-5xl font-bold text-gray-800 mb-6">Initial Page</h1>
73
- <p class="text-xl text-gray-600 mb-8">Welcome to the first page of our multi-page application.</p>
74
- <div class="bg-white rounded-xl shadow-md p-6 mb-8">
75
- <div class="flex items-center justify-center mb-4">
76
- <i class="fas fa-star text-yellow-400 text-4xl mr-3"></i>
77
- <h2 class="text-2xl font-semibold text-gray-700">Featured Content</h2>
78
- </div>
79
- <p class="text-gray-600 mb-4">This is a demonstration of a multi-page application using a single HTML file with JavaScript-powered navigation.</p>
80
- <button class="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-6 rounded-lg transition">
81
- Learn More
82
- </button>
83
  </div>
84
- <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
85
- <div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
86
  <i class="fas fa-rocket text-blue-500 text-3xl mb-4"></i>
87
  <h3 class="text-xl font-semibold mb-2">Fast Navigation</h3>
88
- <p class="text-gray-600">Instant page switching without full reloads.</p>
89
  </div>
90
- <div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
91
  <i class="fas fa-mobile-alt text-green-500 text-3xl mb-4"></i>
92
  <h3 class="text-xl font-semibold mb-2">Responsive Design</h3>
93
  <p class="text-gray-600">Works perfectly on all device sizes.</p>
94
  </div>
95
- <div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
96
- <i class="fas fa-paint-brush text-purple-500 text-3xl mb-4"></i>
97
  <h3 class="text-xl font-semibold mb-2">Beautiful UI</h3>
98
- <p class="text-gray-600">Modern design with smooth animations.</p>
99
  </div>
100
  </div>
101
  </div>
102
  </div>
103
 
104
- <!-- Page 2 (Second Page) - Hidden by default -->
105
- <div id="page2" class="page-content hidden">
106
- <div class="max-w-3xl mx-auto text-center">
107
- <h1 class="text-4xl md:text-5xl font-bold text-gray-800 mb-6">Second Page</h1>
108
- <p class="text-xl text-gray-600 mb-8">You've reached the second page of our application.</p>
109
- <div class="bg-white rounded-xl shadow-md p-6 mb-8">
110
- <div class="flex items-center justify-center mb-4">
111
- <i class="fas fa-chart-line text-green-500 text-4xl mr-3"></i>
112
- <h2 class="text-2xl font-semibold text-gray-700">Performance Metrics</h2>
113
- </div>
114
- <div class="w-full bg-gray-200 rounded-full h-4 mb-4">
115
- <div class="bg-green-500 h-4 rounded-full" style="width: 75%"></div>
116
- </div>
117
- <p class="text-gray-600 mb-4">Our system is running at optimal performance levels.</p>
118
- <button class="bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-6 rounded-lg transition">
119
- View Stats
120
- </button>
121
  </div>
122
- <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
123
- <div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
124
- <i class="fas fa-cogs text-orange-500 text-3xl mb-4"></i>
125
- <h3 class="text-xl font-semibold mb-2">Advanced Settings</h3>
126
- <p class="text-gray-600">Customize your experience with our powerful tools.</p>
 
 
 
 
 
 
 
 
 
 
 
 
127
  </div>
128
- <div class="bg-white p-6 rounded-lg shadow hover:shadow-md transition">
129
- <i class="fas fa-shield-alt text-red-500 text-3xl mb-4"></i>
130
- <h3 class="text-xl font-semibold mb-2">Security Features</h3>
131
- <p class="text-gray-600">Your data is protected with enterprise-grade security.</p>
 
 
132
  </div>
133
  </div>
134
  </div>
135
  </div>
136
 
137
- <!-- Page 3 (Third Page) - Hidden by default -->
138
- <div id="page3" class="page-content hidden">
139
- <div class="max-w-3xl mx-auto text-center">
140
- <h1 class="text-4xl md:text-5xl font-bold text-gray-800 mb-6">Third Page</h3>
141
- <p class="text-xl text-gray-600 mb-8">This is the final page in our navigation demo.</p>
142
- <div class="bg-white rounded-xl shadow-md p-6 mb-8">
143
- <div class="flex items-center justify-center mb-4">
144
- <i class="fas fa-envelope text-purple-500 text-4xl mr-3"></i>
145
- <h2 class="text-2xl font-semibold text-gray-700">Contact Us</h2>
146
- </div>
147
- <form class="space-y-4 text-left">
148
  <div>
149
- <label for="name" class="block text-gray-700 mb-1">Name</label>
150
- <input type="text" id="name" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 outline-none transition">
151
  </div>
152
  <div>
153
- <label for="email" class="block text-gray-700 mb-1">Email</label>
154
- <input type="email" id="email" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 outline-none transition">
155
  </div>
156
  <div>
157
- <label for="message" class="block text-gray-700 mb-1">Message</label>
158
- <textarea id="message" rows="4" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 outline-none transition"></textarea>
159
  </div>
160
- <button type="submit" class="w-full bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-6 rounded-lg transition">
161
- Send Message
162
  </button>
163
  </form>
164
- </div>
165
- <div class="flex justify-center space-x-4">
166
- <a href="#" class="text-gray-600 hover:text-blue-500 transition">
167
- <i class="fab fa-facebook-f text-2xl"></i>
168
- </a>
169
- <a href="#" class="text-gray-600 hover:text-blue-400 transition">
170
- <i class="fab fa-twitter text-2xl"></i>
171
- </a>
172
- <a href="#" class="text-gray-600 hover:text-pink-500 transition">
173
- <i class="fab fa-instagram text-2xl"></i>
174
- </a>
175
- <a href="#" class="text-gray-600 hover:text-gray-800 transition">
176
- <i class="fab fa-github text-2xl"></i>
177
- </a>
178
  </div>
179
  </div>
180
  </div>
181
- </main>
182
 
183
  <!-- Footer -->
184
  <footer class="bg-gray-800 text-white py-8">
185
  <div class="container mx-auto px-4">
186
  <div class="flex flex-col md:flex-row justify-between items-center">
187
  <div class="mb-4 md:mb-0">
188
- <h3 class="text-xl font-bold mb-2">MultiPage App</h3>
189
- <p class="text-gray-400">A demonstration of single-file multi-page navigation.</p>
 
 
 
190
  </div>
191
- <div class="flex space-x-6">
192
- <a href="#" class="text-gray-400 hover:text-white transition">Privacy Policy</a>
193
- <a href="#" class="text-gray-400 hover:text-white transition">Terms of Service</a>
194
- <a href="#" class="text-gray-400 hover:text-white transition">Contact</a>
 
 
 
 
 
 
 
 
 
195
  </div>
196
  </div>
197
  <div class="border-t border-gray-700 mt-6 pt-6 text-center text-gray-400">
198
- <p>&copy; 2023 MultiPage App. All rights reserved.</p>
199
  </div>
200
  </div>
201
  </footer>
202
 
203
  <script>
204
- document.addEventListener('DOMContentLoaded', function() {
205
- // Mobile menu toggle
206
- const mobileMenuButton = document.getElementById('mobile-menu-button');
207
- const mobileMenu = document.getElementById('mobile-menu');
208
-
209
- mobileMenuButton.addEventListener('click', function() {
210
- mobileMenu.classList.toggle('hidden');
211
  });
212
 
213
- // Navigation functionality
214
- const navLinks = document.querySelectorAll('.nav-link');
215
- const pageContents = document.querySelectorAll('.page-content');
216
 
217
- function showPage(pageId) {
218
- // Hide all pages
219
- pageContents.forEach(page => {
220
- page.classList.add('hidden');
221
- });
222
-
223
- // Show selected page
224
- const activePage = document.getElementById(pageId);
225
- activePage.classList.remove('hidden');
226
- activePage.classList.add('page-transition');
227
-
228
- // Update active nav link
229
- navLinks.forEach(link => {
230
- link.classList.remove('active', 'text-blue-600');
231
- link.classList.add('text-gray-600');
232
-
233
- if (link.dataset.page === pageId) {
234
- link.classList.add('active', 'text-blue-600');
235
- link.classList.remove('text-gray-600');
236
- }
237
- });
238
-
239
- // Close mobile menu if open
240
- mobileMenu.classList.add('hidden');
241
-
242
- // Scroll to top
243
- window.scrollTo(0, 0);
244
- }
245
 
246
- // Add click event to all nav links
247
- navLinks.forEach(link => {
248
- link.addEventListener('click', function(e) {
249
- e.preventDefault();
250
- const pageId = this.dataset.page;
251
- showPage(pageId);
252
- });
 
 
253
  });
 
254
 
255
- // Show page1 by default
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  showPage('page1');
257
-
258
- // Remove transition class after animation completes
259
- setTimeout(() => {
260
- const pages = document.querySelectorAll('.page-content');
261
- pages.forEach(page => {
262
- page.classList.remove('page-transition');
263
- });
264
- }, 500);
265
  });
266
  </script>
267
  </body>
 
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
  <style>
10
+ /* Custom CSS for page transitions */
11
+ .page {
12
+ display: none;
13
+ animation: fadeIn 0.5s ease-in-out;
14
+ }
15
+
16
+ .page.active {
17
+ display: block;
18
+ }
19
+
20
  @keyframes fadeIn {
21
  from { opacity: 0; transform: translateY(10px); }
22
  to { opacity: 1; transform: translateY(0); }
23
  }
24
 
 
 
 
 
25
  /* Custom active nav link style */
26
  .nav-link.active {
27
+ background-color: #3b82f6;
28
+ color: white;
29
  }
30
 
31
+ .nav-link.active:hover {
32
+ background-color: #2563eb;
 
 
 
 
 
 
 
33
  }
34
  </style>
35
  </head>
36
+ <body class="bg-gray-100 min-h-screen">
37
+ <!-- Navigation Bar -->
38
  <nav class="bg-white shadow-lg sticky top-0 z-10">
39
+ <div class="container mx-auto px-4">
40
+ <div class="flex justify-between items-center h-16">
41
+ <div class="flex items-center">
42
+ <i class="fas fa-globe text-blue-500 text-2xl mr-2"></i>
43
+ <span class="text-xl font-bold text-gray-800">MultiPage</span>
44
  </div>
45
+ <div class="hidden md:flex space-x-1">
46
+ <button onclick="showPage('page1')" id="nav-page1" class="nav-link active px-4 py-2 rounded-lg text-gray-700 hover:bg-blue-100 transition duration-300">
47
+ <i class="fas fa-home mr-2"></i>Page 1
48
+ </button>
49
+ <button onclick="showPage('page2')" id="nav-page2" class="nav-link px-4 py-2 rounded-lg text-gray-700 hover:bg-blue-100 transition duration-300">
50
+ <i class="fas fa-file-alt mr-2"></i>Page 2
51
+ </button>
52
+ <button onclick="showPage('page3')" id="nav-page3" class="nav-link px-4 py-2 rounded-lg text-gray-700 hover:bg-blue-100 transition duration-300">
53
+ <i class="fas fa-cog mr-2"></i>Page 3
54
+ </button>
55
  </div>
56
+ <button class="md:hidden text-gray-700" onclick="toggleMobileMenu()">
 
57
  <i class="fas fa-bars text-2xl"></i>
58
  </button>
59
  </div>
60
+ <!-- Mobile Menu -->
61
+ <div id="mobile-menu" class="md:hidden hidden pb-4">
62
+ <button onclick="showPage('page1')" class="nav-link-mobile active block w-full text-left px-4 py-2 rounded-lg text-gray-700 hover:bg-blue-100 transition duration-300 mb-1">
63
+ <i class="fas fa-home mr-2"></i>Page 1
64
+ </button>
65
+ <button onclick="showPage('page2')" class="nav-link-mobile block w-full text-left px-4 py-2 rounded-lg text-gray-700 hover:bg-blue-100 transition duration-300 mb-1">
66
+ <i class="fas fa-file-alt mr-2"></i>Page 2
67
+ </button>
68
+ <button onclick="showPage('page3')" class="nav-link-mobile block w-full text-left px-4 py-2 rounded-lg text-gray-700 hover:bg-blue-100 transition duration-300">
69
+ <i class="fas fa-cog mr-2"></i>Page 3
70
+ </button>
71
  </div>
72
  </div>
73
  </nav>
74
 
75
  <!-- Page Content -->
76
+ <div class="container mx-auto px-4 py-8">
77
+ <!-- Page 1 -->
78
+ <div id="page1" class="page active">
79
+ <div class="bg-white rounded-xl shadow-md overflow-hidden p-6">
80
+ <div class="text-center mb-8">
81
+ <h1 class="text-4xl font-bold text-blue-600 mb-4">Initial Page</h1>
82
+ <p class="text-gray-600 max-w-2xl mx-auto">Welcome to the first page of our multi-page website. This demonstrates how to create a seamless navigation experience without full page reloads.</p>
 
 
 
 
 
 
 
 
83
  </div>
84
+ <div class="grid md:grid-cols-3 gap-6">
85
+ <div class="bg-blue-50 p-6 rounded-lg border border-blue-100">
86
  <i class="fas fa-rocket text-blue-500 text-3xl mb-4"></i>
87
  <h3 class="text-xl font-semibold mb-2">Fast Navigation</h3>
88
+ <p class="text-gray-600">Smooth transitions between pages with JavaScript.</p>
89
  </div>
90
+ <div class="bg-green-50 p-6 rounded-lg border border-green-100">
91
  <i class="fas fa-mobile-alt text-green-500 text-3xl mb-4"></i>
92
  <h3 class="text-xl font-semibold mb-2">Responsive Design</h3>
93
  <p class="text-gray-600">Works perfectly on all device sizes.</p>
94
  </div>
95
+ <div class="bg-purple-50 p-6 rounded-lg border border-purple-100">
96
+ <i class="fas fa-palette text-purple-500 text-3xl mb-4"></i>
97
  <h3 class="text-xl font-semibold mb-2">Beautiful UI</h3>
98
+ <p class="text-gray-600">Built with TailwindCSS for modern styling.</p>
99
  </div>
100
  </div>
101
  </div>
102
  </div>
103
 
104
+ <!-- Page 2 -->
105
+ <div id="page2" class="page">
106
+ <div class="bg-white rounded-xl shadow-md overflow-hidden p-6">
107
+ <div class="text-center mb-8">
108
+ <h1 class="text-4xl font-bold text-green-600 mb-4">Second Page</h1>
109
+ <p class="text-gray-600 max-w-2xl mx-auto">This is the second page with different content and styling. Notice how the navigation updates automatically.</p>
 
 
 
 
 
 
 
 
 
 
 
110
  </div>
111
+ <div class="flex flex-col md:flex-row gap-6">
112
+ <div class="md:w-1/2 bg-green-50 p-6 rounded-lg">
113
+ <h3 class="text-2xl font-semibold mb-4 text-green-700">Features</h3>
114
+ <ul class="space-y-3">
115
+ <li class="flex items-start">
116
+ <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
117
+ <span>Interactive navigation</span>
118
+ </li>
119
+ <li class="flex items-start">
120
+ <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
121
+ <span>Animated page transitions</span>
122
+ </li>
123
+ <li class="flex items-start">
124
+ <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
125
+ <span>Mobile-friendly design</span>
126
+ </li>
127
+ </ul>
128
  </div>
129
+ <div class="md:w-1/2 bg-yellow-50 p-6 rounded-lg">
130
+ <h3 class="text-2xl font-semibold mb-4 text-yellow-700">How It Works</h3>
131
+ <p class="mb-4 text-gray-700">The JavaScript handles showing/hiding pages and updating the active navigation link when you switch between pages.</p>
132
+ <button onclick="showPage('page3')" class="bg-yellow-500 hover:bg-yellow-600 text-white px-4 py-2 rounded-lg transition duration-300">
133
+ <i class="fas fa-arrow-right mr-2"></i>Go to Page 3
134
+ </button>
135
  </div>
136
  </div>
137
  </div>
138
  </div>
139
 
140
+ <!-- Page 3 -->
141
+ <div id="page3" class="page">
142
+ <div class="bg-white rounded-xl shadow-md overflow-hidden p-6">
143
+ <div class="text-center mb-8">
144
+ <h1 class="text-4xl font-bold text-purple-600 mb-4">Third Page</h1>
145
+ <p class="text-gray-600 max-w-2xl mx-auto">Final page with contact information and additional options.</p>
146
+ </div>
147
+ <div class="max-w-md mx-auto bg-purple-50 rounded-xl p-6">
148
+ <h3 class="text-2xl font-semibold mb-4 text-center text-purple-700">Contact Us</h3>
149
+ <form class="space-y-4">
 
150
  <div>
151
+ <label class="block text-gray-700 mb-1">Name</label>
152
+ <input type="text" class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500">
153
  </div>
154
  <div>
155
+ <label class="block text-gray-700 mb-1">Email</label>
156
+ <input type="email" class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500">
157
  </div>
158
  <div>
159
+ <label class="block text-gray-700 mb-1">Message</label>
160
+ <textarea rows="4" class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500"></textarea>
161
  </div>
162
+ <button type="submit" class="w-full bg-purple-600 hover:bg-purple-700 text-white py-2 rounded-lg transition duration-300">
163
+ <i class="fas fa-paper-plane mr-2"></i>Send Message
164
  </button>
165
  </form>
166
+ <div class="mt-6 flex justify-center space-x-4">
167
+ <button onclick="showPage('page1')" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg transition duration-300">
168
+ <i class="fas fa-arrow-left mr-2"></i>Back to Page 1
169
+ </button>
170
+ </div>
 
 
 
 
 
 
 
 
 
171
  </div>
172
  </div>
173
  </div>
174
+ </div>
175
 
176
  <!-- Footer -->
177
  <footer class="bg-gray-800 text-white py-8">
178
  <div class="container mx-auto px-4">
179
  <div class="flex flex-col md:flex-row justify-between items-center">
180
  <div class="mb-4 md:mb-0">
181
+ <div class="flex items-center">
182
+ <i class="fas fa-globe text-blue-400 text-2xl mr-2"></i>
183
+ <span class="text-xl font-bold">MultiPage</span>
184
+ </div>
185
+ <p class="text-gray-400 mt-2">A beautiful multi-page website example</p>
186
  </div>
187
+ <div class="flex space-x-4">
188
+ <a href="#" class="text-gray-400 hover:text-white transition duration-300">
189
+ <i class="fab fa-facebook-f text-xl"></i>
190
+ </a>
191
+ <a href="#" class="text-gray-400 hover:text-white transition duration-300">
192
+ <i class="fab fa-twitter text-xl"></i>
193
+ </a>
194
+ <a href="#" class="text-gray-400 hover:text-white transition duration-300">
195
+ <i class="fab fa-instagram text-xl"></i>
196
+ </a>
197
+ <a href="#" class="text-gray-400 hover:text-white transition duration-300">
198
+ <i class="fab fa-github text-xl"></i>
199
+ </a>
200
  </div>
201
  </div>
202
  <div class="border-t border-gray-700 mt-6 pt-6 text-center text-gray-400">
203
+ <p>&copy; 2023 MultiPage Website. All rights reserved.</p>
204
  </div>
205
  </div>
206
  </footer>
207
 
208
  <script>
209
+ // Function to show a specific page and hide others
210
+ function showPage(pageId) {
211
+ // Hide all pages
212
+ document.querySelectorAll('.page').forEach(page => {
213
+ page.classList.remove('active');
 
 
214
  });
215
 
216
+ // Show the selected page
217
+ document.getElementById(pageId).classList.add('active');
 
218
 
219
+ // Update navigation active states
220
+ updateNavActiveState(pageId);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
 
222
+ // Close mobile menu if open
223
+ document.getElementById('mobile-menu').classList.add('hidden');
224
+ }
225
+
226
+ // Function to update navigation active states
227
+ function updateNavActiveState(pageId) {
228
+ // Desktop nav
229
+ document.querySelectorAll('.nav-link').forEach(link => {
230
+ link.classList.remove('active');
231
  });
232
+ document.getElementById(`nav-${pageId}`).classList.add('active');
233
 
234
+ // Mobile nav
235
+ document.querySelectorAll('.nav-link-mobile').forEach(link => {
236
+ link.classList.remove('active');
237
+ });
238
+ document.querySelector(`.nav-link-mobile[onclick="showPage('${pageId}')"]`).classList.add('active');
239
+ }
240
+
241
+ // Function to toggle mobile menu
242
+ function toggleMobileMenu() {
243
+ document.getElementById('mobile-menu').classList.toggle('hidden');
244
+ }
245
+
246
+ // Initialize the page (show page1 by default)
247
+ document.addEventListener('DOMContentLoaded', function() {
248
  showPage('page1');
 
 
 
 
 
 
 
 
249
  });
250
  </script>
251
  </body>