Skip to content

Commit 329363f

Browse files
author
Mark Randall
committed
Clickable cards instead of buttons.
1 parent 14eeeb5 commit 329363f

2 files changed

Lines changed: 38 additions & 21 deletions

File tree

landing.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@
101101
function buildNavCard(NavCardItem $card, array $config = []): string
102102
{
103103
$config = [
104-
'cn_card' => 'landing-cc-card',
104+
'cn_card' => 'landing-cc-card landing-card-ovh',
105105
'cn_card_content' => 'landing-cc-card-content',
106106
'cn_card_img' => 'landing-cc-card-img',
107107
...$config,
108108
];
109109

110110
ob_start();
111111
?>
112-
<li class="vgrid-card <?= $config['cn_card'] ?>">
112+
<a role="listitem" href="<?= safe($card->href) ?>" class="vgrid-card <?= $config['cn_card'] ?>">
113113
<div class="<?= $config['cn_card_content'] ?>">
114114
<div style="display: flex; gap: 1em; align-items: center">
115115
<?php if ($card->image) { ?><img class="<?= safe($config['cn_card_img']) ?>" alt="Graphic of <?= $card->title ?>" src="<?= $card->image ?>" /><?php } ?>
@@ -120,11 +120,14 @@ function buildNavCard(NavCardItem $card, array $config = []): string
120120

121121
<?php if ($card->href) { ?>
122122
<div style="flex: 0 0 fit-content">
123-
<a href="<?= safe($card->href) ?>" class="landing-card-btn" ><?= safe($card->href_label)?></a>
123+
<span class="landing-card-btn landing-cc-btn" ><?= safe($card->href_label)?></span>
124124
</div>
125125
<?php } ?>
126126
</div>
127-
</li>
127+
<!-- <div style="flex: 0 0 48px; padding: 0.5em; display: flex; align-items: center">-->
128+
<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" fill="#aaaaaa">!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.<path d="M471.1 297.4C483.6 309.9 483.6 330.2 471.1 342.7L279.1 534.7C266.6 547.2 246.3 547.2 233.8 534.7C221.3 522.2 221.3 501.9 233.8 489.4L403.2 320L233.9 150.6C221.4 138.1 221.4 117.8 233.9 105.3C246.4 92.8 266.7 92.8 279.2 105.3L471.2 297.3z"/></svg>-->
129+
<!-- </div>-->
130+
</a>
128131
<?php
129132
return ob_get_clean();
130133
}
@@ -249,7 +252,7 @@ function drawBranchInfo(array $release): void
249252

250253
<div style="background: #202127">
251254
<div class="landing-section">
252-
<ul class="vgrid"><?= buildNavCards($heroCards) ?></ul>
255+
<div role="list" class="vgrid"><?= buildNavCards($heroCards) ?></div>
253256
</div>
254257
</div>
255258

@@ -358,13 +361,13 @@ function drawBranchInfo(array $release): void
358361
<div style="display: flex; gap: 1.5em; flex-direction: column">
359362
<div class="landing-section-header" role="heading">Community</div>
360363
<div>
361-
<ul class="vgrid" id="community-cards"><?= buildNavCards($communityCards); ?></ul>
364+
<div role="list" class="vgrid" id="community-cards"><?= buildNavCards($communityCards); ?></div>
362365
</div>
363366
<div></div>
364367

365368
<div class="landing-section-header" role="heading">Events &amp; Conferences</div>
366369
<div>
367-
<ul class="vgrid" id="conference-cards"><?= buildNavCards($eventCards) ?></ul>
370+
<div role="list" class="vgrid" id="conference-cards"><?= buildNavCards($eventCards) ?></div>
368371
</div>
369372
</div>
370373
</div>
@@ -395,9 +398,9 @@ function drawBranchInfo(array $release): void
395398
<div>
396399
<div class="landing-section">
397400
<div class="landing-section-header">Language Development</div>
398-
<ul class="vgrid" id="language-development">
401+
<div role="list" class="vgrid" id="language-development">
399402
<?= buildNavCards($developmentCards, ['cn_card' => 'landing-cc-card landing-cc-card-grey']) ?>
400-
</ul>
403+
</div>
401404
</div>
402405
</div>
403406

styles/landing.css

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,40 @@
150150
*/
151151

152152
.landing-cc-card {
153+
all: unset;
153154
background: #3c4053;
155+
border-radius: 1em;
154156
display: flex;
155-
flex-direction: column;
157+
flex-direction: row;
156158
flex-grow: 1;
157-
gap: 1em;
159+
gap: 0.25em;
158160
overflow: hidden;
161+
cursor: pointer;
162+
color: white;
163+
outline: 3px transparent;
164+
transition: all 0.2s ease-in-out;
165+
}
166+
167+
.landing-cc-card:hover {
168+
outline: 3px solid #53576d;
169+
background: #53576d;
170+
overflow: hidden;;
171+
transition: all 0.2s ease-in-out;
172+
}
173+
174+
.landing-cc-card:focus {
175+
outline: 3px solid #eeeeee;
159176
}
160177

161178
.landing-cc-card-grey {
162179
background: #444444 !important;
163180
}
164181

182+
.landing-cc-card-grey:hover {
183+
background: #555555 !important;
184+
outline: 3px solid #555555;
185+
}
186+
165187
.landing-cc-card-img {
166188
height: 80px;
167189
width: 80px;
@@ -369,6 +391,8 @@
369391
}
370392

371393
/* Hover state */
394+
.landing-card-ovh:hover .landing-card-btn,
395+
.landing-card-ovh:active .landing-card-btn,
372396
.landing-card-btn:hover {
373397
color: #ffffff !important;
374398
background-color: #111111;
@@ -377,16 +401,6 @@
377401
box-shadow: 6px 6px 0px 0px #000000;
378402
}
379403

380-
/* Selected / Active state (when class is explicitly applied) */
381-
.landing-card-btn.landing-ver-hero-selected {
382-
color: #ffffff !important;
383-
background-color: #4f46e5; /* Modern Indigo/Blue selection color */
384-
border-color: #4f46e5;
385-
/* Presses the button down */
386-
transform: translate(2px, 2px);
387-
box-shadow: 0px 0px 0px 0px transparent;
388-
}
389-
390404
/* Focus state for accessibility */
391405
.landing-card-btn:focus-visible {
392406
outline: 4px solid #818cf8;

0 commit comments

Comments
 (0)