@@ -1228,37 +1228,40 @@ defmodule JolaDevWeb.CoreComponents do
12281228 attr :class , :string , default: nil
12291229
12301230 def project_card ( assigns ) do
1231+ # Determine the primary link (prefer external link over github)
1232+ assigns = assign ( assigns , :primary_link , assigns [ :link ] || assigns [ :github_link ] )
1233+
12311234 ~H"""
1232- < div class = { [ @ class ] } >
1233- < . card variant = { :bordered } class = "h-full " >
1235+ < a
1236+ href = { @ primary_link || "#" }
1237+ target = { if @ external && @ primary_link , do: "_blank" }
1238+ rel = { if @ external && @ primary_link , do: "noopener" }
1239+ class = { [ "block group" , @ class ] }
1240+ >
1241+ < . card variant = { :interactive } hover class = "h-full " >
12341242 < div class = "flex items-start justify-between mb-3 " >
1235- < h3 class = "text-xl font-semibold text-foreground " >
1243+ < h3 class = "text-xl font-semibold text-foreground group-hover:text-foreground/80 transition-colors " >
12361244 { @ title }
12371245 </ h3 >
12381246 < div class = "flex items-center gap-2 flex-shrink-0 ml-2 " >
1239- < a
1247+ < span
12401248 :if = { @ github_link }
1241- href = { @ github_link }
1242- target = "_blank "
1243- rel = "noopener "
1244- class = "text-muted-foreground hover:text-foreground transition-colors "
1249+ onclick = { "event.stopPropagation(); event.preventDefault(); window.open('#{ @ github_link } ', '_blank');" }
1250+ class = "text-muted-foreground hover:text-foreground transition-colors cursor-pointer relative z-10 p-2 -m-2 "
12451251 aria-label = "View on GitHub "
12461252 >
12471253 < . icon name = "lucide-github " class = "w-5 h-5 " />
1248- </ a >
1249- < a
1254+ </ span >
1255+ < span
12501256 :if = { @ link }
1251- href = { @ link }
1252- target = { if @ external , do: "_blank" }
1253- rel = { if @ external , do: "noopener" }
1254- class = "text-muted-foreground hover:text-foreground transition-colors "
1257+ class = "text-muted-foreground group-hover:text-foreground transition-colors "
12551258 aria-label = "Visit project "
12561259 >
12571260 < . icon
12581261 name = { if @ external , do: "hero-arrow-top-right-on-square" , else: "hero-arrow-right" }
12591262 class = "w-5 h-5 "
12601263 />
1261- </ a >
1264+ </ span >
12621265 </ div >
12631266 </ div >
12641267
@@ -1272,7 +1275,7 @@ defmodule JolaDevWeb.CoreComponents do
12721275 </ . badge >
12731276 </ div >
12741277 </ . card >
1275- </ div >
1278+ </ a >
12761279 """
12771280 end
12781281
0 commit comments