Skip to content

Commit d0cc5f6

Browse files
kpythonclaude
andcommitted
Improve UX: placeholders, char limit, participant counter, localized copy feedback
- Localized form placeholders: draw name with family names, organizer name per language - Wish field changed to textarea (4 rows) with personal letter placeholder per language - Add 500 char limit with live countdown counter on wish fields - Show participant count (X/Y) next to the Participants label on manage page - Animated dots on waiting state (CSS only, 0→3 dots loop) - "Copied" button feedback now localized in all 5 languages - Waiting message updated: "Keep this page open and come back later" - Post-reveal reminder: "Remember or note this result — it won't be available forever" - Remove trailing dots from waiting_draw translations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5f66472 commit d0cc5f6

11 files changed

Lines changed: 139 additions & 34 deletions

File tree

locales/de.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@
1010
"step_4": "Starten Sie die Ziehung und entdecken Sie, wem Sie schenken!",
1111
"title_create_draw": "Secret Santa Ziehung erstellen",
1212
"draw_name": "Name der Ziehung",
13+
"placeholder_draw_name": "Weihnachts-Wichteln — Familie Müller",
14+
"placeholder_organizer_name": "Anna Müller",
15+
"placeholder_wish": "Lieber Secret Santa,\n\nIch würde mich sehr über ein gutes Buch, Schokolade oder etwas Selbstgemachtes freuen. Ich koche gerade auch sehr gerne!\n\nDanke 🎁",
1316
"expected_participants": "Erwartete Teilnehmer (3-50)",
1417
"create_button": "Ziehung erstellen",
1518
"join_draw": "Am Secret Santa teilnehmen",
1619
"name_label": "Name",
17-
"wish_label": "Möchtest du Wünsche oder eine Nachricht an deinen Secret Santa übermitteln?",
20+
"wish_label": "Deine Nachricht an deinen Secret Santa",
1821
"wish_title": "Wunsch",
1922
"submit_button": "Absenden",
2023
"participant_ready": "Dein Geschenk geht an",
21-
"participant_wait": "Du bist dabei! Warte darauf, dass der Organisator dich informiert, wenn die Auslosung abgeschlossen ist, und komme dann hierher zurück.",
24+
"participant_wait": "Du bist dabei! Lass diese Seite offen und komm später zurück, wenn der Organisator dich informiert.",
25+
"result_reminder": "Merke oder notiere dieses Ergebnis — es wird nicht für immer verfügbar sein.",
2226
"reveal_button": "Meine Auslosung entdecken",
2327
"organizer_notify": "Die Auslosung ist abgeschlossen! Informiere deine Teilnehmer, damit sie herausfinden können, wem sie schenken.",
2428
"manage_draw": "Ziehung verwalten",
2529
"participants": "Teilnehmer",
2630
"start_draw": "Auslosung starten",
27-
"waiting_draw": "Warten auf Teilnehmer...",
31+
"waiting_draw": "Warten auf Teilnehmer",
2832
"all_participants_ready": "Alle haben sich angemeldet",
2933
"share_link": "Teile diesen Link mit den Teilnehmern",
3034
"copy_link": "Link kopieren",
35+
"copied": "Kopiert! ✅",
3136
"organizer_name": "Dein Name",
32-
"organizer_wish": "Möchtest du Wünsche oder eine Nachricht an deinen Secret Santa übermitteln? (optional)",
37+
"organizer_wish": "Deine Nachricht an deinen Secret Santa (optional)",
3338
"view_on_github": "Auf GitHub ansehen",
3439
"send_feedback": "💬 Feedback geben / Bug melden"
3540
}

locales/en.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@
1010
"step_4": "Start the draw and discover who you're gifting to!",
1111
"title_create_draw": "Create Secret Santa Draw",
1212
"draw_name": "Draw Name",
13+
"placeholder_draw_name": "Christmas Secret Santa — The Smiths",
14+
"placeholder_organizer_name": "Jane Smith",
15+
"placeholder_wish": "Dear Secret Santa,\n\nI'd love to receive a cozy book, some good chocolate, or anything handmade. I'm really into cooking lately too!\n\nThank you 🎁",
1316
"expected_participants": "Expected participants (3-50)",
1417
"create_button": "Create Draw",
1518
"join_draw": "Join Secret Santa",
1619
"name_label": "Name",
17-
"wish_label": "Do you want to transmit any wishes or a message to your Secret Santa?",
20+
"wish_label": "Your message to your Secret Santa",
1821
"wish_title": "Wish",
1922
"submit_button": "Submit",
2023
"participant_ready": "Your gift is for",
21-
"participant_wait": "You're in! Wait for the organizer to let you know when the draw is done, then come back here.",
24+
"participant_wait": "You're in! Keep this page open and come back later when the organizer lets you know.",
25+
"result_reminder": "Remember or note down this result — it won't be available forever.",
2226
"reveal_button": "Reveal my draw",
2327
"organizer_notify": "The draw is done! Let your participants know so they can discover who they're gifting to.",
2428
"manage_draw": "Manage Draw",
2529
"participants": "Participants",
2630
"start_draw": "Start Draw",
27-
"waiting_draw": "Waiting for participants...",
31+
"waiting_draw": "Waiting for participants",
2832
"all_participants_ready": "Everyone has joined",
2933
"share_link": "Share this link with participants",
3034
"copy_link": "Copy Link",
35+
"copied": "Copied! ✅",
3136
"organizer_name": "Your name",
32-
"organizer_wish": "Do you want to transmit any wishes or a message to your Secret Santa? (optional)",
37+
"organizer_wish": "Your message to your Secret Santa (optional)",
3338
"view_on_github": "View on GitHub",
3439
"send_feedback": "💬 Send feedback / Report a bug"
3540
}

locales/fr.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@
1010
"step_4": "Lancez le tirage et découvrez à qui offrir un cadeau !",
1111
"title_create_draw": "Créer un tirage Secret Santa",
1212
"draw_name": "Nom du tirage",
13+
"placeholder_draw_name": "Secret Santa de Noël — Les Dupont",
14+
"placeholder_organizer_name": "Marie Dupont",
15+
"placeholder_wish": "Cher Secret Santa,\n\nJ'adorerais recevoir un bon livre, du chocolat ou quelque chose de fait main. En ce moment je suis aussi passionné(e) de cuisine !\n\nMerci 🎁",
1316
"expected_participants": "Participants attendus (3-50)",
1417
"create_button": "Créer le tirage",
1518
"join_draw": "Rejoindre le Secret Santa",
1619
"name_label": "Nom",
17-
"wish_label": "Souhaitez-vous transmettre des souhaits ou un message à votre Secret Santa?",
20+
"wish_label": "Ton message à ton Secret Santa",
1821
"wish_title": "Souhait",
1922
"submit_button": "Envoyer",
2023
"participant_ready": "Votre cadeau est pour",
21-
"participant_wait": "C'est enregistré ! Attendez que l'organisateur vous prévienne quand le tirage est fait, puis revenez ici.",
24+
"participant_wait": "C'est bon ! Garde cette page ouverte et reviens plus tard quand l'organisateur te prévient.",
25+
"result_reminder": "Retiens bien ou note ce résultat — il ne sera pas disponible pour toujours.",
2226
"reveal_button": "Découvrir mon tirage",
2327
"organizer_notify": "Le tirage est fait ! Prévenez vos participants pour qu'ils puissent découvrir à qui ils offrent.",
2428
"manage_draw": "Gérer le tirage",
2529
"participants": "Participants",
2630
"start_draw": "Lancer le tirage",
27-
"waiting_draw": "En attente des participants...",
31+
"waiting_draw": "En attente des participants",
2832
"all_participants_ready": "Tout le monde a rejoint",
2933
"share_link": "Partagez ce lien avec les participants",
3034
"copy_link": "Copier le lien",
35+
"copied": "Copié ! ✅",
3136
"organizer_name": "Votre nom",
32-
"organizer_wish": "Souhaitez-vous transmettre des souhaits ou un message à votre Secret Santa? (optionnel)",
37+
"organizer_wish": "Ton message à ton Secret Santa (optionnel)",
3338
"view_on_github": "Voir sur GitHub",
3439
"send_feedback": "💬 Donner un feedback / Signaler un bug"
3540
}

locales/it.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@
1010
"step_4": "Avvia l'estrazione e scopri a chi fare il regalo!",
1111
"title_create_draw": "Crea un'estrazione Secret Santa",
1212
"draw_name": "Nome dell'estrazione",
13+
"placeholder_draw_name": "Secret Santa di Natale — Famiglia Rossi",
14+
"placeholder_organizer_name": "Marco Rossi",
15+
"placeholder_wish": "Caro Secret Santa,\n\nMi farebbe molto piacere ricevere un buon libro, del cioccolato o qualcosa di fatto a mano. Ultimamente sono appassionato di cucina!\n\nGrazie mille 🎁",
1316
"expected_participants": "Partecipanti attesi (3-50)",
1417
"create_button": "Crea l'estrazione",
1518
"join_draw": "Unisciti al Secret Santa",
1619
"name_label": "Nome",
17-
"wish_label": "Vuoi trasmettere dei desideri o un messaggio al tuo Secret Santa?",
20+
"wish_label": "Il tuo messaggio al tuo Secret Santa",
1821
"wish_title": "Desiderio",
1922
"submit_button": "Invia",
2023
"participant_ready": "Il tuo regalo è per",
21-
"participant_wait": "Sei dentro! Aspetta che l'organizzatore ti avvisi quando l'estrazione è fatta, poi torna qui.",
24+
"participant_wait": "Sei dentro! Tieni aperta questa pagina e torna più tardi quando l'organizzatore ti avvisa.",
25+
"result_reminder": "Ricorda o annota questo risultato — non sarà disponibile per sempre.",
2226
"reveal_button": "Scopri la mia estrazione",
2327
"organizer_notify": "L'estrazione è fatta! Avvisa i tuoi partecipanti così potranno scoprire a chi fanno il regalo.",
2428
"manage_draw": "Gestisci l'estrazione",
2529
"participants": "Partecipanti",
2630
"start_draw": "Avvia l'estrazione",
27-
"waiting_draw": "In attesa dei partecipanti...",
31+
"waiting_draw": "In attesa dei partecipanti",
2832
"all_participants_ready": "Tutti si sono uniti",
2933
"share_link": "Condividi questo link con i partecipanti",
3034
"copy_link": "Copia il link",
35+
"copied": "Copiato! ✅",
3136
"organizer_name": "Il tuo nome",
32-
"organizer_wish": "Vuoi trasmettere dei desideri o un messaggio al tuo Secret Santa? (opzionale)",
37+
"organizer_wish": "Il tuo messaggio al tuo Secret Santa (opzionale)",
3338
"view_on_github": "Vedi su GitHub",
3439
"send_feedback": "💬 Invia feedback / Segnala un bug"
3540
}

locales/pt.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@
1010
"step_4": "Realize o sorteio e descubra para quem você vai dar o presente!",
1111
"title_create_draw": "Criar Sorteio Secret Santa",
1212
"draw_name": "Nome do Sorteio",
13+
"placeholder_draw_name": "Secret Santa de Natal — Família Silva",
14+
"placeholder_organizer_name": "Maria Silva",
15+
"placeholder_wish": "Caro Secret Santa,\n\nAdoraria receber um bom livro, chocolates ou algo feito à mão. Também adoro cozinhar ultimamente!\n\nMuito obrigado 🎁",
1316
"expected_participants": "Participantes esperados (3-50)",
1417
"create_button": "Criar Sorteio",
1518
"join_draw": "Participar do Secret Santa",
1619
"name_label": "Nome",
17-
"wish_label": "Você quer transmitir algum desejo ou mensagem para seu Secret Santa?",
20+
"wish_label": "Sua mensagem ao seu Secret Santa",
1821
"wish_title": "Desejo",
1922
"submit_button": "Enviar",
2023
"participant_ready": "Seu presente é para",
21-
"participant_wait": "Você está dentro! Aguarde o organizador avisar quando o sorteio for feito, depois volte aqui.",
24+
"participant_wait": "Está dentro! Mantém esta página aberta e volta mais tarde quando o organizador te avisar.",
25+
"result_reminder": "Guarda ou anota este resultado — não estará disponível para sempre.",
2226
"reveal_button": "Revelar meu sorteio",
2327
"organizer_notify": "O sorteio foi feito! Avise seus participantes para que possam descobrir para quem vão presentear.",
2428
"manage_draw": "Gerenciar Sorteio",
2529
"participants": "Participantes",
2630
"start_draw": "Iniciar Sorteio",
27-
"waiting_draw": "Aguardando participantes...",
31+
"waiting_draw": "Aguardando participantes",
2832
"all_participants_ready": "Todos participaram",
2933
"share_link": "Compartilhe este link com os participantes",
3034
"copy_link": "Copiar Link",
35+
"copied": "Copiado! ✅",
3136
"organizer_name": "Seu nome",
32-
"organizer_wish": "Você quer transmitir algum desejo ou mensagem para seu Secret Santa? (opcional)",
37+
"organizer_wish": "Sua mensagem ao seu Secret Santa (opcional)",
3338
"view_on_github": "Ver no GitHub",
3439
"send_feedback": "💬 Enviar feedback / Relatar um bug"
3540
}

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,10 @@ func drawHandler(w http.ResponseWriter, r *http.Request) {
581581
}
582582
canDraw := allSubmitted && !draw.DrawDone && expectedReached
583583
canonical := fmt.Sprintf("https://%s%s", r.Host, r.URL.Path)
584+
expectedCount := 0
585+
if draw.ExpectedParticipants != nil {
586+
expectedCount = *draw.ExpectedParticipants
587+
}
584588
templates.ExecuteTemplate(w, "manage.html", struct {
585589
EventID string
586590
EventName string
@@ -591,12 +595,13 @@ func drawHandler(w http.ResponseWriter, r *http.Request) {
591595
OrganizerGiftFor string
592596
OrganizerRecipientWish string
593597
Participants map[string]*Participant
598+
ExpectedCount int
594599
CanDraw bool
595600
DrawDone bool
596601
T Translations
597602
CurrentLang string
598603
Canonical string
599-
}{id, draw.Name, joinLink, organizerLink, organizerToken, organizerName, organizerGiftFor, organizerRecipientWish, draw.Participants, canDraw, draw.DrawDone, t, lang, canonical})
604+
}{id, draw.Name, joinLink, organizerLink, organizerToken, organizerName, organizerGiftFor, organizerRecipientWish, draw.Participants, expectedCount, canDraw, draw.DrawDone, t, lang, canonical})
600605

601606
case "draw":
602607
if r.Method != http.MethodPost {

static/style.css

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,37 @@ body::after {
269269
color: #2c1810;
270270
}
271271

272-
.event-form input:focus {
272+
.event-form input:focus,
273+
.event-form textarea:focus {
273274
border-color: #c41e3a;
274275
box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
275276
outline: none;
276277
}
277278

279+
.event-form textarea {
280+
width: 100%;
281+
padding: 11px 14px;
282+
margin-top: 6px;
283+
border-radius: 10px;
284+
border: 1.5px solid #ddd;
285+
box-sizing: border-box;
286+
font-size: 16px;
287+
font-family: 'Lato', sans-serif;
288+
background: #fafafa;
289+
color: #2c1810;
290+
resize: vertical;
291+
line-height: 1.5;
292+
}
293+
294+
.char-count {
295+
display: block;
296+
text-align: right;
297+
font-size: 0.78em;
298+
color: #aaa;
299+
margin-top: 4px;
300+
transition: color 0.2s;
301+
}
302+
278303
.event-form > button {
279304
display: block;
280305
margin: 20px auto 0;
@@ -347,6 +372,14 @@ footer.github-footer a:hover {
347372

348373

349374
/* ── Section label ─────────────────────────────────────── */
375+
.participants-count {
376+
font-size: 1em;
377+
font-weight: 600;
378+
color: #888;
379+
letter-spacing: 0;
380+
text-transform: none;
381+
}
382+
350383
.section-label {
351384
font-size: 0.78em;
352385
font-weight: 700;
@@ -398,14 +431,36 @@ footer.github-footer a:hover {
398431
font-size: 0.9em;
399432
color: #aaa;
400433
font-weight: 500;
401-
margin: 0 0 4px;
434+
margin: 0 0 6px;
435+
}
436+
437+
438+
.dots-anim span {
439+
animation: dot-wave 1.4s infinite ease-in-out both;
440+
}
441+
.dots-anim span:nth-child(2) { animation-delay: 0.2s; }
442+
.dots-anim span:nth-child(3) { animation-delay: 0.4s; }
443+
444+
@keyframes dot-wave {
445+
0%, 80%, 100% { opacity: 0; }
446+
40% { opacity: 1; }
402447
}
403448

404449
/* ── Draw result (manage page) ─────────────────────────── */
405450
.draw-result {
406451
margin: 0;
407452
}
408453

454+
/* ── Result reminder ───────────────────────────────────── */
455+
.result-reminder {
456+
font-size: 0.8em;
457+
color: #aaa;
458+
font-style: italic;
459+
margin: 0;
460+
border-top: 1px solid #ede8e2;
461+
padding-top: 12px;
462+
}
463+
409464
/* ── Organizer notify ──────────────────────────────────── */
410465
.organizer-notify {
411466
padding: 16px 0;

templates/create_event.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,14 @@ <h2>{{index .T "how_it_works"}}</h2>
8888
<h2>{{index .T "title_create_draw"}}</h2>
8989
<form method="POST" action="/draw/create" class="event-form">
9090
<label>{{index .T "draw_name"}}:
91-
<input type="text" name="eventname" placeholder="Christmas Secret Santa 2025" required>
91+
<input type="text" name="eventname" placeholder="{{index .T "placeholder_draw_name"}}" required>
9292
</label>
9393
<label>{{index .T "organizer_name"}}:
94-
<input type="text" name="organizername" placeholder="John Doe" required>
94+
<input type="text" name="organizername" placeholder="{{index .T "placeholder_organizer_name"}}" required>
9595
</label>
9696
<label>{{index .T "organizer_wish"}}:
97-
<input type="text" name="organizerwish" placeholder="Books, video games, chocolate...">
97+
<textarea name="organizerwish" rows="4" maxlength="500" placeholder="{{index .T "placeholder_wish"}}" oninput="updateCount(this)"></textarea>
98+
<span class="char-count">500</span>
9899
</label>
99100
<label>{{index .T "expected_participants"}}:
100101
<input type="number" name="expected" min="3" max="50" placeholder="10" required>
@@ -120,5 +121,13 @@ <h2>{{index .T "title_create_draw"}}</h2>
120121
</a>
121122
</p>
122123
</footer>
124+
<script>
125+
function updateCount(el) {
126+
const remaining = 500 - el.value.length;
127+
const counter = el.nextElementSibling;
128+
counter.textContent = remaining;
129+
counter.style.color = remaining < 50 ? '#c41e3a' : '#aaa';
130+
}
131+
</script>
123132
</body>
124133
</html>

templates/join.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
<h1>{{index .T "join_draw"}}</h1>
3434
<form method="POST" class="event-form">
3535
<label>{{index .T "name_label"}}:
36-
<input type="text" name="name" placeholder="Jane Smith" required>
36+
<input type="text" name="name" placeholder="{{index .T "placeholder_organizer_name"}}" required>
3737
</label>
3838
<label>{{index .T "wish_label"}}:
39-
<input type="text" name="wish" placeholder="Books, video games, chocolate...">
39+
<textarea name="wish" rows="4" maxlength="500" placeholder="{{index .T "placeholder_wish"}}" oninput="updateCount(this)"></textarea>
40+
<span class="char-count">500</span>
4041
</label>
4142
<button type="submit">{{index .T "submit_button"}}</button>
4243
</form>
@@ -52,5 +53,13 @@ <h1>{{index .T "join_draw"}}</h1>
5253
</a></p>
5354
<p><a href="https://github.com/kpython/secret-santa/issues/new" target="_blank" rel="noopener noreferrer">{{index .T "send_feedback"}}</a></p>
5455
</footer>
56+
<script>
57+
function updateCount(el) {
58+
const remaining = 500 - el.value.length;
59+
const counter = el.nextElementSibling;
60+
counter.textContent = remaining;
61+
counter.style.color = remaining < 50 ? '#c41e3a' : '#aaa';
62+
}
63+
</script>
5564
</body>
5665
</html>

0 commit comments

Comments
 (0)