Skip to content

Commit a0e32f3

Browse files
committed
UX improvements: add refresh buttons, footer on all pages, copy link feedback
1 parent d7f378c commit a0e32f3

File tree

10 files changed

+200
-57
lines changed

10 files changed

+200
-57
lines changed

locales/de.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
"submit_button": "Absenden",
1818
"participant_ready": "Dein Geschenk geht an",
1919
"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",
2021
"manage_draw": "Ziehung verwalten",
2122
"participants": "Teilnehmer",
2223
"start_draw": "🎉 Auslosung starten",
23-
"waiting_draw": "Warten auf Teilnehmer... (Lade die Seite neu, um neue Teilnehmer zu sehen.)",
24+
"waiting_draw": "Warten auf Teilnehmer...",
25+
"waiting_draw_button": "🔄 Aktualisieren um neue Teilnehmer zu sehen",
2426
"all_participants_ready": "🎉 Alle haben sich angemeldet! Sie können jetzt die Auslosung starten.",
2527
"draw_completed": "🎉 Auslosung abgeschlossen!",
2628
"draw_completed_message": "Die Teilnehmer können jetzt sehen, wem sie ein Geschenk machen sollen.",
@@ -31,5 +33,6 @@
3133
"see_my_draw": "🎁 Meine Auslosung sehen",
3234
"open_source": "Open Source",
3335
"view_on_github": "Auf GitHub ansehen",
34-
"send_feedback": "💬 Feedback geben / Bug melden"
36+
"send_feedback": "💬 Feedback geben / Bug melden",
37+
"refresh": "Aktualisieren"
3538
}

locales/en.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
"submit_button": "Submit",
1818
"participant_ready": "Your gift is for",
1919
"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",
2021
"manage_draw": "Manage Draw",
2122
"participants": "Participants",
2223
"start_draw": "🎉 Start Draw",
23-
"waiting_draw": "Waiting for participants... (Reload the page to see new participants.)",
24+
"waiting_draw": "Waiting for participants...",
25+
"waiting_draw_button": "🔄 Refresh to see new participants",
2426
"all_participants_ready": "🎉 Everyone has joined! You can now start the draw.",
2527
"draw_completed": "🎉 Draw Completed!",
2628
"draw_completed_message": "Participants can now see their assigned gift recipient.",
@@ -31,5 +33,6 @@
3133
"see_my_draw": "🎁 See My Draw",
3234
"open_source": "Open Source",
3335
"view_on_github": "View on GitHub",
34-
"send_feedback": "💬 Send feedback / Report a bug"
36+
"send_feedback": "💬 Send feedback / Report a bug",
37+
"refresh": "Refresh"
3538
}

locales/fr.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
"submit_button": "Envoyer",
1818
"participant_ready": "Votre cadeau est pour",
1919
"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",
2021
"manage_draw": "Gérer le tirage",
2122
"participants": "Participants",
2223
"start_draw": "🎉 Lancer le tirage",
23-
"waiting_draw": "En attente des participants... (Pensez à recharger la page pour voir les nouveaux participants.)",
24+
"waiting_draw": "En attente des participants...",
25+
"waiting_draw_button": "🔄 Actualiser pour voir les nouveaux participants",
2426
"all_participants_ready": "🎉 Tout le monde a rejoint ! Vous pouvez maintenant lancer le tirage.",
2527
"draw_completed": "🎉 Tirage terminé !",
2628
"draw_completed_message": "Les participants peuvent maintenant voir à qui ils doivent offrir un cadeau.",
@@ -31,5 +33,6 @@
3133
"see_my_draw": "🎁 Voir mon tirage",
3234
"open_source": "Open Source",
3335
"view_on_github": "Voir sur GitHub",
34-
"send_feedback": "💬 Donner un feedback / Signaler un bug"
36+
"send_feedback": "💬 Donner un feedback / Signaler un bug",
37+
"refresh": "Actualiser"
3538
}

locales/pt.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
"submit_button": "Enviar",
1818
"participant_ready": "Seu presente é para",
1919
"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",
2021
"manage_draw": "Gerenciar Sorteio",
2122
"participants": "Participantes",
2223
"start_draw": "🎉 Iniciar Sorteio",
23-
"waiting_draw": "Aguardando participantes... (Recarregue a página para ver novos participantes.)",
24+
"waiting_draw": "Aguardando participantes...",
25+
"waiting_draw_button": "🔄 Atualizar para ver novos participantes",
2426
"all_participants_ready": "🎉 Todos participaram! Você pode iniciar o sorteio agora.",
2527
"draw_completed": "🎉 Sorteio Concluído!",
2628
"draw_completed_message": "Os participantes agora podem ver para quem devem dar o presente.",
@@ -31,6 +33,7 @@
3133
"see_my_draw": "🎁 Ver Meu Sorteio",
3234
"open_source": "Código Aberto",
3335
"view_on_github": "Ver no GitHub",
34-
"send_feedback": "💬 Enviar feedback / Relatar um bug"
36+
"send_feedback": "💬 Enviar feedback / Relatar um bug",
37+
"refresh": "Atualizar"
3538
}
3639

static/style.css

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ body {
44
color: #333;
55
margin: 0;
66
padding: 0;
7+
display: flex;
8+
flex-direction: column;
9+
min-height: 100vh;
10+
width: 100%;
711
}
812

913
.container {
1014
max-width: 700px;
1115
margin: 30px auto;
1216
padding: 0 15px;
17+
width: 100%;
18+
box-sizing: border-box;
1319
}
1420

1521
.lang-selector {
@@ -103,9 +109,14 @@ button:hover {
103109

104110
footer.github-footer {
105111
text-align: center;
106-
margin-top: 45px;
112+
margin-top: auto;
113+
padding: 30px 15px;
107114
font-size: 0.85em;
108115
color: #555;
116+
background-color: transparent;
117+
border-top: none;
118+
width: 100%;
119+
box-sizing: border-box;
109120
}
110121

111122
footer.github-footer p {
@@ -181,6 +192,34 @@ ul li {
181192
border-left: 3px solid #4CAF50;
182193
}
183194

195+
.status-card {
196+
background-color: #f0f7ff;
197+
padding: 20px;
198+
border-radius: 10px;
199+
border-left: 4px solid #2196F3;
200+
margin: 20px 0;
201+
}
202+
203+
.button-group {
204+
display: flex;
205+
gap: 10px;
206+
margin-top: 20px;
207+
}
208+
209+
.button-group button,
210+
.button-group form {
211+
flex: 1;
212+
}
213+
214+
.button-group button {
215+
margin: 0;
216+
}
217+
218+
.button-group form button {
219+
width: 100%;
220+
margin: 0;
221+
}
222+
184223
@media (max-width: 768px) {
185224
.share-link-box {
186225
flex-direction: column;

templates/create_event.html

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,22 @@ <h2>{{index .T "title_create_draw"}}</h2>
4949
</form>
5050
</div>
5151

52-
<!-- Footer -->
53-
<footer class="github-footer">
54-
<p>
55-
<a href="https://github.com/kpython/secret-santa" target="_blank" rel="noopener noreferrer">
56-
<svg height="20" viewBox="0 0 16 16" width="20" style="vertical-align: middle;">
57-
<path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>
58-
</svg>
59-
{{index .T "view_on_github"}}
60-
</a>
61-
</p>
62-
<p>
63-
<a href="https://github.com/kpython/secret-santa/issues/new" target="_blank" rel="noopener noreferrer">
64-
{{index .T "send_feedback"}}
65-
</a>
66-
</p>
67-
</footer>
68-
6952
</div>
53+
54+
<footer class="github-footer">
55+
<p>
56+
<a href="https://github.com/kpython/secret-santa" target="_blank" rel="noopener noreferrer">
57+
<svg height="20" viewBox="0 0 16 16" width="20" style="vertical-align: middle;">
58+
<path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>
59+
</svg>
60+
{{index .T "view_on_github"}}
61+
</a>
62+
</p>
63+
<p>
64+
<a href="https://github.com/kpython/secret-santa/issues/new" target="_blank" rel="noopener noreferrer">
65+
{{index .T "send_feedback"}}
66+
</a>
67+
</p>
68+
</footer>
7069
</body>
7170
</html>

templates/draw_done.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

templates/join.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,15 @@ <h1>{{index .T "join_draw"}}</h1>
2323
</form>
2424
</div>
2525
</div>
26+
27+
<footer class="github-footer">
28+
<p><a href="https://github.com/kpython/secret-santa" target="_blank" rel="noopener noreferrer">
29+
<svg height="20" viewBox="0 0 16 16" width="20" style="vertical-align: middle;">
30+
<path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>
31+
</svg>
32+
{{index .T "view_on_github"}}
33+
</a></p>
34+
<p><a href="https://github.com/kpython/secret-santa/issues/new" target="_blank" rel="noopener noreferrer">{{index .T "send_feedback"}}</a></p>
35+
</footer>
2636
</body>
2737
</html>

templates/manage.html

Lines changed: 74 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h2>{{index .T "manage_draw"}}</h2>
2626
<p><strong>{{index .T "share_link"}}:</strong></p>
2727
<div class="share-link-box">
2828
<input type="text" id="joinLink" value="{{.JoinLink}}" readonly>
29-
<button onclick="copyLink()">{{index .T "copy_link"}}</button>
29+
<button id="copyBtn" onclick="copyLink()" style="min-width: 150px; white-space: nowrap; height: 48px; line-height: 1;">{{index .T "copy_link"}}</button>
3030
</div>
3131
</div>
3232
{{end}}
@@ -37,26 +37,89 @@ <h2>{{index .T "manage_draw"}}</h2>
3737
<li>{{$p.Name}}</li>
3838
{{end}}
3939
</ul>
40+
4041
{{if not .DrawDone}}
41-
{{if .CanDraw}}
42-
<p>{{index .T "all_participants_ready"}}</p>
43-
{{else}}
44-
<p>{{index .T "waiting_draw"}}</p>
45-
{{end}}
46-
<form method="POST" action="/draw/{{.EventID}}/draw{{if .OrganizerToken}}?organizer={{.OrganizerToken}}{{end}}">
47-
<button type="submit" {{if not .CanDraw}}disabled{{end}}>{{index .T "start_draw"}}</button>
48-
</form>
42+
<div class="status-card">
43+
{{if .CanDraw}}
44+
<p style="font-size: 1.1em; color: #4CAF50; font-weight: 600;">✅ {{index .T "all_participants_ready"}}</p>
45+
<form method="POST" action="/draw/{{.EventID}}/draw{{if .OrganizerToken}}?organizer={{.OrganizerToken}}{{end}}" style="margin-top: 15px;">
46+
<button type="submit" style="width: 100%;">{{index .T "start_draw"}}</button>
47+
</form>
48+
{{else}}
49+
<p style="font-size: 1.1em; color: #ff9800; font-weight: 600;">⏳ {{index .T "waiting_draw"}}</p>
50+
<button onclick="refreshPage(event)" style="margin-top: 15px; width: 100%;">{{index .T "waiting_draw_button"}}</button>
51+
{{end}}
52+
</div>
4953
{{end}}
5054

5155
<script>
5256
function copyLink() {
5357
const input = document.getElementById('joinLink');
58+
const button = event.target;
59+
5460
input.select();
5561
document.execCommand('copy');
56-
alert('Link copied to clipboard!');
62+
63+
// Haptic feedback (vibration)
64+
if (navigator.vibrate) {
65+
navigator.vibrate(50);
66+
}
67+
68+
// Store original text and color
69+
const originalText = button.textContent;
70+
const originalColor = button.style.backgroundColor;
71+
72+
// Button animation
73+
button.style.transform = 'scale(0.95)';
74+
button.style.backgroundColor = '#45a049';
75+
button.textContent = 'Copied! ✅';
76+
77+
setTimeout(() => {
78+
button.style.transform = 'scale(1)';
79+
button.style.backgroundColor = originalColor;
80+
}, 200);
81+
82+
// Restore original text after 2 seconds
83+
setTimeout(() => {
84+
button.textContent = originalText;
85+
}, 2000);
86+
}
87+
88+
function refreshPage(event) {
89+
const button = event.target;
90+
91+
// Haptic feedback (vibration)
92+
if (navigator.vibrate) {
93+
navigator.vibrate(50);
94+
}
95+
96+
// Button animation
97+
button.style.transform = 'scale(0.95)';
98+
const originalColor = button.style.backgroundColor;
99+
button.style.backgroundColor = '#45a049';
100+
101+
setTimeout(() => {
102+
button.style.transform = 'scale(1)';
103+
button.style.backgroundColor = originalColor;
104+
}, 200);
105+
106+
// Reload after animation
107+
setTimeout(() => {
108+
location.reload();
109+
}, 300);
57110
}
58111
</script>
59-
</div>
112+
60113
</div>
114+
115+
<footer class="github-footer">
116+
<p><a href="https://github.com/kpython/secret-santa" target="_blank" rel="noopener noreferrer">
117+
<svg height="20" viewBox="0 0 16 16" width="20" style="vertical-align: middle;">
118+
<path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>
119+
</svg>
120+
{{index .T "view_on_github"}}
121+
</a></p>
122+
<p><a href="https://github.com/kpython/secret-santa/issues/new" target="_blank" rel="noopener noreferrer">{{index .T "send_feedback"}}</a></p>
123+
</footer>
61124
</body>
62125
</html>

0 commit comments

Comments
 (0)