From 55eef2f831cd5252cebec6d65c5e12ddfa881559 Mon Sep 17 00:00:00 2001 From: Honey Date: Mon, 15 Jun 2026 00:38:21 +0200 Subject: [PATCH] feat: randomized home greetings (web PWA) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/views/home.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/views/home.js b/src/views/home.js index 926e0d6..a36f55c 100644 --- a/src/views/home.js +++ b/src/views/home.js @@ -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();