feat: randomized home greetings (web PWA)

Same pool of music-themed phrases as Android — picks randomly each load.
With username: "Ready for some beats, Marc" — without: "Pick something great"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-06-15 00:38:21 +02:00
1 parent f15c005a3c
commit 55eef2f831
1 file changed
+17 -4
+17 -4
View File
@@ -20,12 +20,25 @@ export async function getArtistImage(artistId) {
}
// ─── HOME ───
const _greetW = [
'Ready for some beats,', "What's on the playlist,", 'Good vibes only,',
'Let the music play,', 'Your soundtrack awaits,', 'Turn it up,',
'Time to tune in,', 'Hit play and chill,', 'Music is the answer,', 'Welcome back,',
];
const _greetN = [
'Ready for some beats?', "What's on the playlist today?", 'Good vibes only',
'Let the music play', 'Your soundtrack awaits', 'Turn it up', 'Time to tune in',
'Hit play and chill', 'Music is the answer', 'What are we listening to?',
'Time to escape into music', 'Pick something great',
];
export async function loadHomeData() {
const hour = new Date().getHours();
const greeting = hour < 12 ? 'Guten Morgen' : hour < 18 ? 'Guten Tag' : 'Guten Abend';
const name = S.cfg.user ? `, ${S.cfg.user}` : '';
const name = S.cfg.user || '';
const g = name
? `${_greetW[Math.floor(Math.random() * _greetW.length)]} ${name}`
: _greetN[Math.floor(Math.random() * _greetN.length)];
const el = document.getElementById('home-greeting');
if (el) el.textContent = `${greeting}${name} 👋`;
if (el) el.textContent = g;
loadHeroCard();
loadGenreSection();