Skip to content

Commit ed10887

Browse files
kpythonclaude
andcommitted
Improve draw reveal UX and auto-refresh
- Add reveal button for participants and organizer (suspense before seeing result) - Auto-refresh every 15s on waiting pages, stops automatically once draw is done - Remove manual refresh buttons (redundant with auto-refresh) - Add organizer nudge message after draw: "let your participants know" - Update waiting text across all 5 languages to be clearer - Remove card entrance animation to prevent flash on auto-refresh - Remove card animation flash on page reload Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a7822e7 commit ed10887

8 files changed

Lines changed: 73 additions & 49 deletions

File tree

locales/de.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"wish_title": "Wunsch",
1717
"submit_button": "Absenden",
1818
"participant_ready": "Dein Geschenk geht an",
19-
"participant_wait": "Danke für deine Teilnahme! Die Ziehung wurde noch nicht durchgeführt. Bitte komme später wieder und lade die Seite neu, um zu sehen, ob die Ziehung stattgefunden hat.",
20-
"participant_wait_button": "🔄 Aktualisieren um das Ergebnis der Ziehung zu sehen",
19+
"participant_wait": "Du bist dabei! Warte darauf, dass der Organisator dich informiert, wenn die Auslosung abgeschlossen ist, und komme dann hierher zurück.",
20+
"participant_wait_button": "Aktualisieren",
21+
"reveal_button": "Meine Auslosung entdecken",
22+
"organizer_notify": "Die Auslosung ist abgeschlossen! Informiere deine Teilnehmer, damit sie herausfinden können, wem sie schenken.",
2123
"manage_draw": "Ziehung verwalten",
2224
"participants": "Teilnehmer",
2325
"start_draw": "Auslosung starten",

locales/en.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"wish_title": "Wish",
1717
"submit_button": "Submit",
1818
"participant_ready": "Your gift is for",
19-
"participant_wait": "Thank you for submitting! The draw has not been done yet. Please check back later and try reloading the page to see if the draw has happened.",
20-
"participant_wait_button": "🔄 Refresh to see the draw result",
19+
"participant_wait": "You're in! Wait for the organizer to let you know when the draw is done, then come back here.",
20+
"participant_wait_button": "Refresh",
21+
"reveal_button": "Reveal my draw",
22+
"organizer_notify": "The draw is done! Let your participants know so they can discover who they're gifting to.",
2123
"manage_draw": "Manage Draw",
2224
"participants": "Participants",
2325
"start_draw": "Start Draw",

locales/fr.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"wish_title": "Souhait",
1717
"submit_button": "Envoyer",
1818
"participant_ready": "Votre cadeau est pour",
19-
"participant_wait": "Merci pour votre participation ! Le tirage n'a pas encore été effectué. Revenez plus tard et pensez à recharger la page pour voir si le tirage a eu lieu.",
20-
"participant_wait_button": "🔄 Actualiser pour voir le résultat du tirage",
19+
"participant_wait": "C'est enregistré ! Attendez que l'organisateur vous prévienne quand le tirage est fait, puis revenez ici.",
20+
"participant_wait_button": "Actualiser",
21+
"reveal_button": "Découvrir mon tirage",
22+
"organizer_notify": "Le tirage est fait ! Prévenez vos participants pour qu'ils puissent découvrir à qui ils offrent.",
2123
"manage_draw": "Gérer le tirage",
2224
"participants": "Participants",
2325
"start_draw": "Lancer le tirage",

locales/it.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"wish_title": "Desiderio",
1717
"submit_button": "Invia",
1818
"participant_ready": "Il tuo regalo è per",
19-
"participant_wait": "Grazie per la partecipazione! L'estrazione non è ancora avvenuta. Torna più tardi e ricarica la pagina per vedere se l'estrazione è avvenuta.",
20-
"participant_wait_button": "🔄 Aggiorna per vedere il risultato",
19+
"participant_wait": "Sei dentro! Aspetta che l'organizzatore ti avvisi quando l'estrazione è fatta, poi torna qui.",
20+
"participant_wait_button": "Aggiorna",
21+
"reveal_button": "Scopri la mia estrazione",
22+
"organizer_notify": "L'estrazione è fatta! Avvisa i tuoi partecipanti così potranno scoprire a chi fanno il regalo.",
2123
"manage_draw": "Gestisci l'estrazione",
2224
"participants": "Partecipanti",
2325
"start_draw": "Avvia l'estrazione",

locales/pt.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"wish_title": "Desejo",
1717
"submit_button": "Enviar",
1818
"participant_ready": "Seu presente é para",
19-
"participant_wait": "Obrigado por participar! O sorteio ainda não foi realizado. Por favor, volte mais tarde e tente recarregar a página para ver se o sorteio já aconteceu.",
20-
"participant_wait_button": "🔄 Atualizar para ver o resultado do sorteio",
19+
"participant_wait": "Você está dentro! Aguarde o organizador avisar quando o sorteio for feito, depois volte aqui.",
20+
"participant_wait_button": "Atualizar",
21+
"reveal_button": "Revelar meu sorteio",
22+
"organizer_notify": "O sorteio foi feito! Avise seus participantes para que possam descobrir para quem vão presentear.",
2123
"manage_draw": "Gerenciar Sorteio",
2224
"participants": "Participantes",
2325
"start_draw": "Iniciar Sorteio",

static/style.css

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,14 @@ body::after {
213213
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.38);
214214
margin-bottom: 24px;
215215
color: #2c1810;
216-
animation: fadeSlideIn 0.55s ease both;
217216
}
218217

219218
.container > .card:nth-child(3) { animation-delay: 0.1s; }
220219
.container > .card:nth-child(4) { animation-delay: 0.2s; }
221220

222221
@keyframes fadeSlideIn {
223-
from { opacity: 0; transform: translateY(22px); }
224-
to { opacity: 1; transform: translateY(0); }
222+
from { opacity: 0; }
223+
to { opacity: 1; }
225224
}
226225

227226
.card h1 {
@@ -407,6 +406,15 @@ footer.github-footer a:hover {
407406
margin: 0;
408407
}
409408

409+
/* ── Organizer notify ──────────────────────────────────── */
410+
.organizer-notify {
411+
padding: 16px 0;
412+
border-top: 1px solid #ede8e2;
413+
font-size: 0.88em;
414+
color: #888;
415+
margin: 4px 0;
416+
}
417+
410418
/* ── Share section (manage page) ───────────────────────── */
411419
.share-section {
412420
padding: 20px 0;

templates/manage.html

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,19 @@ <h1>{{.EventName}}</h1>
4242
{{if and .DrawDone .OrganizerGiftFor}}
4343
<div class="draw-result">
4444
<h1>Hello, {{.OrganizerName}}</h1>
45-
<div class="section-label">{{index .T "participant_ready"}}</div>
46-
<p style="font-size: 1.15em; font-weight: 600; color: #1a0a04; margin: 0 0 16px;">{{.OrganizerGiftFor}}</p>
47-
{{if .OrganizerRecipientWish}}
48-
<div class="section-label">{{index .T "wish_title"}}</div>
49-
<p style="color: #555; margin: 0;">{{.OrganizerRecipientWish}}</p>
50-
{{end}}
45+
<div id="organizer-reveal-wrap" class="status-card">
46+
<button onclick="revealDraw()" style="width: 100%;">{{index .T "reveal_button"}}</button>
47+
</div>
48+
<div id="organizer-draw-result" style="display: none;">
49+
<div class="section-label">{{index .T "participant_ready"}}</div>
50+
<p style="font-size: 1.15em; font-weight: 600; color: #1a0a04; margin: 0 0 16px;">{{.OrganizerGiftFor}}</p>
51+
{{if .OrganizerRecipientWish}}
52+
<div class="section-label">{{index .T "wish_title"}}</div>
53+
<p style="color: #555; margin: 0;">{{.OrganizerRecipientWish}}</p>
54+
{{end}}
55+
</div>
5156
</div>
57+
<div class="organizer-notify">{{index .T "organizer_notify"}}</div>
5258
{{end}}
5359

5460
<!-- Share link -->
@@ -88,7 +94,6 @@ <h1>Hello, {{.OrganizerName}}</h1>
8894
</form>
8995
{{else}}
9096
<p class="status-waiting">{{index .T "waiting_draw"}}</p>
91-
<button onclick="refreshPage(event)" style="margin-top: 15px; width: 100%;">{{index .T "waiting_draw_button"}}</button>
9297
{{end}}
9398
</div>
9499
{{end}}
@@ -129,15 +134,17 @@ <h1>Hello, {{.OrganizerName}}</h1>
129134
}
130135
}
131136

132-
function refreshPage(event) {
133-
const button = event.target;
137+
function revealDraw() {
138+
document.getElementById('organizer-reveal-wrap').style.display = 'none';
139+
const result = document.getElementById('organizer-draw-result');
140+
result.style.display = 'block';
141+
result.style.animation = 'fadeSlideIn 0.4s ease both';
142+
}
134143

135-
if (navigator.vibrate) navigator.vibrate(50);
136144

137-
button.style.transform = 'scale(0.95)';
138-
setTimeout(() => { button.style.transform = 'scale(1)'; }, 200);
139-
setTimeout(() => { location.reload(); }, 300);
140-
}
145+
{{if not .DrawDone}}
146+
setTimeout(() => { location.reload(); }, 15000);
147+
{{end}}
141148
</script>
142149

143150
</body>

templates/participant.html

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,37 @@
3232
<div class="card">
3333
<h1>Hello, {{.Name}}</h1>
3434
{{if .Ready}}
35-
<div class="section-label">{{index .T "participant_ready"}}</div>
36-
<p style="font-size: 1.15em; font-weight: 600; color: #1a0a04; margin: 0 0 16px;">{{.GiftFor}}</p>
37-
{{if .Wish}}
38-
<div class="section-label">{{index .T "wish_title"}}</div>
39-
<p style="color: #555; margin: 0;">{{.Wish}}</p>
40-
{{end}}
35+
<div id="reveal-wrap" class="status-card">
36+
<button onclick="revealDraw()" style="width: 100%;">{{index .T "reveal_button"}}</button>
37+
</div>
38+
<div id="draw-result" style="display: none;">
39+
<div class="section-label">{{index .T "participant_ready"}}</div>
40+
<p style="font-size: 1.15em; font-weight: 600; color: #1a0a04; margin: 0 0 16px;">{{.GiftFor}}</p>
41+
{{if .Wish}}
42+
<div class="section-label">{{index .T "wish_title"}}</div>
43+
<p style="color: #555; margin: 0;">{{.Wish}}</p>
44+
{{end}}
45+
</div>
4146
{{else}}
4247
<div class="status-card">
4348
<p>{{index .T "participant_wait"}}</p>
44-
<button onclick="refreshPage(event)" style="width: 100%;">{{index .T "participant_wait_button"}}</button>
4549
</div>
4650
{{end}}
4751
</div>
4852
</div>
4953

5054
<script>
51-
function refreshPage(event) {
52-
const button = event.target;
53-
54-
// Haptic feedback (vibration)
55-
if (navigator.vibrate) {
56-
navigator.vibrate(50);
57-
}
58-
59-
button.style.transform = 'scale(0.95)';
60-
setTimeout(() => { button.style.transform = 'scale(1)'; }, 200);
61-
62-
// Reload after animation
63-
setTimeout(() => {
64-
location.reload();
65-
}, 300);
55+
function revealDraw() {
56+
document.getElementById('reveal-wrap').style.display = 'none';
57+
const result = document.getElementById('draw-result');
58+
result.style.display = 'block';
59+
result.style.animation = 'fadeSlideIn 0.4s ease both';
6660
}
61+
62+
63+
{{if not .Ready}}
64+
setTimeout(() => { location.reload(); }, 15000);
65+
{{end}}
6766
</script>
6867

6968
<footer class="github-footer">

0 commit comments

Comments
 (0)