4747 < script src ="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js "> </ script >
4848 < script src ="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js "> </ script >
4949 < style >
50+ /* Mobile menu styles */
51+ # mobile-menu {
52+ transition : transform 0.3s ease-in-out;
53+ }
5054 body {
5155 font-family : 'Inter' , sans-serif;
5256 background-color : # 1a1a1a ;
@@ -169,6 +173,7 @@ <h2 class="text-4xl font-bold mb-6 animate-fade-in">Get in Touch</h2>
169173 </ section >
170174
171175 < script >
176+ // Smooth scrolling for nav links
172177 // Smooth scrolling for nav links
173178 document . querySelectorAll ( '.nav-link' ) . forEach ( anchor => {
174179 anchor . addEventListener ( 'click' , function ( e ) {
@@ -179,8 +184,29 @@ <h2 class="text-4xl font-bold mb-6 animate-fade-in">Get in Touch</h2>
179184 top : targetElement . offsetTop - 80 ,
180185 behavior : 'smooth'
181186 } ) ;
187+ // Close mobile menu after clicking a link
188+ if ( window . innerWidth < 768 ) {
189+ mobileMenu . classList . add ( 'hidden' ) ;
190+ mobileMenu . classList . remove ( 'flex' ) ;
191+ menuToggle . innerHTML = `<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>` ;
192+ }
182193 } ) ;
183194 } ) ;
195+
196+ // Toggle mobile menu
197+ const menuToggle = document . getElementById ( 'menu-toggle' ) ;
198+ const mobileMenu = document . getElementById ( 'mobile-menu' ) ;
199+ menuToggle . addEventListener ( 'click' , ( ) => {
200+ if ( mobileMenu . classList . contains ( 'hidden' ) ) {
201+ mobileMenu . classList . remove ( 'hidden' ) ;
202+ mobileMenu . classList . add ( 'flex' ) ;
203+ menuToggle . innerHTML = `<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>` ;
204+ } else {
205+ mobileMenu . classList . add ( 'hidden' ) ;
206+ mobileMenu . classList . remove ( 'flex' ) ;
207+ menuToggle . innerHTML = `<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>` ;
208+ }
209+ } ) ;
184210
185211 // GSAP Animations
186212 gsap . registerPlugin ( ScrollTrigger ) ;
0 commit comments