BREATHE / frontend /src /utils.js
tannuiscoding's picture
added app.py
5a264f5
export const LEVEL_COLORS = {
Minimal: '#2dd4a5',
Mild: '#86efac',
Moderate: '#fbbf24',
Severe: '#fb923c',
Critical: '#f87171',
}
export const LEVEL_BG = {
Minimal: 'rgba(45,212,165,.15)',
Mild: 'rgba(134,239,172,.15)',
Moderate: 'rgba(251,191,36,.15)',
Severe: 'rgba(251,146,60,.15)',
Critical: 'rgba(248,113,113,.15)',
}
export const STRESS_ICONS = {
Minimal: '🟒',
Mild: '🟑',
Moderate: '🟠',
Severe: 'πŸ”΄',
Critical: '🚨',
}
export const ADVICE = {
Minimal: 'Great job! Your stress levels are minimal. Keep up your healthy routines and sleep schedule.',
Mild: 'Mild stress detected. Consider a short walk or 5-minute breathing exercise today.',
Moderate: 'Moderate stress detected. Try scheduling a proper break, reduce screen time and stay hydrated.',
Severe: 'High stress detected. Please prioritise rest, reach out to someone you trust, and consider reducing workload.',
Critical: 'Critical stress indicators found. We strongly recommend speaking with a mental health professional. You are not alone.',
}
export const levelColor = l => LEVEL_COLORS[l] || '#5b9cf6'
export const levelBg = l => LEVEL_BG[l] || 'rgba(91,156,246,.15)'
export const stressIcon = l => STRESS_ICONS[l] || 'βšͺ'
export function formatDate(iso) {
if (!iso) return 'β€”'
return new Date(iso).toLocaleString(undefined, {
year: 'numeric', month: 'short', day: 'numeric',
hour: '2-digit', minute: '2-digit',
})
}