-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathparents.html
More file actions
330 lines (294 loc) · 19.1 KB
/
Copy pathparents.html
File metadata and controls
330 lines (294 loc) · 19.1 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Parents – LearnSphere</title>
<link rel="stylesheet" href="variables.css">
<script src="theme.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="navbar" role="banner">
<div class="logo"><a href="index.html" aria-label="LearnSphere Home">LearnSphere</a></div>
<!-- Hamburger button — visible only on mobile -->
<button
class="hamburger"
id="hamburgerBtn"
aria-label="Toggle navigation menu"
aria-expanded="false"
aria-controls="navMenu"
>
<span></span>
<span></span>
<span></span>
</button>
<nav id="navMenu" role="navigation" aria-label="Main navigation">
<ul>
<li><a href="explore.html">Explore</a></li>
<li><a href="courses.html">Courses</a></li>
<li><a href="review.html">Review Queue</a></li>
<li><a href="resources.html">Resources</a></li>
<li><a href="community.html">Community</a></li>
</ul>
</nav>
<button id="themeToggleBtn" class="theme-btn" aria-label="Toggle theme"></button>
<!-- Accessibility controls (keyboard accessible, persistent via accessibility.js) -->
<div class="buttons" role="group" aria-label="Accessibility options" style="margin-right:10px;">
<button
type="button"
id="reducedMotionToggle"
class="a11y-btn"
aria-pressed="false"
aria-label="Toggle reduced motion"
>Reduced motion: Off</button>
<button
type="button"
id="fontSizeToggle"
class="a11y-btn"
aria-pressed="true"
aria-label="Toggle larger text"
>Larger text</button>
</div>
<div class="buttons">
<button class="login"><a href="log/login.html">Log in</a></button>
<button class="signup"><a href="log/register.html">Sign up</a></button>
</div>
</header>
<section class="hero">
<div class="hero-content">
<h1>Support for Parents</h1>
<p>Help your child succeed with our guidance and educational resources.</p>
</div>
<div class="hero-image">
<img src="images/parents.jpeg" alt="Parent helping a child study">
</div>
</section>
<section class="content">
<h2>Parent Progress Dashboard</h2>
<p>Accuracy trends, weak topics, and recommended next practice — read-only demo mode.</p>
</section>
<section class="content" style="padding-top:0">
<div data-progress-dashboard="1" class="dashboard-container">
<div class="kpi" style="display:flex;gap:16px;flex-wrap:wrap;margin:0 0 14px 0">
<div class="item" style="min-width:190px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:12px">
<div style="color:rgba(255,255,255,0.72)">Current Streak</div>
<div id="streakValue" style="font-size:26px;margin-top:6px">—</div>
<div id="streakMeta" style="font-size:13px;margin-top:6px;color:rgba(255,255,255,0.72)">—</div>
</div>
<div class="item" style="min-width:190px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:12px">
<div style="color:rgba(255,255,255,0.72)">Overall Accuracy</div>
<div id="overallAccuracyValue" style="font-size:26px;margin-top:6px">—</div>
<div id="overallAccuracyMeta" style="font-size:13px;margin-top:6px;color:rgba(255,255,255,0.72)">—</div>
</div>
<div class="item" style="min-width:190px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:12px">
<div style="color:rgba(255,255,255,0.72)">Daily Goal</div>
<div id="dailyGoalValue" style="font-size:26px;margin-top:6px">—</div>
<div id="dailyGoalMeta" style="font-size:13px;margin-top:6px;color:rgba(255,255,255,0.72)">—</div>
</div>
</div>
<div class="grid-2" style="display:grid;grid-template-columns:1.2fr 0.8fr;gap:16px">
<div class="card" style="background:#0f1115;border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:16px;box-shadow:0 10px 30px rgba(0,0,0,0.2)">
<h2 style="margin-top:0">Accuracy over time</h2>
<canvas id="accuracyChart" style="width:100%;height:240px"></canvas>
<div style="font-size:13px;margin-top:8px;color:rgba(255,255,255,0.72)">Based on last 14 days of quiz attempts.</div>
</div>
<div class="card" style="background:#0f1115;border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:16px;box-shadow:0 10px 30px rgba(0,0,0,0.2)">
<h2 style="margin-top:0">Weak topics (recommended)</h2>
<div id="recommendedTopics" style="margin-top:8px"></div>
<div style="font-size:13px;margin-top:14px;color:rgba(255,255,255,0.72)">We prioritize topics with lower accuracy or fewer attempts.</div>
</div>
</div>
<!-- New Section: Personalized Concept Mastery -->
<div class="card" style="background:#0f1115;border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:16px;box-shadow:0 10px 30px rgba(0,0,0,0.2);margin-top:16px">
<h2 style="margin-top:0; display:flex; align-items:center; gap:8px;">
🎯 Personalized Concept Mastery
</h2>
<p style="font-size:13px; color:rgba(255,255,255,0.72); margin-bottom:16px;">Track mastery levels per specific sub-skill/concept. Recommendations adapt to the weakest areas.</p>
<div class="grid-2" style="display:grid;grid-template-columns:1.1fr 0.9fr;gap:16px">
<div>
<h3 style="margin-top:0; font-size:1.1rem; color: var(--accent-color);">Concept Mastery Details</h3>
<div id="masterySkillsList" class="topic-list" style="display:grid;grid-template-columns:1fr;gap:10px;margin-top:8px">
<div style="font-size:13px; color:rgba(255,255,255,0.72)">No mastery data recorded yet.</div>
</div>
</div>
<div style="border-left: 1px solid rgba(255, 255, 255, 0.08); padding-left: 20px;">
<h3 style="margin-top:0; font-size:1.1rem; color: #ff5e5e;">Top Weak Concepts</h3>
<div id="weakSkillsRecommendations" style="display:flex; flex-direction:column; gap:12px; margin-top:12px;">
<div style="font-size:13px; color:rgba(255,255,255,0.72)">No weak concepts identified yet.</div>
</div>
</div>
</div>
<div style="margin-top:16px; padding-top:14px; border-top:1px solid rgba(255,255,255,0.08);">
<h3 style="margin:0 0 6px; font-size:1.1rem; color: var(--accent-color);">Practice plan for this week</h3>
<div id="practiceSessionsRecommendation" style="font-weight:900; font-size:1.05rem;">Recommended: — short practice sessions this week</div>
<div id="practiceSessionsRecommendationSub" style="font-size:13px; margin-top:6px; color:rgba(255,255,255,0.72)">—</div>
</div>
</div>
<div class="card" style="background:#0f1115;border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:16px;box-shadow:0 10px 30px rgba(0,0,0,0.2);margin-top:16px">
<h2 style="margin-top:0">Topic-wise performance</h2>
<div id="topicStats" class="topic-list" style="display:grid;grid-template-columns:1fr;gap:10px;margin-top:8px"></div>
<div style="font-size:13px;margin-top:8px;color:rgba(255,255,255,0.72)">Shows accuracy + attempts per topic.</div>
</div>
</div>
</section>
<!-- ── Notification Digest Settings ── -->
<section class="content" style="padding-top:0; max-width:980px; margin:0 auto; padding-bottom:32px;">
<div class="card" style="background:#0f1115; border:1px solid rgba(255,255,255,0.08); border-radius:12px; padding:20px; box-shadow:0 10px 30px rgba(0,0,0,0.2); margin-top:16px;" id="digestSettingsCard">
<h2 style="margin-top:0; display:flex; align-items:center; gap:10px;">
📬 Notification Digest Settings
<span style="font-size:0.7rem; font-weight:600; text-transform:uppercase; letter-spacing:0.6px; color:rgba(255,255,255,0.4);">Parents</span>
</h2>
<p style="font-size:13px; color:rgba(255,255,255,0.65); margin-bottom:20px;">
Receive a rolled-up summary of your child's notifications instead of individual alerts.
</p>
<!-- Toggle row -->
<div style="display:flex; align-items:center; gap:16px; margin-bottom:18px;">
<label style="display:flex; align-items:center; gap:10px; cursor:pointer; font-weight:700; font-size:14px;">
<span id="digestToggleKnob" style="
display:inline-flex; width:44px; height:24px; border-radius:999px;
background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2);
align-items:center; padding:2px; cursor:pointer; transition:background 0.25s ease;
position:relative;">
<span id="digestKnobDot" style="
width:18px; height:18px; border-radius:50%;
background:rgba(255,255,255,0.55); transition:transform 0.25s ease;
display:block;"></span>
</span>
Enable Daily Digest
</label>
<span id="digestStatusLabel" style="font-size:12px; color:rgba(255,255,255,0.45);">Off</span>
</div>
<!-- Frequency radio (shown when enabled) -->
<div id="digestFrequencyRow" style="display:none; margin-bottom:18px; padding:14px 16px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:10px;">
<div style="font-size:12px; font-weight:700; color:rgba(255,255,255,0.55); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:10px;">Frequency</div>
<div style="display:flex; gap:16px; flex-wrap:wrap;">
<label style="display:flex; align-items:center; gap:8px; cursor:pointer; font-size:14px;">
<input type="radio" name="digestFreq" id="digestFreqDaily" value="daily" checked style="accent-color:#66fcf1;" />
Daily digest
</label>
<label style="display:flex; align-items:center; gap:8px; cursor:pointer; font-size:14px;">
<input type="radio" name="digestFreq" id="digestFreqWeekly" value="weekly" style="accent-color:#66fcf1;" />
Weekly digest
</label>
</div>
</div>
<!-- Category checkboxes (shown when enabled) -->
<div id="digestCategoriesRow" style="display:none; margin-bottom:18px; padding:14px 16px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:10px;">
<div style="font-size:12px; font-weight:700; color:rgba(255,255,255,0.55); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:10px;">Include categories</div>
<div id="digestCategoryChecks" style="display:flex; flex-wrap:wrap; gap:10px;"></div>
</div>
<!-- Preview + Save row -->
<div style="display:flex; gap:10px; flex-wrap:wrap; margin-top:4px;">
<button id="digestSaveBtn" type="button" style="
background:linear-gradient(135deg,rgba(102,252,241,0.18),rgba(69,162,158,0.14));
border:1px solid rgba(102,252,241,0.4); color:#66fcf1;
border-radius:10px; padding:10px 18px; font-weight:800; cursor:pointer; font-size:13px;
transition:opacity 0.2s;">Save settings</button>
<button id="digestPreviewBtn" type="button" style="
background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.12);
color:rgba(255,255,255,0.8); border-radius:10px; padding:10px 18px;
font-weight:700; cursor:pointer; font-size:13px;">Preview Digest</button>
</div>
<!-- Digest preview area -->
<div id="digestPreviewArea" style="display:none; margin-top:16px; padding:14px 16px; background:rgba(0,0,0,0.25); border:1px solid rgba(255,255,255,0.08); border-radius:10px; font-size:13px;"></div>
<div id="digestSavedMsg" style="display:none; margin-top:12px; color:#66fcf1; font-size:13px; font-weight:700;">✓ Settings saved!</div>
</div>
</section>
<script src="navbar.js"></script>
<script src="script.js"></script>
<script src="accessibility.js" defer></script>
<script src="progress.js"></script>
<script src="quizProgress.js"></script>
<script src="dashboardProgress.js"></script>
<script src="weeklyReport.js"></script>
<script src="notifications.js"></script>
<script>
(function() {
// ── Digest Settings UI ──
const CATEGORY_META_LOCAL = {
grades: { label: "Grades", icon: "📊" },
reminders: { label: "Reminders", icon: "⏰" },
offline_sync: { label: "Sync", icon: "🔄" },
streak: { label: "Streak", icon: "🔥" },
quiz_ready: { label: "Quiz", icon: "📚" },
weekly_report:{ label: "Weekly", icon: "📅" },
general: { label: "General", icon: "🔔" }
};
const knob = document.getElementById("digestToggleKnob");
const dot = document.getElementById("digestKnobDot");
const statusLbl= document.getElementById("digestStatusLabel");
const freqRow = document.getElementById("digestFrequencyRow");
const catRow = document.getElementById("digestCategoriesRow");
const catChecks= document.getElementById("digestCategoryChecks");
const saveBtn = document.getElementById("digestSaveBtn");
const previewBtn = document.getElementById("digestPreviewBtn");
const previewArea= document.getElementById("digestPreviewArea");
const savedMsg = document.getElementById("digestSavedMsg");
function loadAndApply() {
const s = window.notifications?.getDigestSetting?.() || { enabled:false, frequency:"daily", categories:[] };
applyState(s.enabled, s.frequency, s.categories || []);
}
function applyState(enabled, frequency, selectedCats) {
knob.style.background = enabled ? "rgba(102,252,241,0.4)" : "rgba(255,255,255,0.1)";
knob.style.borderColor = enabled ? "rgba(102,252,241,0.7)" : "rgba(255,255,255,0.2)";
dot.style.transform = enabled ? "translateX(20px)" : "translateX(0)";
dot.style.background = enabled ? "#66fcf1" : "rgba(255,255,255,0.55)";
statusLbl.textContent = enabled ? "On" : "Off";
statusLbl.style.color = enabled ? "#66fcf1" : "rgba(255,255,255,0.45)";
freqRow.style.display = enabled ? "block" : "none";
catRow.style.display = enabled ? "block" : "none";
const daily = document.getElementById("digestFreqDaily");
const weekly= document.getElementById("digestFreqWeekly");
if (daily) daily.checked = frequency !== "weekly";
if (weekly) weekly.checked = frequency === "weekly";
// Build category checkboxes
catChecks.innerHTML = "";
Object.entries(CATEGORY_META_LOCAL).forEach(([key, meta]) => {
const isChecked = selectedCats.includes(key) || selectedCats.length === 0;
const label = document.createElement("label");
label.style.cssText = "display:flex; align-items:center; gap:6px; cursor:pointer; font-size:13px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1); border-radius:8px; padding:6px 10px;";
label.innerHTML = `<input type="checkbox" value="${key}" ${isChecked ? "checked" : ""} style="accent-color:#66fcf1;"> ${meta.icon} ${meta.label}`;
catChecks.appendChild(label);
});
}
// Toggle click
knob.addEventListener("click", () => {
const s = window.notifications?.getDigestSetting?.() || { enabled:false, frequency:"daily", categories:[] };
const newEnabled = !s.enabled;
applyState(newEnabled, s.frequency, s.categories || []);
});
// Save
saveBtn.addEventListener("click", () => {
const enabled = dot.style.transform === "translateX(20px)";
const freq = document.getElementById("digestFreqWeekly")?.checked ? "weekly" : "daily";
const cats = [...catChecks.querySelectorAll("input[type=checkbox]:checked")].map(c => c.value);
window.notifications?.setDigestSetting?.({ enabled, frequency: freq, categories: cats });
savedMsg.style.display = "block";
setTimeout(() => { savedMsg.style.display = "none"; }, 2500);
});
// Preview
previewBtn.addEventListener("click", () => {
const s = window.notifications?.getDigestSetting?.() || { frequency:"daily" };
const digest = window.notifications?.buildDigest?.(s.frequency || "daily");
previewArea.style.display = "block";
if (!digest || digest.totalCount === 0) {
previewArea.innerHTML = "<em style='color:rgba(255,255,255,0.5)'>No notifications in the digest period yet.</em>";
return;
}
let html = `<div style="font-weight:700; margin-bottom:10px; color:#66fcf1;">📬 ${s.frequency === "weekly" ? "Weekly" : "Daily"} Digest — ${digest.totalCount} notification${digest.totalCount !== 1 ? "s" : ""} (${digest.unreadCount} unread)</div>`;
Object.entries(digest.grouped).forEach(([cat, items]) => {
const meta = CATEGORY_META_LOCAL[cat] || { label: cat, icon: "🔔" };
html += `<div style="margin-top:10px;"><strong>${meta.icon} ${meta.label}</strong> (${items.length})</div>`;
html += `<ul style="margin:4px 0 0 14px; color:rgba(255,255,255,0.72); line-height:1.6;">`;
items.slice(0, 5).forEach(n => { html += `<li>${n.title} — <span style="opacity:0.65">${n.message}</span></li>`; });
if (items.length > 5) html += `<li style="opacity:0.5">…and ${items.length - 5} more</li>`;
html += "</ul>";
});
previewArea.innerHTML = html;
});
document.addEventListener("DOMContentLoaded", loadAndApply);
})();
</script>
</body>
</html>