Skip to content

Commit a7822e7

Browse files
kpythonclaude
andcommitted
Add Christmas theme and UX improvements
- Full Christmas redesign: dark green background, snowflakes, star field, red/gold palette - Add Santa SVG illustration and santa-hat favicon - Add Italian translation (5th language) - Compact language dropdown preserving URL params on switch - Manage page: participant chips, draw result shown inline for organizer - Fix hardcoded https:// for join link on localhost - Clean up emoji overuse in status messages, add SVG checkmark - Front-end best practices: html lang attribute, Google Fonts via link, Clipboard API Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0d11946 commit a7822e7

15 files changed

Lines changed: 1644 additions & 208 deletions

locales/de.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"participant_wait_button": "🔄 Aktualisieren um das Ergebnis der Ziehung zu sehen",
2121
"manage_draw": "Ziehung verwalten",
2222
"participants": "Teilnehmer",
23-
"start_draw": "🎉 Auslosung starten",
23+
"start_draw": "Auslosung starten",
2424
"waiting_draw": "Warten auf Teilnehmer...",
2525
"waiting_draw_button": "🔄 Aktualisieren um neue Teilnehmer zu sehen",
26-
"all_participants_ready": "🎉 Alle haben sich angemeldet! Sie können jetzt die Auslosung starten.",
26+
"all_participants_ready": "Alle haben sich angemeldet",
2727
"draw_completed": "🎉 Auslosung abgeschlossen!",
2828
"draw_completed_message": "Die Teilnehmer können jetzt sehen, wem sie ein Geschenk machen sollen.",
2929
"share_link": "Teile diesen Link mit den Teilnehmern",

locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"participant_wait_button": "🔄 Refresh to see the draw result",
2121
"manage_draw": "Manage Draw",
2222
"participants": "Participants",
23-
"start_draw": "🎉 Start Draw",
23+
"start_draw": "Start Draw",
2424
"waiting_draw": "Waiting for participants...",
2525
"waiting_draw_button": "🔄 Refresh to see new participants",
26-
"all_participants_ready": "🎉 Everyone has joined! You can now start the draw.",
26+
"all_participants_ready": "Everyone has joined",
2727
"draw_completed": "🎉 Draw Completed!",
2828
"draw_completed_message": "Participants can now see their assigned gift recipient.",
2929
"share_link": "Share this link with participants",

locales/fr.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"participant_wait_button": "🔄 Actualiser pour voir le résultat du tirage",
2121
"manage_draw": "Gérer le tirage",
2222
"participants": "Participants",
23-
"start_draw": "🎉 Lancer le tirage",
23+
"start_draw": "Lancer le tirage",
2424
"waiting_draw": "En attente des participants...",
2525
"waiting_draw_button": "🔄 Actualiser pour voir les nouveaux participants",
26-
"all_participants_ready": "🎉 Tout le monde a rejoint ! Vous pouvez maintenant lancer le tirage.",
26+
"all_participants_ready": "Tout le monde a rejoint",
2727
"draw_completed": "🎉 Tirage terminé !",
2828
"draw_completed_message": "Les participants peuvent maintenant voir à qui ils doivent offrir un cadeau.",
2929
"share_link": "Partagez ce lien avec les participants",

locales/it.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"app_title": "Secret Santa",
3+
"app_description": "Organizza il tuo Secret Santa facilmente e divertiti! Nessun account, nessuna pubblicità, nessun problema, solo un modo semplice per la tua famiglia e amici di partecipare, condividere i desideri e godersi la sorpresa.",
4+
"how_it_works": "Come funziona",
5+
"step_1": "Crea un'estrazione e imposta il numero di partecipanti",
6+
"step_2": "Condividi il link con i tuoi amici",
7+
"step_3": "Tutti si uniscono e inviano i loro desideri",
8+
"step_4": "Avvia l'estrazione e scopri a chi fare il regalo!",
9+
"title_create_draw": "Crea un'estrazione Secret Santa",
10+
"draw_name": "Nome dell'estrazione",
11+
"expected_participants": "Partecipanti attesi (3-50)",
12+
"create_button": "Crea l'estrazione",
13+
"join_draw": "Unisciti al Secret Santa",
14+
"name_label": "Nome",
15+
"wish_label": "Vuoi trasmettere dei desideri o un messaggio al tuo Secret Santa?",
16+
"wish_title": "Desiderio",
17+
"submit_button": "Invia",
18+
"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",
21+
"manage_draw": "Gestisci l'estrazione",
22+
"participants": "Partecipanti",
23+
"start_draw": "Avvia l'estrazione",
24+
"waiting_draw": "In attesa dei partecipanti...",
25+
"waiting_draw_button": "🔄 Aggiorna per vedere i nuovi partecipanti",
26+
"all_participants_ready": "Tutti si sono uniti",
27+
"draw_completed": "🎉 Estrazione completata!",
28+
"draw_completed_message": "I partecipanti possono ora vedere a chi devono fare il regalo.",
29+
"share_link": "Condividi questo link con i partecipanti",
30+
"copy_link": "Copia il link",
31+
"organizer_name": "Il tuo nome",
32+
"organizer_wish": "Vuoi trasmettere dei desideri o un messaggio al tuo Secret Santa? (opzionale)",
33+
"see_my_draw": "🎁 Vedi la mia estrazione",
34+
"open_source": "Open Source",
35+
"view_on_github": "Vedi su GitHub",
36+
"send_feedback": "💬 Invia feedback / Segnala un bug",
37+
"refresh": "Aggiorna"
38+
}

locales/pt.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"participant_wait_button": "🔄 Atualizar para ver o resultado do sorteio",
2121
"manage_draw": "Gerenciar Sorteio",
2222
"participants": "Participantes",
23-
"start_draw": "🎉 Iniciar Sorteio",
23+
"start_draw": "Iniciar Sorteio",
2424
"waiting_draw": "Aguardando participantes...",
2525
"waiting_draw_button": "🔄 Atualizar para ver novos participantes",
26-
"all_participants_ready": "🎉 Todos participaram! Você pode iniciar o sorteio agora.",
26+
"all_participants_ready": "Todos participaram",
2727
"draw_completed": "🎉 Sorteio Concluído!",
2828
"draw_completed_message": "Os participantes agora podem ver para quem devem dar o presente.",
2929
"share_link": "Compartilhe este link com os participantes",

main.go

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func getLanguage(r *http.Request) string {
247247
langs := parseAcceptLanguage(acceptLang)
248248
for _, l := range langs {
249249
// Check if we support this language
250-
if l == "en" || l == "fr" || l == "de" || l == "pt" {
250+
if l == "en" || l == "fr" || l == "de" || l == "pt" || l == "it" {
251251
return l
252252
}
253253
}
@@ -556,30 +556,47 @@ func drawHandler(w http.ResponseWriter, r *http.Request) {
556556
}
557557
dataMutex.RUnlock()
558558

559-
// Build canonical links using HTTPS
560559
scheme := "https"
560+
if isLocalHost(r.Host) {
561+
scheme = "http"
562+
}
561563
joinLink := fmt.Sprintf(scheme+"://%s/draw/%s/join", r.Host, id)
562564
organizerToken := r.URL.Query().Get("organizer")
563565
organizerLink := ""
564-
// Only show organizer link after draw is done
566+
organizerGiftFor := ""
567+
organizerRecipientWish := ""
568+
organizerName := ""
565569
if organizerToken != "" && draw.DrawDone {
566570
organizerLink = fmt.Sprintf(scheme+"://%s/draw/%s/participant/%s", r.Host, id, organizerToken)
571+
if org, ok := draw.Participants[organizerToken]; ok {
572+
organizerName = org.Name
573+
organizerGiftFor = org.GiftFor
574+
for _, p := range draw.Participants {
575+
if p.Name == org.GiftFor {
576+
organizerRecipientWish = p.Wish
577+
break
578+
}
579+
}
580+
}
567581
}
568582
canDraw := allSubmitted && !draw.DrawDone && expectedReached
569583
canonical := fmt.Sprintf("https://%s%s", r.Host, r.URL.Path)
570584
templates.ExecuteTemplate(w, "manage.html", struct {
571-
EventID string
572-
EventName string
573-
JoinLink string
574-
OrganizerLink string
575-
OrganizerToken string
576-
Participants map[string]*Participant
577-
CanDraw bool
578-
DrawDone bool
579-
T Translations
580-
CurrentLang string
581-
Canonical string
582-
}{id, draw.Name, joinLink, organizerLink, organizerToken, draw.Participants, canDraw, draw.DrawDone, t, lang, canonical})
585+
EventID string
586+
EventName string
587+
JoinLink string
588+
OrganizerLink string
589+
OrganizerToken string
590+
OrganizerName string
591+
OrganizerGiftFor string
592+
OrganizerRecipientWish string
593+
Participants map[string]*Participant
594+
CanDraw bool
595+
DrawDone bool
596+
T Translations
597+
CurrentLang string
598+
Canonical string
599+
}{id, draw.Name, joinLink, organizerLink, organizerToken, organizerName, organizerGiftFor, organizerRecipientWish, draw.Participants, canDraw, draw.DrawDone, t, lang, canonical})
583600

584601
case "draw":
585602
if r.Method != http.MethodPost {

static/favicon.svg

Lines changed: 3 additions & 0 deletions
Loading

static/santa-hat.png

14.3 KB
Loading

0 commit comments

Comments
 (0)