File tree Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -363,6 +363,24 @@ if (document.body.dataset.page === "integrations") {
363363 }
364364}
365365
366+ // Add underline class to menu links on Mobile
367+
368+ function setActiveMenuItem ( ) {
369+ const currentPath = window . location . pathname ;
370+ const menuItems = document . querySelectorAll ( "[data-el-menu] a" ) ;
371+
372+ menuItems . forEach ( ( item ) => {
373+ const itemPathname = item . pathname ;
374+ const shouldBeUnderlined =
375+ itemPathname !== "/" && currentPath . startsWith ( itemPathname ) ;
376+
377+ item . classList . toggle ( "border-b-2" , shouldBeUnderlined ) ;
378+ item . classList . toggle ( "border-gray-600" , shouldBeUnderlined ) ;
379+ } ) ;
380+ }
381+
382+ setActiveMenuItem ( ) ;
383+
366384// Change header style
367385
368386const header = document . querySelector ( "#header" ) ;
Original file line number Diff line number Diff line change 5656 </ a >
5757 </ div >
5858 < div class ="flex-grow flex items-center justify-center ">
59- < nav class ="flex space-x-12 text-gray-600 ">
59+ < nav data-el-menu class ="flex space-x-12 text-gray-600 ">
6060 < a href ="/#install "> Install</ a >
6161 < a href ="/#features "> Features</ a >
6262 < a href ="/integrations.html "> Integrations</ a >
116116 class ="h-full mt-12 flex flex-col items-center space-y-12 "
117117 >
118118 < nav
119+ data-el-menu
119120 class ="flex flex-col items-center space-y-10 text-xl text-gray-700 "
120121 >
121122 < a href ="/#install "> Install</ a >
197198 < span class ="mt-2 text-gray-50 text-xl font-semibold "> Livebook</ span >
198199 < span class ="mt-1 text-gray-300 ">
199200 Copyright 2023. All rights reserved,
200- < a
201- class ="border-b-2 border-gray-300 "
202- href ="https://dashbit.co/ "
203- > Dashbit</ a > .
204- < a
205- class ="border-b-2 border-gray-300 "
206- href ="/privacy-policy.html "
207- > Privacy Policy</ a > .
201+ < a class ="border-b-2 border-gray-300 " href ="https://dashbit.co/ "
202+ > Dashbit</ a
203+ > .
204+ < a class ="border-b-2 border-gray-300 " href ="/privacy-policy.html "
205+ > Privacy Policy</ a
206+ > .
208207 </ span >
209208 </ div >
210209 < div class ="md:hidden w-full border-t border-gray-700 "> </ div >
You can’t perform that action at this time.
0 commit comments