diff --git a/frontend/css/style.css b/frontend/css/style.css index 1d79a23..d8d7ae0 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -1192,11 +1192,11 @@ tr:hover td { /* ── Version label ───────────────────────────────────────────────── */ .version-label { - display: block; - text-align: center; - margin-top: 16px; - font-size: 0.7rem; + position: fixed; + bottom: 16px; + right: 16px; + font-size: 0.75rem; color: var(--text-muted); - letter-spacing: 0.06em; - opacity: 0.5; + opacity: 0.6; + font-family: monospace; } \ No newline at end of file diff --git a/frontend/img/tutor1.jpg b/frontend/img/tutor1.jpg new file mode 100644 index 0000000..600588e Binary files /dev/null and b/frontend/img/tutor1.jpg differ diff --git a/frontend/img/tutor2.jpg b/frontend/img/tutor2.jpg new file mode 100644 index 0000000..1a14140 Binary files /dev/null and b/frontend/img/tutor2.jpg differ diff --git a/frontend/img/tutor3.jpg b/frontend/img/tutor3.jpg new file mode 100644 index 0000000..57cffff Binary files /dev/null and b/frontend/img/tutor3.jpg differ diff --git a/frontend/img/tutor4.jpg b/frontend/img/tutor4.jpg new file mode 100644 index 0000000..c14f405 Binary files /dev/null and b/frontend/img/tutor4.jpg differ diff --git a/frontend/img/tutor5.jpg b/frontend/img/tutor5.jpg new file mode 100644 index 0000000..4e263e8 Binary files /dev/null and b/frontend/img/tutor5.jpg differ diff --git a/frontend/index.html b/frontend/index.html index 93b12c2..a481406 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -30,7 +30,7 @@ - v0.1 + v0.1.1 diff --git a/frontend/js/chat.js b/frontend/js/chat.js index 2bcf6c1..ebae714 100644 --- a/frontend/js/chat.js +++ b/frontend/js/chat.js @@ -28,8 +28,7 @@ function relativeTime(dateStr) { return date.toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' }); } -// Avatar — DiceBear "avataaars" style for friendly illustrated headshots -const AVATAR_SEEDS = ['Felix', 'Lena', 'Hans', 'Sophie', 'Klaus', 'Marta', 'Otto', 'Emma']; + document.addEventListener('DOMContentLoaded', async () => { if (!requireAuth()) return; @@ -38,10 +37,18 @@ document.addEventListener('DOMContentLoaded', async () => { const displayName = user?.username || 'User'; document.getElementById('user-name').textContent = displayName; - // Random avatar from DiceBear + // Deterministic avatar based on username (tutor1.jpg - tutor5.jpg) const avatarImg = document.getElementById('avatar-img'); - const seed = AVATAR_SEEDS[Math.floor(Math.random() * AVATAR_SEEDS.length)]; - avatarImg.src = `https://api.dicebear.com/9.x/avataaars/svg?seed=${seed}&backgroundColor=b6e3f4,c0aede,d1d4f9`; + + // Simple hash function for username + let hash = 0; + for (let i = 0; i < displayName.length; i++) { + hash = displayName.charCodeAt(i) + ((hash << 5) - hash); + } + + // Map hash to index 1-5 + const avatarIndex = (Math.abs(hash) % 5) + 1; + avatarImg.src = `/img/tutor${avatarIndex}.jpg`; const messagesEl = document.getElementById('chat-messages'); const inputEl = document.getElementById('chat-input');