From cdce40e69cd7d4b84267b6fabd2ecae6afa31394 Mon Sep 17 00:00:00 2001 From: zv Date: Thu, 4 Jun 2026 20:10:19 +0200 Subject: [PATCH] style: reduce frontend visual effects --- app/globals.css | 20 +++--- app/layout.tsx | 5 +- components/charts/day-forecast-charts.tsx | 11 +--- components/forecast/day-forecast-modal.tsx | 2 +- components/layout/app-shell.tsx | 4 +- components/warnings/dashboard-warnings.tsx | 4 +- components/weather/weather-effects.tsx | 73 +++------------------- components/weather/weather-hero.tsx | 28 +++++---- lib/chart-theme.ts | 10 +++ lib/theme.ts | 4 ++ lib/weather-utils.ts | 14 ++--- tailwind.config.ts | 2 - 12 files changed, 63 insertions(+), 114 deletions(-) create mode 100644 lib/chart-theme.ts create mode 100644 lib/theme.ts diff --git a/app/globals.css b/app/globals.css index c3f2b26..43b9d93 100644 --- a/app/globals.css +++ b/app/globals.css @@ -12,7 +12,6 @@ --border: 214 20% 82%; --muted: 215 14% 43%; --accent: 207 48% 34%; - --accent-foreground: 0 0% 100%; --warning: 38 58% 42%; --chart-temperature: 207 48% 36%; --chart-feels-like: 216 24% 48%; @@ -22,15 +21,14 @@ .dark { color-scheme: dark; - --background: 214 37% 9%; + --background: 220 22% 12%; --foreground: 210 31% 94%; - --surface: 214 33% 13%; - --surface-muted: 215 27% 17%; - --surface-raised: 214 29% 16%; - --border: 214 19% 27%; + --surface: 220 18% 15%; + --surface-muted: 220 15% 18%; + --surface-raised: 220 16% 17%; + --border: 220 12% 30%; --muted: 214 15% 70%; - --accent: 204 44% 66%; - --accent-foreground: 214 37% 9%; + --accent: 207 34% 64%; --warning: 39 64% 63%; --chart-temperature: 204 44% 66%; --chart-feels-like: 216 22% 73%; @@ -68,15 +66,15 @@ select { @layer utilities { .glass { - @apply border border-border/70 bg-surface/80 shadow-card backdrop-blur-xl dark:bg-surface/75; + @apply border border-border/70 bg-surface shadow-soft; } .glass-subtle { - @apply border border-border/60 bg-surface-muted/65 backdrop-blur-xl dark:bg-surface-muted/55; + @apply border border-border/70 bg-surface-muted shadow-soft; } .surface-control { - @apply border border-border/70 bg-surface/80 shadow-soft backdrop-blur-xl dark:bg-surface-muted/70; + @apply border border-border/70 bg-surface shadow-soft dark:bg-surface-muted; } .section-kicker { diff --git a/app/layout.tsx b/app/layout.tsx index db247cc..5654dfa 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,7 @@ import { Inter } from "next/font/google"; import Script from "next/script"; import { AppShell } from "@/components/layout/app-shell"; import { Providers } from "@/components/layout/providers"; +import { APP_THEME_COLORS } from "@/lib/theme"; import "@/app/globals.css"; const inter = Inter({ subsets: ["latin", "latin-ext"], variable: "--font-inter" }); @@ -36,8 +37,8 @@ export const viewport: Viewport = { initialScale: 1, viewportFit: "cover", themeColor: [ - { media: "(prefers-color-scheme: light)", color: "#eef3f7" }, - { media: "(prefers-color-scheme: dark)", color: "#0e1722" }, + { media: "(prefers-color-scheme: light)", color: APP_THEME_COLORS.light }, + { media: "(prefers-color-scheme: dark)", color: APP_THEME_COLORS.dark }, ], }; diff --git a/components/charts/day-forecast-charts.tsx b/components/charts/day-forecast-charts.tsx index 30f35cf..01e8a79 100644 --- a/components/charts/day-forecast-charts.tsx +++ b/components/charts/day-forecast-charts.tsx @@ -2,21 +2,12 @@ import { Bar, CartesianGrid, ComposedChart, Legend, Line, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts"; import { Card } from "@/components/ui/card"; +import { CHART_COLORS } from "@/lib/chart-theme"; import { useI18n } from "@/lib/i18n"; import { formatForecastRainfall, formatForecastTemperature } from "@/lib/forecast-utils"; import type { HourlyForecast } from "@/types/forecast"; const INITIAL_CHART_DIMENSION = { width: 1, height: 1 }; -const CHART_COLORS = { - grid: "hsl(var(--border) / 0.65)", - tooltipBorder: "hsl(var(--border) / 0.75)", - tooltipBackground: "hsl(var(--surface-raised) / 0.96)", - tooltipText: "hsl(var(--foreground))", - temperature: "hsl(var(--chart-temperature))", - feelsLike: "hsl(var(--chart-feels-like))", - rainfall: "hsl(var(--chart-rainfall))", - probability: "hsl(var(--chart-probability))", -}; function formatHour(value: string) { return value.slice(11, 16); diff --git a/components/forecast/day-forecast-modal.tsx b/components/forecast/day-forecast-modal.tsx index e238977..f21e738 100644 --- a/components/forecast/day-forecast-modal.tsx +++ b/components/forecast/day-forecast-modal.tsx @@ -84,7 +84,7 @@ export function DayForecastModal({ {day ? ( -
+
wtr. @@ -40,7 +40,7 @@ export function AppShell({ children }: { children: React.ReactNode }) {
{children}
-