diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index 5594e22..52dcc5c 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -6,39 +6,103 @@ import { RecentActivityCard } from "@/components/dashboard/recent-activity-card" export default function DashboardPage() { return ( -
+
+ {/* Background Layers */} +
+ {/* Light Mode Wavy Refraction Background (Properly visible at the top) */} +
+
+ {/* Top Section Divider for visual separation from Universities */}
{/* 1. Premium Welcome Banner (Full Width) */} -
-
-
-
+
+ {/* Ambient Background Glow (Dark Mode only) */} +
+
-
-
-
- Student Dashboard -
-

- Welcome Back 👋 +
+
+ Student Dashboard +
+ +
+

+ Welcome Back, Alex{" "} + 👋

-

- Pick up where you left off. Access your syllabus, study your - AI-generated notes, and practice with past year questions. +

+ Pick up where you left off. Access your personalized syllabus, + study your AI-generated notes, and practice with past year + questions.

+ + {/* Decorative Activity Pulse (Hidden on mobile) */} +
+ + {/* Faint Background Track */} + + {/* Live Pulse (subtle) */} + + +
+ + + + + + Workspace Active + +
+

-
+
{/* 2. Continue Learning Section (Left side) */}
-
+

Continue Learning

@@ -49,23 +113,25 @@ export default function DashboardPage() { View all history →
-
+
@@ -73,12 +139,12 @@ export default function DashboardPage() { {/* 3. Quick Actions (Right side grid) */}
-
+

Quick Actions

-
+
-
+ {/* Subtle Radial Glow on the Right Edge (Only in Dark Mode or very faint in Light Mode) */} +
-
-
- -
+
+ + {/* Top Section: Icon */} +
- +
-
-

+ {/* Bottom Section: Text */} +
+

{title}

-

+

{description}

diff --git a/components/dashboard/recent-activity-card.tsx b/components/dashboard/recent-activity-card.tsx index 35a1784..168b7a3 100644 --- a/components/dashboard/recent-activity-card.tsx +++ b/components/dashboard/recent-activity-card.tsx @@ -7,8 +7,10 @@ interface RecentActivityCardProps { href: string; timeAgo: string; progressText: string; - statusColor: string; + statusColor?: string; // Kept for backwards compatibility type: "book" | "file"; + progressValue: number; + theme?: "cyan" | "orange"; } export function RecentActivityCard({ @@ -17,46 +19,85 @@ export function RecentActivityCard({ href, timeAgo, progressText, - statusColor, type, + progressValue, + theme = "cyan", }: RecentActivityCardProps) { const Icon = type === "book" ? BookOpen : FileText; + // Determine dynamic colors based on theme + const isCyan = theme === "cyan"; + const barBgClass = isCyan + ? "bg-cyan-400 shadow-[0_0_15px_rgba(34,211,238,0.56)]" + : "bg-orange-400 shadow-[0_0_15px_rgba(251,146,60,0.56)]"; + const dotClass = isCyan + ? "bg-white shadow-[0_0_10px_rgba(34,211,238,1)]" + : "bg-white shadow-[0_0_10px_rgba(251,146,60,1)]"; + const statusDotClass = isCyan ? "bg-cyan-400" : "bg-orange-400"; + return ( -
- -
-
-
- +
+ {/* Header Row */} +
+
+
+ +
+
+

+ {title} +

+

+ {subtitle} +

+
-
-

- {title} -

-

- {subtitle} -

+ +
+
+ + {timeAgo} +
+ + {progressValue}% complete +
-
- - {timeAgo} -
-
-
-
- - {progressText} + {/* Full-Width Progress Bar Row */} +
+
+ {/* Glowing Knob */} +
-
- Resume{" "} - + + {/* Footer Row */} +
+
+ + {progressText} +
+
+ Resume{" "} + +
diff --git a/components/syllabus/module-card.tsx b/components/syllabus/module-card.tsx index 806f27c..3fb4fae 100644 --- a/components/syllabus/module-card.tsx +++ b/components/syllabus/module-card.tsx @@ -104,18 +104,28 @@ export default function ModuleCard({ {/* TOPICS - ALWAYS VISIBLE */}
- {(module.topics || []).map((topic) => ( - e.stopPropagation()} - className="rounded-full border border-border bg-background px-4 py-2 text-sm font-medium text-foreground transition hover:border-blue-500/40 hover:text-blue-500" - > - {topic.title} - - ))} + {(module.topics || []).map((topic, index) => { + const isString = typeof topic === "string"; + const topicId = isString + ? (topic as string) + : (topic as { id: string }).id; + const topicTitle = isString + ? (topic as string) + : (topic as { title: string }).title; + + return ( + e.stopPropagation()} + className="rounded-full border border-border bg-background px-4 py-2 text-sm font-medium text-foreground transition hover:border-blue-500/40 hover:text-blue-500" + > + {topicTitle} + + ); + })}
diff --git a/lib/content/index.ts b/lib/content/index.ts index a073467..ff21bb2 100644 --- a/lib/content/index.ts +++ b/lib/content/index.ts @@ -98,11 +98,21 @@ export async function getTopicById( for (const syllabusModule of modules) { const topics = syllabusModule.topics ?? []; - const topic = topics.find((item) => item.id === topicId); + const topic = topics.find((item) => { + if (typeof item === "string") { + return item === topicId; + } + return (item as { id: string }).id === topicId; + }); if (topic) { + const topicObj = + typeof topic === "string" + ? ({ id: topic, title: topic, slug: topic, displayOrder: 0 } as Topic) + : (topic as Topic); + return { - topic, + topic: topicObj, module: { id: syllabusModule.id, number: syllabusModule.number,