Pilates Andrea
Movimiento consciente Β· cuerpo fuerte
mente en equilibrio
ΒΏCuΓ‘l es tu nombre?
Pilates Andrea
Profe
A
A
Pilates Andrea
Hola, alumna 🀍
Movimiento consciente Β· cuerpo fuerte Β· mente en equilibrio
PrΓ³xima clase
18:30
Lunes 23 de febrero
calculando...
Mi Turno
Tu clase fija semanal
DΓ­asLun Β· MiΓ© Β· Vie
Hora18:30 hs
DisciplinaReformer
InstructoraLaura M.
EstadoConfirmado
Avisar Falta
NotificΓ‘ tu ausencia con anticipaciΓ³n
πŸ™
ΒΏVas a faltar?
AvisΓ‘ antes de las 20 hs del dΓ­a anterior
para poder recuperar la clase.
Faltas del mes
Faltas registradas2
Recuperos disponibles2
Recuperos
Clases disponibles esta semana
Asistencia
Febrero 2026
0
Total
0
Presentes
0
Ausencias
Historial
Mi Plan
Paquete mensual Β· Vence 28 feb 2026
8
clases / mes
12
clases / mes
Plan activo
12
clases por mes
0
Usadas
0
Restantes
Progreso del mes0%
Panel Profe
Vista exclusiva Β· Febrero 2026
Acceso Profe
IngresΓ‘ tu contraseΓ±a para continuar
🌿
Cargando...
{n:'Andrea M.', plan:12, usadas:7, pagado:true, av:'A'}, {n:'SofΓ­a R.', plan:8, usadas:5, pagado:true, av:'S'}, {n:'Valentina G.', plan:12, usadas:9, pagado:false, av:'V'}, {n:'Luciana P.', plan:8, usadas:3, pagado:true, av:'L'}, {n:'Camila F.', plan:12, usadas:10, pagado:true, av:'C'}, ]; const RECUPEROS = [ {id:'r1',day:'Lunes 23', time:'17:30',taken:false}, {id:'r2',day:'Lunes 23', time:'19:30',taken:false}, {id:'r3',day:'Martes 24', time:'18:30',taken:false}, {id:'r4',day:'MiΓ©rcoles 25',time:'17:30',taken:false}, {id:'r5',day:'Jueves 26', time:'19:30',taken:false}, ]; const DN=['Dom','Lun','Mar','MiΓ©','Jue','Vie','SΓ‘b']; const MN=['ene','feb','mar','abr','may','jun','jul','ago','sep','oct','nov','dic']; const MN_LARGO=['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre']; const PASS='1234'; let planTotal=12, profeOk=false; // ── FECHA DINÁMICA ──────────────────────────────────────────────────────────── const HOY = new Date(); // siempre la fecha real de hoy // Calcula la prΓ³xima clase (Lun/MiΓ©/Vie a las 18:30, o Vie solo si es viernes) function getNextClass() { const now = new Date(); const classDays = [1,3,5]; // Lun=1, MiΓ©=3, Vie=5 for (let i = 0; i <= 7; i++) { const d = new Date(now); d.setDate(now.getDate() + i); d.setHours(18,30,0,0); if (classDays.includes(d.getDay()) && d > now) return d; } return null; } // Actualiza la card de prΓ³xima clase en home function updateNextClassCard() { const next = getNextClass(); if (!next) return; const dayEl = document.querySelector('.nc-day'); if (dayEl) dayEl.textContent = `${DN[next.getDay()]} ${next.getDate()} de ${MN_LARGO[next.getMonth()]}`; } // Actualiza el subtΓ­tulo del mes en asistencia y plan function updateMonthLabels() { const mesLabel = `${MN_LARGO[HOY.getMonth()]} ${HOY.getFullYear()}`; const lastDay = new Date(HOY.getFullYear(), HOY.getMonth()+1, 0).getDate(); const vence = `${lastDay} ${MN[HOY.getMonth()]} ${HOY.getFullYear()}`; const asistSub = document.querySelector('#s-asistencia .page-sub'); if (asistSub) asistSub.textContent = mesLabel; const planSub = document.querySelector('#s-plan .page-sub'); if (planSub) planSub.textContent = `Paquete mensual Β· Vence ${vence}`; const profeSub = document.querySelector('#s-profe .page-sub'); if (profeSub) profeSub.textContent = `Vista exclusiva Β· ${mesLabel}`; } // Actualiza modal de falta con fecha real function updateFaltaModal() { const next = getNextClass(); if (!next) return; const label = `${DN[next.getDay()]} ${next.getDate()} de ${MN_LARGO[next.getMonth()]} a las 18:30 hs`; const sub = document.querySelector('#faltaOverlay .modal-sub'); if (sub) sub.innerHTML = `ΒΏConfirmΓ‘s que vas a faltar a la clase del ${label}?

QuedarΓ‘ disponible un recupero.`; const faltaBtn = document.querySelector('#s-falta .btn-olive'); if (faltaBtn) faltaBtn.textContent = `Confirmar ausencia β€” ${DN[next.getDay()]} ${next.getDate()} ${MN[next.getMonth()]}`; } // ── COUNTDOWN ───────────────────────────────────────────────────────────────── function tick(){ const next = getNextClass(); const el = document.getElementById('heroCd'); if (!next || !el) return; const diff = next - new Date(); if(diff<=0){ el.textContent='Β‘Ahora!'; return; } const d=Math.floor(diff/86400000),h=Math.floor((diff%86400000)/3600000), m=Math.floor((diff%3600000)/60000),s=Math.floor((diff%60000)/1000); const p=n=>String(n).padStart(2,'0'); el.textContent = d>0 ? `en ${d}d ${p(h)}:${p(m)}:${p(s)}` : `en ${p(h)}:${p(m)}:${p(s)}`; } setInterval(tick,1000); tick(); // ── NAV ─────────────────────────────────────────────────────────────────────── function go(name,btn){ if(name==='profe'){showLogin();return;} const map={home:'s-home',asistencia:'s-asistencia',plan:'s-plan'}; document.querySelectorAll('.screen').forEach(s=>s.classList.remove('active')); document.querySelectorAll('.bnav-btn').forEach(b=>b.classList.remove('active')); document.getElementById(map[name]).classList.add('active'); if(btn)btn.classList.add('active'); if(name==='asistencia')renderAttendance(); if(name==='plan')renderPlan(); } function goScreen(id){ document.querySelectorAll('.screen').forEach(s=>s.classList.remove('active')); document.getElementById(id).classList.add('active'); if(id==='s-recuperos')renderRecuperos(); } // ── HOME ────────────────────────────────────────────────────────────────────── function renderHome(){ document.getElementById('homeRecent').innerHTML=HISTORY.slice(0,4).map(h=>{ const d=new Date(h.date),p=h.status==='present'; return `
${DN[d.getDay()]} ${d.getDate()} ${MN[d.getMonth()]}
${h.time} hs
${p?'Presente':'Ausente'}
`; }).join(''); } // ── ATTENDANCE ──────────────────────────────────────────────────────────────── function renderAttendance(){ const present=HISTORY.filter(h=>h.status==='present').length, absent=HISTORY.length-present; document.getElementById('stTotal').textContent=HISTORY.length; document.getElementById('stPresent').textContent=present; document.getElementById('stAbsent').textContent=absent; document.getElementById('historyBody').innerHTML=HISTORY.map(h=>{ const d=new Date(h.date),p=h.status==='present'; return `
${DN[d.getDay()]} ${d.getDate()} ${MN[d.getMonth()]}
Reformer
${h.time}
${p?'Presente':'Ausente'}
`; }).join(''); } // ── RECUPEROS ───────────────────────────────────────────────────────────────── function renderRecuperos(){ document.getElementById('recuperosList').innerHTML=RECUPEROS.map(r=>`
${r.time}
${r.day} Β· Reformer
Laura M. Β· 60 min
${r.taken?`Tomado βœ“`:``}
`).join(''); } function tomarRecupero(id){const r=RECUPEROS.find(x=>x.id===id);if(r){r.taken=true;renderRecuperos();toast('Β‘Recupero reservado! πŸŽ‰');}} // ── PLAN ────────────────────────────────────────────────────────────────────── function setPlan(n){ planTotal=n; document.getElementById('opt8').className='plan-opt'+(n===8?' on':''); document.getElementById('opt12').className='plan-opt'+(n===12?' on':''); renderPlan(); } function renderPlan(){ const used=HISTORY.filter(h=>h.status==='present').length, left=Math.max(0,planTotal-used), pct=Math.round((used/planTotal)*100); document.getElementById('planNum').textContent=planTotal; document.getElementById('planUsed').textContent=used; document.getElementById('planLeft').textContent=left; document.getElementById('planPct').textContent=pct+'%'; setTimeout(()=>{document.getElementById('planBar').style.width=pct+'%';},80); const al=document.getElementById('planAlert'); if(left===0) al.innerHTML=`
⚠️ Agotaste tus clases del mes.
`; else if(left<=2) al.innerHTML=`
⚑ Solo te quedan ${left} clase${left>1?'s':''} este mes.
`; else al.innerHTML=''; } // ── FALTA ───────────────────────────────────────────────────────────────────── function openFaltaModal(){document.getElementById('faltaOverlay').classList.add('open');} function closeFalta(){document.getElementById('faltaOverlay').classList.remove('open');} function confirmarFalta(){ closeFalta(); const b=document.getElementById('turnoEstado'); b.textContent='Falta'; b.className='badge badge-red'; const fc=document.getElementById('faltaCount'); fc.textContent=parseInt(fc.textContent)+1; toast('Falta avisada correctamente βœ“'); setTimeout(()=>goScreen('s-home'),1200); } document.getElementById('faltaOverlay').addEventListener('click',e=>{if(e.target===e.currentTarget)closeFalta();}); // ── LOGIN ───────────────────────────────────────────────────────────────────── function showLogin(){ if(profeOk){goProfe();return;} const ls=document.getElementById('loginScreen'); ls.style.display='flex'; document.getElementById('loginInput').value=''; document.getElementById('loginError').textContent=''; setTimeout(()=>document.getElementById('loginInput').focus(),100); } function hideLogin(){document.getElementById('loginScreen').style.display='none';} function checkLogin(){ if(document.getElementById('loginInput').value===PASS){ profeOk=true; hideLogin(); goProfe(); } else { document.getElementById('loginError').textContent='ContraseΓ±a incorrecta.'; document.getElementById('loginInput').value=''; document.getElementById('loginInput').focus(); } } document.getElementById('loginInput').addEventListener('keydown',e=>{if(e.key==='Enter')checkLogin();}); function goProfe(){ document.querySelectorAll('.screen').forEach(s=>s.classList.remove('active')); document.querySelectorAll('.bnav-btn').forEach(b=>b.classList.remove('active')); document.getElementById('s-profe').classList.add('active'); document.querySelector('[data-nav=profe]').classList.add('active'); document.getElementById('profeBadge').style.display='block'; renderAlumnas(); renderPagos(); renderAsist(); } function logoutProfe(){ profeOk=false; document.getElementById('profeBadge').style.display='none'; go('home',document.querySelector('[data-nav=home]')); toast('SesiΓ³n cerrada.'); } // ── PROFE TABS ──────────────────────────────────────────────────────────────── function setTab(name,btn){ ['alumnas','pagos','asist'].forEach(t=>{ document.getElementById('tab-'+t).style.display=t===name?'block':'none'; }); document.querySelectorAll('.ptab').forEach(b=>{b.classList.remove('active');}); btn.classList.add('active'); } function setMes(btn,mes){ document.querySelectorAll('.mf-btn').forEach(b=>b.classList.remove('active')); btn.classList.add('active'); toast(`Mostrando ${mes}`); } // ── RENDER PROFE ────────────────────────────────────────────────────────────── function renderAlumnas(){ const empty = ALUMNAS.length === 0 ? `
TodavΓ­a no hay alumnas cargadas.
TocΓ‘ + Agregar alumna para empezar.
` : ALUMNAS.map((a,i)=>{ const left=Math.max(0,a.plan-a.usadas), pct=Math.round((a.usadas/a.plan)*100); return `
${a.av}
${a.n}
Plan ${a.plan} clases
${a.pagado?'Al dΓ­a':'Pendiente'}
${a.usadas}
Usadas
${left}
Restantes
Progreso
`; }).join(''); document.getElementById('tab-alumnas').innerHTML = `
${empty}`; } function renderPagos(){ const al=ALUMNAS.filter(a=>!a.pagado).length, ok=ALUMNAS.length-al; const mesLabel = `${MN_LARGO[HOY.getMonth()]} ${HOY.getFullYear()}`; document.getElementById('tab-pagos').innerHTML=`
${ok}
Al dΓ­a
${al}
Pendiente
${ALUMNAS.length}
Total
${mesLabel}
${ALUMNAS.map((a,i)=>`
${a.av}
${a.n}
Plan ${a.plan} clases
`).join('')}
`; } // ── NUEVA ALUMNA ────────────────────────────────────────────────────────────── let naPlanSelected = 12; function openNuevaAlumna(){ document.getElementById('naName').value=''; document.getElementById('naError').textContent=''; naPlanSelected=12; selectNaPlan(12); document.getElementById('nuevaAlumnaOverlay').classList.add('open'); setTimeout(()=>document.getElementById('naName').focus(),150); } function closeNuevaAlumna(){ document.getElementById('nuevaAlumnaOverlay').classList.remove('open'); } function selectNaPlan(n){ naPlanSelected=n; ['8','12'].forEach(v=>{ const el=document.getElementById('naPlan'+v), on=parseInt(v)===n; el.style.background = on?'var(--olive)':'var(--white)'; el.style.borderColor = on?'var(--olive)':'var(--line)'; el.querySelector('div').style.color = on?'white':'var(--ink)'; el.querySelectorAll('div')[1].style.color = on?'rgba(255,255,255,0.6)':'var(--ink2)'; }); } function guardarAlumna(){ const nombre = document.getElementById('naName').value.trim(); if(!nombre){ document.getElementById('naError').textContent='Por favor ingresΓ‘ un nombre'; return; } const existe = ALUMNAS.find(a=>a.n.toLowerCase()===nombre.toLowerCase()); if(existe){ document.getElementById('naError').textContent='Ya existe una alumna con ese nombre'; return; } ALUMNAS.push({ n:nombre, plan:naPlanSelected, usadas:0, pagado:false, av:nombre[0].toUpperCase() }); closeNuevaAlumna(); renderAlumnas(); renderPagos(); renderAsist(); toast(`βœ“ ${nombre.split(' ')[0]} agregada al listado`); } function eliminarAlumna(i){ const nombre = ALUMNAS[i].n.split(' ')[0]; if(confirm(`ΒΏEliminar a ${nombre} del listado?`)){ ALUMNAS.splice(i,1); renderAlumnas(); renderPagos(); renderAsist(); toast(`${nombre} eliminada`); } } document.getElementById('nuevaAlumnaOverlay').addEventListener('click',e=>{if(e.target===e.currentTarget)closeNuevaAlumna();}); document.getElementById('naName').addEventListener('keydown',e=>{if(e.key==='Enter')guardarAlumna();}); // ── TOGGLE PAGO ─────────────────────────────────────────────────────────────── function togglePago(i){ ALUMNAS[i].pagado = !ALUMNAS[i].pagado; const nombre = ALUMNAS[i].n.split(' ')[0]; toast(ALUMNAS[i].pagado ? `βœ“ ${nombre} marcada como pagΓ³` : `${nombre} marcada como pendiente`); renderPagos(); renderAlumnas(); } function renderAsist(){ document.getElementById('tab-asist').innerHTML=ALUMNAS.map(a=>{ const pct=Math.round((a.usadas/a.plan)*100); return `
${a.av}
${a.n}
${a.usadas} / ${a.plan}
`; }).join(''); } // ── ONBOARDING ──────────────────────────────────────────────────────────────── let userName = localStorage.getItem('pa_nombre') || ''; function finishOnboard() { const val = document.getElementById('onboardInput').value.trim(); if (!val) { document.getElementById('onboardError').textContent = 'Por favor ingresΓ‘ tu nombre'; return; } userName = val; localStorage.setItem('pa_nombre', val); document.getElementById('onboarding').style.display = 'none'; applyUserName(); toast('Β‘Bienvenida, ' + val + '! 🌿'); } function applyUserName() { if (!userName) return; const el = document.getElementById('userName'); if (el) el.textContent = userName; const mon = document.getElementById('userMonogram'); if (mon) mon.textContent = userName[0].toUpperCase(); // Update page title in asistencia const sub = document.querySelector('#s-asistencia .page-sub'); if (sub) sub.textContent = userName + ' Β· Febrero 2026'; } function checkOnboard() { if (userName) { document.getElementById('onboarding').style.display = 'none'; applyUserName(); } else { setTimeout(() => document.getElementById('onboardInput').focus(), 100); } } // ── TOAST ───────────────────────────────────────────────────────────────────── function toast(msg){const t=document.getElementById('toast');t.textContent=msg;t.classList.add('show');setTimeout(()=>t.classList.remove('show'),2500);} // ── INIT ────────────────────────────────────────────────────────────────────── renderHome(); renderAttendance(); renderRecuperos(); renderPlan(); updateNextClassCard(); updateMonthLabels(); updateFaltaModal(); checkOnboard();