File size: 3,995 Bytes
67c1024 4abae96 67c1024 4abae96 67c1024 4abae96 67c1024 4abae96 67c1024 4abae96 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | // components/progress.js
// Visual chart of student progress
window.renderProgress = function() {
const content = document.getElementById('content');
const days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
const today = new Date().getDay(); // 0 = Sun, 1 = Mon...
const adjustedToday = today === 0 ? 6 : today - 1; // Make Mon = 0
content.innerHTML = `
<div class="progress-section section active" id="progress">
<h1 class="progress-title">π Your Progress</h1>
<div class="progress-dashboard">
<div class="stat-cards">
<div class="stat-card concepts-card">
<div class="stat-icon">π§ </div>
<h3>Concepts Mastered</h3>
<div class="stat-number">${state.conceptsCompleted.length}</div>
<div class="stat-total">of 5 total</div>
<div class="mini-progress">
<div class="mini-bar" style="width: ${(state.conceptsCompleted.length/5)*100}%"></div>
</div>
</div>
<div class="stat-card streak-card">
<div class="stat-icon">π₯</div>
<h3>Current Streak</h3>
<div class="stat-number">${state.streak}</div>
<div class="stat-label">days strong!</div>
<p class="streak-message">${getStreakMessage()}</p>
</div>
<div class="stat-card weekly-card">
<div class="stat-icon">π</div>
<h3>Weekly Goal</h3>
<div class="stat-number">${state.weekProgress}%</div>
<div class="circular-progress">
<svg viewBox="0 0 36 36">
<path d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831" fill="none" stroke="#e2e8f0" stroke-width="3" />
<path d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831" fill="none" stroke="#6366f1" stroke-width="3"
stroke-dasharray="${state.weekProgress}, 100" />
</svg>
</div>
</div>
</div>
<div class="weekly-calendar">
<h3>This Week's Activity</h3>
<div class="calendar-grid">
${days.map((day, idx) => `
<div class="calendar-day ${idx < adjustedToday ? 'completed' : ''} ${idx === adjustedToday ? 'today' : ''}">
<span class="day-name">${day}</span>
<span class="day-status">${idx < adjustedToday ? 'β' : (idx === adjustedToday ? 'β’' : '')}</span>
</div>
`).join('')}
</div>
<p class="calendar-note">${getWeeklyMessage()}</p>
</div>
<div class="insights-card">
<h3>π‘ Insights</h3>
<div class="insight-list">
<div class="insight-item">
<i data-lucide="trending-up"></i>
<div>
<strong>Strongest Area:</strong> Urdhva-Tiryak multiplication
</div>
</div>
<div class="insight-item">
<i data-lucide="target"></i>
<div>
<strong>Focus Next:</strong> Base method (Nikhilam)
</div>
</div>
<div class="insight-item">
<i data-lucide="award"></i>
<div>
<strong>Recent Win:</strong> Solved 67 Γ 38 in under 10 seconds!
</div>
</div>
</div>
</div>
</div>
</div>
`;
if (window.lucide) lucide.createIcons();
};
function getStreakMessage() {
if (state.streak < 2) return "Start your streak today! π₯";
if (state.streak < 7) return "Building momentum! πͺ";
return "Amazing consistency! π";
}
function getWeeklyMessage() {
if (state.weekProgress < 30) return "Start gentle β just 5 minutes today!";
if (state.weekProgress < 70) return "You're halfway there! Keep going! π";
return "Almost at your weekly goal! Finish strong! πͺ";
} |