Feature: User-Geburtstag im Profil + Glückwunsch in JETZT-Welt
Settings: - Feld 'Dein Geburtstag (optional)' im Profil-Formular (Format MM-TT) - Hinweis: nur für Geburtstagsgrüße, kein Jahr nötig - profile.py: geburtstag gespeichert + Format-Validierung MM-DD JETZT-Welt wenn heute User-Geburtstag: - Greet-Text: 'Herzlichen Glückwunsch' statt Tageszeit-Gruß - Animiertes Geburtstags-Reminder-Card (confetti + cake Icons) - 'Alles Gute zum Geburtstag, [Name]!' SW by-v1028, APP_VER 1028
This commit is contained in:
parent
1328e2c4e3
commit
a4377033ec
6 changed files with 48 additions and 5 deletions
|
|
@ -1092,9 +1092,15 @@ window.Worlds = (() => {
|
|||
} else if (!dog) { _applyBgImage(null); }
|
||||
|
||||
const hour = new Date().getHours();
|
||||
const greet = hour < 5 ? 'Gute Nacht' : hour < 12 ? 'Guten Morgen' : hour < 18 ? 'Hallo' : 'Guten Abend';
|
||||
const firstName = user?.name?.split(' ')[0] || '';
|
||||
const dayStr = new Date().toLocaleDateString('de-DE', { weekday:'long', day:'numeric', month:'long' });
|
||||
|
||||
// User-Geburtstag heute?
|
||||
const _todayMmDd = (() => { const d = new Date(); return String(d.getMonth()+1).padStart(2,'0')+'-'+String(d.getDate()).padStart(2,'0'); })();
|
||||
const userBdayToday = user?.geburtstag && user.geburtstag === _todayMmDd;
|
||||
const greet = userBdayToday
|
||||
? `Herzlichen Glückwunsch`
|
||||
: (hour < 5 ? 'Gute Nacht' : hour < 12 ? 'Guten Morgen' : hour < 18 ? 'Hallo' : 'Guten Abend');
|
||||
const stale = isOffline && staleMin > 5
|
||||
? `<span style="font-size:9px;opacity:0.5;margin-left:6px">· Offline</span>` : '';
|
||||
|
||||
|
|
@ -1119,6 +1125,26 @@ window.Worlds = (() => {
|
|||
: (w.temp_c ?? 20) < 2 ? '🌨️'
|
||||
: '☀️';
|
||||
|
||||
// User-Geburtstag Reminder
|
||||
const userBdayHtml = userBdayToday ? `
|
||||
<div class="world-reminder" style="border-color:rgba(196,132,58,0.6);
|
||||
flex-direction:column;align-items:center;text-align:center;gap:6px;padding:12px 14px">
|
||||
<div style="display:flex;gap:8px;align-items:center;justify-content:center">
|
||||
<svg class="ph-icon bday-fw1" style="width:1.3rem;height:1.3rem;color:#f59e0b">
|
||||
<use href="/icons/phosphor.svg#confetti"></use></svg>
|
||||
<svg class="ph-icon bday-pop" style="width:1.8rem;height:1.8rem;color:#fff">
|
||||
<use href="/icons/phosphor.svg#cake"></use></svg>
|
||||
<svg class="ph-icon bday-fw2" style="width:1.3rem;height:1.3rem;color:#f59e0b">
|
||||
<use href="/icons/phosphor.svg#confetti"></use></svg>
|
||||
</div>
|
||||
<div style="font-weight:800;font-size:var(--text-sm);color:#fff">
|
||||
Alles Gute zum Geburtstag, ${_esc(firstName)}!
|
||||
</div>
|
||||
<div style="font-size:10px;color:rgba(255,255,255,0.55)">
|
||||
Wir wünschen dir und deinem Hund einen wunderschönen Tag 🐾
|
||||
</div>
|
||||
</div>` : '';
|
||||
|
||||
// Alert-Reminder
|
||||
const alertHtml = alertList.slice(0,1).map(a => `
|
||||
<div class="world-reminder" data-wnav="${a.page}" style="border-color:rgba(239,68,68,0.5)">
|
||||
|
|
@ -1165,6 +1191,7 @@ window.Worlds = (() => {
|
|||
${user ? userAvatarHtml : ''}
|
||||
</div>
|
||||
</div>
|
||||
${userBdayHtml}
|
||||
${alertHtml}
|
||||
${user && dog ? `
|
||||
<div class="wj-chip-row">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue