feat(hero): make the three floating cards open their project

- cards are links to the same project_url as the grid card (new tab, noopener)
- drop aria-hidden from the stack and restore pointer events; add hover/focus/active states
- entrance animation moves to the translate property with fill-mode backwards so the
  staggered offsets/rotation and the hover lift are no longer overridden
- reduced-motion keeps the stagger (translate: none) without killing the layout
This commit is contained in:
Bkk1234 committed 2026-11-20 14:37:43 +07:00
1 parent e87e00896c
commit 0bfbefd930
4 files changed
+48 -12

No files matched your search

+11 -7
View File
@@ -128,15 +128,19 @@ export function homeView(ctx) {
}
</div>
</div>
<div class="hero__deco" aria-hidden="true">
<div class="hero__deco">
${sampleRandom(ctx.data.projects, 3)
.map(
(project, index) => `
<div class="hero__deco-card" style="--i:${index}">
.map((project, index) => {
const url = normalizeUrl(project.project_url);
const inner = `
<span class="hero__deco-icon">${icon(project.icon)}</span>
<span class="hero__deco-name">${escapeHtml(project.project_name)}</span>
</div>`,
)
<span class="hero__deco-name">${escapeHtml(project.project_name)}</span>`;
return url
? `<a class="hero__deco-card" style="--i:${index}" href="${escapeHtml(
url,
)}" target="_blank" rel="noopener noreferrer">${inner}</a>`
: `<span class="hero__deco-card" style="--i:${index}">${inner}</span>`;
})
.join("")}
</div>
</section>