// screens.jsx — Dashboard, Avatar (Zenith), Histórico
const { useState: useS, useEffect: useE, useMemo } = React;
/* ============ DASHBOARD ============ */
function Dashboard({ user, onStart, onNav }) {
const dayData = PROGRAM_30[user.currentDay - 1];
const z = zenithForDay(user.currentDay);
const progress = user.currentDay / 30;
const exChips = dayData.ex.split(',').map(s => s.trim());
return (
{/* header */}
{new Date().toLocaleDateString('pt-BR', { weekday: 'long' }).toUpperCase()}
{user.name && user.name !== 'Você' ? `Bora, ${user.name.split(' ')[0]}` : 'Bom treino'}
{/* streak strip */}
{user.streak}
dias seguidos
{user.totalWorkouts}
treinos feitos
{/* treino do dia — card grande */}
DEMO DO TREINOvídeo / loop
DIA {user.currentDay} DE 30
~30 MIN
{dayData.foco}
{exChips.map((c, i) => (
{c}
))}
{/* frase do Zenith */}
ZENITH DIZ
{dayData.frase}
{/* progresso 30 dias */}
PROGRESSO · 30 DIAS
{user.history.map((s, i) => (
))}
{Math.round(progress*100)}% COMPLETO
{30 - user.currentDay} DIAS RESTANTES
);
}
/* ============ AVATAR (ZENITH) ============ */
function AvatarScreen({ user }) {
const z = zenithForDay(user.currentDay);
const dayInLevel = user.currentDay - (z.lvl === 1 ? 0 : [0,5,10,15,20][z.lvl-1]);
const levelSpan = z.lvl === 5 ? 10 : 5;
const xp = Math.min(1, dayInLevel / levelSpan);
return (
NÍVEL {z.lvl} · {z.name.toUpperCase()}
"{z.phrase}"
{/* XP bar */}
XP PARA NÍVEL {Math.min(5, z.lvl + 1)}
{Math.round(xp*100)}%
Habilidade ativa: {z.ability}
{/* níveis trilha */}
JORNADA DE EVOLUÇÃO
{ZENITH_LEVELS.map(l => {
const done = user.currentDay > [5,10,15,20,30][l.lvl-1];
const cur = l.lvl === z.lvl;
return (
{done ? : l.lvl}
{l.name}
{l.range} · {l.ability}
);
})}
{/* badges */}
CONQUISTAS
{BADGES.map(b => )}
);
}
/* ============ HISTÓRICO ============ */
function HistoryScreen({ user }) {
const stats = [
{ label: 'Treinos', value: user.totalWorkouts, unit: '' },
{ label: 'Minutos', value: user.totalMinutes, unit: 'min' },
{ label: 'Repetições', value: user.totalReps.toLocaleString('pt-BR'), unit: '' },
{ label: 'Prancha', value: Math.round(user.plankSeconds/60), unit: 'min' },
];
const weeks = [
{ w: 'Sem 1', v: 1.0 }, { w: 'Sem 2', v: 0.85 }, { w: 'Sem 3', v: 0.4 }, { w: 'Sem 4', v: 0.1 },
];
return (
{/* stats grid */}
{stats.map(s => (
{s.value}
{s.unit}
{s.label}
))}
{/* consistência grid */}
CONSISTÊNCIA
{user.accuracy}% ACURÁCIA
{user.history.map((s, i) => (
{i+1}
))}
{[['var(--accent)','Feito'],['var(--line-2)','Descanso'],['var(--surface-2)','A fazer']].map(([c,l]) => (
{l}
))}
{/* semana a semana */}
VOLUME SEMANA A SEMANA
{weeks.map(wk => (
0.5 ? 'var(--accent)' : 'var(--line-2)',
borderRadius: 'var(--r-sm) var(--r-sm) 3px 3px', transformOrigin: 'bottom', animation: 'barGrow .7s ease both' }} />
{wk.w}
))}
);
}
Object.assign(window, { Dashboard, AvatarScreen, HistoryScreen });