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:
1 parent
f15c005a3c
commit
55eef2f831
1 file changed
+17
-4
+17
-4
@@ -20,12 +20,25 @@ export async function getArtistImage(artistId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ─── HOME ───
|
// ─── 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() {
|
export async function loadHomeData() {
|
||||||
const hour = new Date().getHours();
|
const name = S.cfg.user || '';
|
||||||
const greeting = hour < 12 ? 'Guten Morgen' : hour < 18 ? 'Guten Tag' : 'Guten Abend';
|
const g = name
|
||||||
const name = S.cfg.user ? `, ${S.cfg.user}` : '';
|
? `${_greetW[Math.floor(Math.random() * _greetW.length)]} ${name}`
|
||||||
|
: _greetN[Math.floor(Math.random() * _greetN.length)];
|
||||||
const el = document.getElementById('home-greeting');
|
const el = document.getElementById('home-greeting');
|
||||||
if (el) el.textContent = `${greeting}${name} 👋`;
|
if (el) el.textContent = g;
|
||||||
|
|
||||||
loadHeroCard();
|
loadHeroCard();
|
||||||
loadGenreSection();
|
loadGenreSection();
|
||||||
|
|||||||
Reference in new issue
Block a user