@@ -9,24 +9,17 @@ defmodule AresWeb.Components.Navbar do
99 @ doc """
1010 Renders the navigation header with mobile menu support.
1111 """
12- attr :fixed , :boolean , default: false
1312 attr :user , :map , default: nil
1413
1514 def navbar ( assigns ) do
1615 ~H"""
1716 < header
1817 id = "page-header "
19- class = { [
20- "z-50 flex w-full items-center justify-between border-b border-white/10 px-4 sm:px-6 md:px-8 py-3 sm:py-4 text-white font-inter" ,
21- if ( @ fixed ,
22- do: "fixed-header fixed top-0 bg-black shadow-lg" ,
23- else: "absolute bottom-0"
24- )
25- ] }
18+ class = "z-60 flex w-full h-24 items-center justify-between px-4 sm:px-6 md:px-8 py-3 sm:py-4 text-white font-inter fixed top-0 backdrop-blur bg-linear-to-b from-black/90 to-black/30 "
2619 >
27- < a class = "flex items-center gap-2 sm:gap-4 hover:text-primary " href = "/ " >
20+ < . link class = "flex items-center gap-2 sm:gap-4 hover:text-primary " navigate = "/ " >
2821 < img src = "/images/logo-cesium.svg " alt = "Cesium " class = "object-fill w-32 " />
29- </ a >
22+ </ . link >
3023 < div >
3124 < div class = "flex items-center gap-4 sm:gap-6 " >
3225 < nav class = "hidden sm:block " >
@@ -50,17 +43,17 @@ defmodule AresWeb.Components.Navbar do
5043 </ . link >
5144 </ li >
5245 < li >
53- < a class = "hover:text-primary transition-colors " href = "/faqs " >
46+ < . link class = "hover:text-primary transition-colors " navigate = "/faqs " >
5447 FAQs
55- </ a >
48+ </ . link >
5649 </ li >
5750 < li >
58- < a
51+ < . link
5952 class = "hover:text-primary transition-colors "
60- href = "https://2024 .bugsbyte.org/ "
53+ href = "https://2025 .bugsbyte.org/ "
6154 >
6255 Previous edition
63- </ a >
56+ </ . link >
6457 </ li >
6558 < li >
6659 < . link
@@ -72,12 +65,12 @@ defmodule AresWeb.Components.Navbar do
7265 </ li >
7366 <%= if @ user && @ user . is_admin do %>
7467 < li >
75- < a
68+ < . link
7669 class = "hover:text-primary transition-colors text-white "
77- href = "/admin "
70+ navigate = "/admin "
7871 >
7972 Admin
80- </ a >
73+ </ . link >
8174 </ li >
8275 <% end %>
8376 < li class = "relative " >
@@ -121,9 +114,12 @@ defmodule AresWeb.Components.Navbar do
121114 < button
122115 id = "open-nav-button "
123116 type = "button "
124- class = "btn sm:hidden text-white bg-black bg-opacity-70 p-2 rounded hover:bg-opacity-90 border border-white border-opacity-30 "
117+ class = "sm:hidden text-white p-2 rounded hover:bg-opacity-90 "
125118 aria-label = "Navigation "
126- phx-click = { JS . toggle ( to: "#menu-modal" ) }
119+ phx-click = {
120+ JS . toggle ( to: "#menu-modal" )
121+ |> JS . add_class ( "overflow-hidden" , to: "body" )
122+ }
127123 >
128124 < svg class = "w-6 h-6 sm:w-8 sm:h-8 " fill = "none " stroke = "currentColor " viewBox = "0 0 24 24 " >
129125 < path
@@ -140,16 +136,16 @@ defmodule AresWeb.Components.Navbar do
140136
141137 < div
142138 id = "menu-modal "
143- class = "hidden fixed inset-0 bg-black px-4 sm:px-8 py-4 text-white z-[ 100] font-inter "
139+ class = "hidden fixed inset-0 bg-black px-4 sm:px-8 py-4 text-white z-100 font-inter "
144140 >
145141 < div class = "space-y-4 w-full h-full " role = "dialog " aria-modal = "true " >
146142 < header class = "text-right " >
147143 < button
148144 id = "close-nav-button "
149145 type = "button "
150- class = "btn text-white bg-black bg-opacity-70 p-2 rounded hover:bg-opacity-90 border border-white border-opacity-30 "
146+ class = "text-white p-2 rounded hover:bg-opacity-90 "
151147 aria-label = "Close navigation "
152- phx-click = { JS . toggle ( to: "#menu-modal" ) }
148+ phx-click = { JS . toggle ( to: "#menu-modal" ) |> JS . remove_class ( "overflow-hidden" , to: "body" ) }
153149 >
154150 < svg
155151 class = "w-6 h-6 sm:w-8 sm:h-8 "
@@ -225,12 +221,12 @@ defmodule AresWeb.Components.Navbar do
225221 </ a >
226222 </ li >
227223 < li >
228- < a
224+ < . link
229225 class = "block py-3 sm:py-4 text-center text-lg sm:text-xl hover:text-primary transition-colors "
230- href = "https://2024 .bugsbyte.org/ "
226+ href = "https://2025 .bugsbyte.org/ "
231227 >
232228 Previous edition
233- </ a >
229+ </ . link >
234230 </ li >
235231 < li >
236232 < . link
0 commit comments