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
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '1027'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '1028'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
|
||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
|
|||
|
|
@ -1184,6 +1184,15 @@ window.Page_settings = (() => {
|
|||
placeholder="Musterstraße 1 12345 Berlin"
|
||||
style="${inputStyle};resize:vertical;font-family:inherit">${_esc(u.billing_address || '')}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display:block;font-size:var(--text-sm);font-weight:600;margin-bottom:var(--space-1)">Dein Geburtstag <span style="font-weight:400;color:var(--c-text-secondary)">(optional)</span></label>
|
||||
<input name="geburtstag" type="text" maxlength="5" placeholder="MM-TT"
|
||||
value="${_esc(u.geburtstag || '')}"
|
||||
pattern="\\d{2}-\\d{2}"
|
||||
title="Format: MM-TT, z.B. 03-15"
|
||||
style="${inputStyle}">
|
||||
<div style="font-size:var(--text-xs);color:var(--c-text-secondary);margin-top:var(--space-1)">Wird nur für Geburtstagsgrüße in der App verwendet.</div>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display:block;font-size:var(--text-sm);font-weight:600;margin-bottom:var(--space-1)">Profil-Sichtbarkeit</label>
|
||||
<select name="profil_sichtbarkeit" style="${inputStyle}">${sichtbarkeitOpts}</select>
|
||||
|
|
@ -1211,6 +1220,7 @@ window.Page_settings = (() => {
|
|||
social_link: fd.social_link || '',
|
||||
profil_sichtbarkeit: fd.profil_sichtbarkeit || 'public',
|
||||
billing_address: fd.billing_address || '',
|
||||
geburtstag: fd.geburtstag || '',
|
||||
});
|
||||
Object.assign(_appState.user, updated);
|
||||
UI.modal.close?.();
|
||||
|
|
|
|||
|
|
@ -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