Luz de Arcanos limits users to 5 tarot consultations per 24-hour period. This system uses browser localStorage to track usage and implements a rolling 24-hour window for fair access.
tarotForm.addEventListener('submit', async (e) => { e.preventDefault(); clearError(); const name = (document.getElementById('name') as HTMLInputElement).value.trim(); const question = (document.getElementById('question') as HTMLTextAreaElement).value.trim(); if (!name) { showError('Por favor ingresa tu nombre.'); return; } if (!question) { showError('Por favor ingresa tu consulta.'); return; } if (getRemainingReadings() <= 0) { showError('Alcanzaste el límite de 5 consultas por día. Volvé mañana para seguir explorando.'); return; } // ... proceed with consultation});
The limit check happens before drawing cards or calling the API, preventing wasted resources on blocked consultations.
The counter increments only after successful API response:
try { const { data, error } = await actions.tarot.consult({ name, question, cards }); if (error) { resetCards(); showSection('form'); if (error.code === 'BAD_REQUEST') { showError('Los datos enviados no son válidos. Revisá el nombre y la consulta.'); } else { showError('El oráculo no pudo completar tu lectura. Inténtalo de nuevo en unos momentos.'); } return; } incrementUsage(); // Only increments on success renderReading(data.reading);} catch { resetCards(); showSection('form'); showError('No se pudo conectar con el oráculo. Verificá tu conexión e inténtalo de nuevo.');} finally { submitBtn.disabled = false;}
Failed consultations don’t count against the limit - only successful readings increment the counter.