forge
Explore
Log in

Don't you dare go Hollow

🎨 add subtle dashboard color accents

Browse files at this commit

69e9aa535b9ff0d85f88a51782d1eb96c4598a7bBurak BoduroğluParent: 20c2a2a
  • style
    • 🎨 add subtle dashboard color accents
Show full message
style: 🎨 add subtle dashboard color accents

- add role-aware chip tones and route-aware portal icon accents

- turn dashboard counts into small capsule badges for better visual rhythm

- add low-opacity section tints for portal and attention areas

- give EmptyState icons kind-based accent colors
src/components/ui/empty-state.tsxmodified+14 -6
@@ -3,6 +3,14 @@ import { cn } from "@/lib/cn";
33
44 export type EmptyStateKind = "default" | "notes" | "exams" | "events" | "courses";
55
6+const KIND_TONE: Record<EmptyStateKind, string> = {
7+ default: "border-primary/20 bg-primary/10 text-primary",
8+ notes: "border-amber-500/20 bg-amber-500/10 text-amber-700 dark:text-amber-300",
9+ exams: "border-indigo-500/20 bg-indigo-500/10 text-indigo-700 dark:text-indigo-300",
10+ events: "border-emerald-500/20 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",
11+ courses: "border-sky-500/20 bg-sky-500/10 text-sky-700 dark:text-sky-300",
12+};
13+
614 /** Clean dashed empty panel with animated vector illustrations. */
715 export function EmptyState(props: {
816 title: string;
@@ -19,24 +27,24 @@ export function EmptyState(props: {
1927 props.class,
2028 )}
2129 >
22- <div class="relative flex h-16 w-16 items-center justify-center rounded-2xl border border-primary/20 bg-primary/10 text-primary shadow-inner">
30+ <div class={cn("relative flex h-16 w-16 items-center justify-center rounded-2xl border shadow-inner", KIND_TONE[kind()])}>
2331 <Show when={kind() === "notes"}>
24- <svg class="h-8 w-8 text-primary" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
32+ <svg class="h-8 w-8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
2533 <path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1-2.5-2.5Z" />
2634 <path d="M6 6h10" />
2735 <path d="M6 10h8" />
28- <circle cx="18" cy="18" r="2.5" class="fill-primary/20 stroke-primary" />
36+ <circle cx="18" cy="18" r="2.5" class="fill-current opacity-30" />
2937 </svg>
3038 </Show>
3139 <Show when={kind() === "exams"}>
32- <svg class="h-8 w-8 text-primary" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
40+ <svg class="h-8 w-8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
3341 <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
3442 <polyline points="14 2 14 8 20 8" />
3543 <path d="m9 15 2 2 4-4" />
3644 </svg>
3745 </Show>
3846 <Show when={kind() === "events"}>
39- <svg class="h-8 w-8 text-primary" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
47+ <svg class="h-8 w-8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
4048 <rect width="18" height="18" x="3" y="4" rx="2" ry="2" />
4149 <line x1="16" x2="16" y1="2" y2="6" />
4250 <line x1="8" x2="8" y1="2" y2="6" />
@@ -45,7 +53,7 @@ export function EmptyState(props: {
4553 </svg>
4654 </Show>
4755 <Show when={kind() === "default" || kind() === "courses"}>
48- <svg class="h-8 w-8 text-primary" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
56+ <svg class="h-8 w-8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
4957 <path d="M22 10v6M2 10l10-5 10 5-10 5z" />
5058 <path d="M6 12v5c3 3 9 3 12 0v-5" />
5159 </svg>
src/pages/dashboard-page.tsxmodified+23 -5
@@ -72,6 +72,24 @@ const ROLE_KEY: Record<Role, MessageKey> = {
7272 admin: "role.admin",
7373 };
7474
75+const ROLE_TONE: Record<Role, string> = {
76+ student: "border-sky-500/25 bg-sky-500/10 text-sky-700 dark:text-sky-300",
77+ parent: "border-violet-500/25 bg-violet-500/10 text-violet-700 dark:text-violet-300",
78+ teacher: "border-emerald-500/25 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",
79+ manager: "border-amber-500/25 bg-amber-500/10 text-amber-700 dark:text-amber-300",
80+ admin: "border-rose-500/25 bg-rose-500/10 text-rose-700 dark:text-rose-300",
81+};
82+
83+function portalTone(to: string) {
84+ if (to.includes("exam")) return "border-indigo-500/20 bg-indigo-500/10 text-indigo-700 group-hover:bg-indigo-500/15 dark:text-indigo-300";
85+ if (to.includes("course") || to.includes("studies") || to.includes("clubs")) return "border-sky-500/20 bg-sky-500/10 text-sky-700 group-hover:bg-sky-500/15 dark:text-sky-300";
86+ if (to.includes("event") || to.includes("calendar")) return "border-amber-500/20 bg-amber-500/10 text-amber-700 group-hover:bg-amber-500/15 dark:text-amber-300";
87+ if (to.includes("mark") || to.includes("attendance")) return "border-emerald-500/20 bg-emerald-500/10 text-emerald-700 group-hover:bg-emerald-500/15 dark:text-emerald-300";
88+ if (to.includes("message") || to.includes("student") || to.includes("users")) return "border-violet-500/20 bg-violet-500/10 text-violet-700 group-hover:bg-violet-500/15 dark:text-violet-300";
89+ if (to.includes("work") || to.includes("settings")) return "border-slate-500/20 bg-slate-500/10 text-slate-700 group-hover:bg-slate-500/15 dark:text-slate-300";
90+ return "border-primary/20 bg-primary/10 text-primary group-hover:bg-primary/15";
91+}
92+
7593 function examWindow(exam: Exam, now: number): AttentionKind | "upcoming" | "past" | "unscheduled" {
7694 const status = examDisplayStatus(exam, now);
7795 if (status === "active") return "active";
@@ -424,7 +442,7 @@ function DashboardContent() {
424442 <p class="text-sm text-muted-foreground">{t("dashboard.observationOnly")}</p>
425443 </div>
426444 <div class="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
427- <span class="rounded-full border border-border bg-background px-2.5 py-1 font-semibold text-foreground shadow-sm">
445+ <span class={cn("rounded-full border px-2.5 py-1 font-semibold shadow-sm", ROLE_TONE[role()])}>
428446 {t(ROLE_KEY[role()])}
429447 </span>
430448 <span class="inline-flex items-center gap-2 rounded-full border border-border/70 bg-background/70 px-2.5 py-1 mono tabular-nums shadow-sm">
@@ -440,7 +458,7 @@ function DashboardContent() {
440458
441459 <Show when={!loading()} fallback={<div class="px-4 py-8"><PageSpinner /></div>}>
442460 <div class="space-y-5 bg-muted/20 px-4 py-4 sm:px-5 sm:py-5">
443- <section class="space-y-2.5" aria-labelledby="dash-sections">
461+ <section class="space-y-2.5 rounded-3xl border border-sky-500/10 bg-sky-500/[0.025] p-3 sm:p-4" aria-labelledby="dash-sections">
444462 <div class="flex items-center justify-between gap-3">
445463 <h2 id="dash-sections" class="text-sm font-semibold tracking-tight text-foreground">
446464 {t("dashboard.roleLinks")}
@@ -495,7 +513,7 @@ function DashboardContent() {
495513
496514 <Show when={role() !== "parent"}>
497515 <div class="grid items-stretch gap-5">
498- <section class="flex min-h-[17rem] flex-col space-y-2.5" aria-labelledby="dash-attention">
516+ <section class="flex min-h-[17rem] flex-col space-y-2.5 rounded-3xl border border-amber-500/10 bg-amber-500/[0.025] p-3 sm:p-4" aria-labelledby="dash-attention">
499517 <div class="flex items-baseline justify-between gap-2">
500518 <h2 id="dash-attention" class="text-sm font-semibold tracking-tight text-foreground">
501519 {t("dashboard.attention")}
@@ -583,7 +601,7 @@ function PortalCard(props: {
583601
584602 const cardInner = () => (
585603 <>
586- <span class="mt-0.5 flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-black/[0.05] bg-muted/30 text-muted-foreground transition-colors group-hover:border-border group-hover:bg-muted/50 group-hover:text-foreground dark:border-white/[0.08]">
604+ <span class={cn("mt-0.5 flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border transition-colors", portalTone(props.card.to))}>
587605 <Icon class="h-5 w-5" />
588606 </span>
589607 <div class="min-w-0 flex-1 space-y-1">
@@ -593,7 +611,7 @@ function PortalCard(props: {
593611 <span class="hidden text-muted-foreground/40 sm:inline" aria-hidden="true">
594612 |
595613 </span>
596- <span class="mono shrink-0 text-sm font-semibold tabular-nums tracking-tight text-foreground sm:text-base">
614+ <span class="mono shrink-0 rounded-full border border-black/[0.06] bg-background/80 px-2 py-0.5 text-xs font-semibold tabular-nums tracking-tight text-foreground shadow-sm dark:border-white/[0.08] sm:text-sm">
597615 {props.card.stat}
598616 </span>
599617 </Show>