feat: add click-to-reveal color cards with HTMX

This commit is contained in:
Grail Finder (aider)
2025-05-02 14:18:19 +03:00
parent 12f158b5a5
commit 985956b384
2 changed files with 26 additions and 2 deletions

View File

@ -50,7 +50,7 @@
<div style="display: flex; gap: 1rem; flex-wrap: wrap; padding: 1rem;">
{{range $word, $color := .}}
<div style="
background-color: {{$color}};
background-color: beige;
padding: 1rem;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
@ -58,7 +58,8 @@
text-align: center;
color: white;
text-shadow: 0 2px 4px rgba(0,0,0,0.8);
">
cursor: pointer;
" hx-get="/show-color?word={{$word}}" hx-trigger="click" hx-swap="outerHTML">
{{$word}}
</div>
{{end}}