From 456cdf9714bd2d071d96458be41f6d73b3b6198d Mon Sep 17 00:00:00 2001 From: Mustafa Cetin Date: Wed, 29 Jul 2026 05:58:27 +0000 Subject: [PATCH] feat: styling improvements + grade trend chart + student comparison - Enhanced reports, grading, attendance, settings views with gradient headers, hover effects, section icons - Added grade trend over time chart (AreaChart with reversed Y-axis) - Added student comparison feature in competence flower (dual radar overlay) - Added 6 new i18n keys for grade trend and comparison - Lint passes cleanly --- src/components/attendance-view.tsx | 65 +++---- src/components/competence-flower-view.tsx | 92 +++++++++- src/components/grading-view.tsx | 209 +++++++++++++++++++--- src/components/reports-view.tsx | 96 +++++++--- src/components/settings-view.tsx | 33 ++-- src/lib/i18n.ts | 12 ++ 6 files changed, 413 insertions(+), 94 deletions(-) diff --git a/src/components/attendance-view.tsx b/src/components/attendance-view.tsx index ee55c79..afb7837 100644 --- a/src/components/attendance-view.tsx +++ b/src/components/attendance-view.tsx @@ -259,16 +259,16 @@ function MonthlyHeatmap({ sessions }: { sessions: AttendanceSession[] }) { const data = dateMap.get(dateKey); if (!data || data.total === 0) return 'bg-gray-100 dark:bg-gray-800'; const rate = data.present / data.total; - if (rate >= 0.9) return 'bg-emerald-500 dark:bg-emerald-600'; - if (rate >= 0.7) return 'bg-emerald-400 dark:bg-emerald-500'; - if (rate >= 0.5) return 'bg-emerald-300 dark:bg-emerald-700'; - if (rate >= 0.3) return 'bg-emerald-200 dark:bg-emerald-800'; - return 'bg-rose-300 dark:bg-rose-700'; + if (rate >= 0.9) return 'bg-gradient-to-br from-emerald-500 to-emerald-600 dark:from-emerald-500 dark:to-emerald-600'; + if (rate >= 0.7) return 'bg-gradient-to-br from-emerald-400 to-teal-500 dark:from-emerald-500 dark:to-emerald-600'; + if (rate >= 0.5) return 'bg-gradient-to-br from-emerald-300 to-emerald-400 dark:from-emerald-700 dark:to-emerald-800'; + if (rate >= 0.3) return 'bg-gradient-to-br from-amber-200 to-amber-300 dark:from-emerald-800 dark:to-emerald-900'; + return 'bg-gradient-to-br from-rose-300 to-rose-400 dark:from-rose-700 dark:to-rose-800'; } return ( - - + + {t('attendance.calendar')} — {monthNames[month]} {year} @@ -290,7 +290,7 @@ function MonthlyHeatmap({ sessions }: { sessions: AttendanceSession[] }) {
{cell.day && ( @@ -323,11 +323,11 @@ function MonthlyHeatmap({ sessions }: { sessions: AttendanceSession[] }) { {t('attendance.absent')}
-
-
-
-
-
+
+
+
+
+
{t('attendance.present')}
@@ -401,14 +401,15 @@ function StatsCards({ sessions }: { sessions: AttendanceSession[] }) { return (
- {cards.map((card) => ( + {cards.map((card, idx) => ( - +
@@ -551,7 +552,7 @@ function SessionDetail({ size="sm" onClick={handleSaveAll} disabled={saving} - className="bg-emerald-600 hover:bg-emerald-700 text-white" + className="bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white shadow-md shadow-emerald-300/20 rounded-xl" > {saving ? ( @@ -604,7 +605,7 @@ function SessionDetail({ ].map((s) => (
{s.value}
{s.label}
@@ -912,7 +913,7 @@ export default function AttendanceView() { {t('attendance.title')} -

{t('attendance.subtitle')}

+

{t('attendance.subtitle')}

@@ -936,13 +937,15 @@ export default function AttendanceView() { {/* New session button */} - + + + @@ -986,7 +989,7 @@ export default function AttendanceView() {
)} + {selectedClass && selectedSubjectId && selectedStudentId && ( +
+ + +
+ )}
@@ -529,6 +583,18 @@ export default function CompetenceFlowerView() { > {showClassAverage ? t('flower.hide_average') : t('flower.show_average')} + {/* Clear comparison button */} + {compareStudentId && ( + + )}
@@ -544,6 +610,10 @@ export default function CompetenceFlowerView() { + + + + )} + {/* Comparison student radar */} + {compareStudentId && compareFlowerData && ( + + )} { const isStudent = value === flowerData.studentName; - const Icon = isStudent ? Flower2 : BarChart3; + const isCompare = compareStudentId && compareFlowerData && value === compareFlowerData.studentName; + const Icon = isStudent ? Flower2 : isCompare ? GitCompareArrows : BarChart3; return ( {value} diff --git a/src/components/grading-view.tsx b/src/components/grading-view.tsx index 9b56435..16db01b 100644 --- a/src/components/grading-view.tsx +++ b/src/components/grading-view.tsx @@ -1,10 +1,16 @@ 'use client'; import React, { useEffect, useMemo, useState } from 'react'; +import { motion } from 'framer-motion'; +import { + LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, + ResponsiveContainer, ReferenceLine, Area, AreaChart, +} from 'recharts'; import { Calculator, Plus, TrendingUp, BarChart3, Target, Download, BookOpen, Star, ThumbsUp, AlertTriangle, Circle, + Activity, Award, } from 'lucide-react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; @@ -255,7 +261,23 @@ export default function GradingView() { } return ( -
+ + {/* Section header */} +
+
+ +
+
+

{t('grading.title')}

+

{t('grading.empty_description')}

+
+
+ {/* Selection header */} @@ -300,10 +322,12 @@ export default function GradingView() { {t('grading.create_scheme')} - + + +