File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 <img src =" /assets/img/logos/hiro.jpg" alt =" HiRo Lab" >
55 <img src =" /assets/img/logos/iisc.jpg" alt =" IISc" >
66 </a >
7- <div class =" nav-links" >
7+ <button class =" nav-toggle" id =" navToggle" aria-label =" Toggle navigation" >
8+ <span class =" hamburger" ></span >
9+ <span class =" hamburger" ></span >
10+ <span class =" hamburger" ></span >
11+ </button >
12+ <div class =" nav-links" id =" navLinks" >
813 <a href =" /" class =" nav-link" >Home</a >
914 <a href =" /people/" class =" nav-link" >People</a >
1015 <a href =" /research/" class =" nav-link" >Research</a >
1318 </div >
1419 </div >
1520</nav >
21+
22+ <script >
23+ document .addEventListener (' DOMContentLoaded' , function () {
24+ const navToggle = document .getElementById (' navToggle' );
25+ const navLinks = document .getElementById (' navLinks' );
26+
27+ if (navToggle) {
28+ navToggle .addEventListener (' click' , function () {
29+ navLinks .classList .toggle (' active' );
30+ navToggle .classList .toggle (' active' );
31+ });
32+ }
33+ });
34+ </script >
Original file line number Diff line number Diff line change @@ -70,6 +70,24 @@ body {
7070 opacity : 0.8 ;
7171}
7272
73+ .nav-toggle {
74+ display : none;
75+ background : none;
76+ border : none;
77+ cursor : pointer;
78+ padding : 0.5rem ;
79+ z-index : 1000 ;
80+ }
81+
82+ .hamburger {
83+ display : block;
84+ width : 25px ;
85+ height : 3px ;
86+ background-color : var (--primary-color );
87+ margin : 5px 0 ;
88+ transition : 0.3s ;
89+ }
90+
7391.nav-links {
7492 display : flex;
7593 gap : 2rem ;
@@ -512,8 +530,9 @@ body {
512530 .nav-container {
513531 padding : 0 1rem ;
514532 gap : 1rem ;
515- flex-direction : column;
516- align-items : flex-start;
533+ flex-direction : row;
534+ justify-content : space-between;
535+ align-items : center;
517536 }
518537
519538 .nav-logo {
@@ -524,17 +543,47 @@ body {
524543 height : 35px ;
525544 }
526545
546+ .nav-toggle {
547+ display : block;
548+ }
549+
550+ .nav-toggle .active .hamburger : nth-child (1 ) {
551+ transform : rotate (-45deg ) translate (-5px , 6px );
552+ }
553+
554+ .nav-toggle .active .hamburger : nth-child (2 ) {
555+ opacity : 0 ;
556+ }
557+
558+ .nav-toggle .active .hamburger : nth-child (3 ) {
559+ transform : rotate (45deg ) translate (-5px , -6px );
560+ }
561+
527562 .nav-links {
563+ position : absolute;
564+ top : 100% ;
565+ left : 0 ;
566+ right : 0 ;
567+ background : white;
528568 flex-direction : column;
529- gap : 0.8 rem ;
569+ gap : 0 ;
530570 margin-left : 0 ;
531- padding-left : 0 ;
571+ padding : 0 ;
532572 width : 100% ;
573+ max-height : 0 ;
574+ overflow : hidden;
575+ transition : max-height 0.3s ease-in-out;
576+ box-shadow : 0 4px 6px rgba (0 , 0 , 0 , 0.1 );
577+ }
578+
579+ .nav-links .active {
580+ max-height : 300px ;
581+ padding : 1rem 0 ;
533582 }
534583
535584 .nav-link {
536585 font-size : 1rem ;
537- padding : 0.5 rem 0 ;
586+ padding : 0.8 rem 1.5 rem ;
538587 width : 100% ;
539588 border-bottom : 1px solid var (--border-color );
540589 }
You can’t perform that action at this time.
0 commit comments