feat: add settings page and theme toggle component

- Implemented a new SettingsPage component for user preferences including appearance, behavior, and account security settings.
- Added a ThemeToggle component to switch between light, dark, and system modes.
- Created reusable UI components: AlertDialog, Avatar, Badge, Button, Card, Dialog, Input, Label, Progress, ScrollArea, Separator, Sheet, Skeleton, Tooltip.
- Introduced utility functions for class name merging and formatting bytes/uptime.
- Added a custom hook for media query handling
This commit is contained in:
DrSmoothl committed 2026-05-05 00:39:52 +08:00
1 parent f52a84d53f
commit 1426d7adb2
65 files changed
+4687 -4530

No files matched your search

+154 -68
View File
@@ -1,78 +1,164 @@
@import "tailwindcss";
@import "tw-animate-css";
/* ── Global Reset & Base ── */
@custom-variant dark (&:where(.dark, .dark *));
/* ──────────────────────────────────────────────
Theme tokens (sky-blue accent)
────────────────────────────────────────────── */
:root {
color-scheme: light dark;
--radius: 0.75rem;
--background: oklch(99% 0.004 240);
--foreground: oklch(20% 0.03 250);
--card: oklch(100% 0 0);
--card-foreground: oklch(20% 0.03 250);
--popover: oklch(100% 0 0);
--popover-foreground: oklch(20% 0.03 250);
/* sky-500 */
--primary: oklch(68.5% 0.155 230);
--primary-foreground: oklch(99% 0.005 240);
--secondary: oklch(96% 0.012 240);
--secondary-foreground: oklch(25% 0.03 250);
--muted: oklch(96% 0.012 240);
--muted-foreground: oklch(50% 0.02 250);
--accent: oklch(94% 0.03 230);
--accent-foreground: oklch(35% 0.07 230);
--destructive: oklch(60% 0.22 27);
--destructive-foreground: oklch(99% 0.005 240);
--success: oklch(70% 0.15 160);
--warning: oklch(78% 0.16 80);
--border: oklch(92% 0.01 240);
--input: oklch(94% 0.012 240);
--ring: oklch(68.5% 0.155 230);
--sidebar: oklch(98% 0.006 240);
--sidebar-foreground: oklch(25% 0.03 250);
--sidebar-primary: oklch(68.5% 0.155 230);
--sidebar-primary-foreground: oklch(99% 0.005 240);
--sidebar-accent: oklch(94% 0.025 230);
--sidebar-accent-foreground: oklch(35% 0.08 230);
--sidebar-border: oklch(92% 0.01 240);
--sidebar-ring: oklch(68.5% 0.155 230);
}
/* ── HeroUI Avatar base ── */
.avatar {
position: relative;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
border-radius: 9999px;
flex-shrink: 0;
}
.avatar__image {
width: 100%;
height: 100%;
object-fit: cover;
aspect-ratio: 1 / 1;
}
.avatar__fallback {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
.dark {
--background: oklch(16% 0.02 250);
--foreground: oklch(96% 0.01 240);
--card: oklch(20% 0.025 250);
--card-foreground: oklch(96% 0.01 240);
--popover: oklch(20% 0.025 250);
--popover-foreground: oklch(96% 0.01 240);
--primary: oklch(75% 0.14 230);
--primary-foreground: oklch(15% 0.02 250);
--secondary: oklch(25% 0.025 250);
--secondary-foreground: oklch(96% 0.01 240);
--muted: oklch(24% 0.02 250);
--muted-foreground: oklch(68% 0.02 240);
--accent: oklch(28% 0.05 230);
--accent-foreground: oklch(85% 0.1 230);
--destructive: oklch(62% 0.2 27);
--destructive-foreground: oklch(98% 0.005 240);
--success: oklch(72% 0.15 160);
--warning: oklch(80% 0.16 80);
--border: oklch(28% 0.02 250);
--input: oklch(26% 0.02 250);
--ring: oklch(75% 0.14 230);
--sidebar: oklch(18% 0.022 250);
--sidebar-foreground: oklch(92% 0.01 240);
--sidebar-primary: oklch(75% 0.14 230);
--sidebar-primary-foreground: oklch(15% 0.02 250);
--sidebar-accent: oklch(28% 0.05 230);
--sidebar-accent-foreground: oklch(85% 0.1 230);
--sidebar-border: oklch(26% 0.02 250);
--sidebar-ring: oklch(75% 0.14 230);
}
body {
margin: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
line-height: 1.5;
color: var(--text-primary);
background-color: var(--bg-body);
transition: background-color 0.3s ease, color 0.3s ease;
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-success: var(--success);
--color-warning: var(--warning);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--font-sans: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}
#root {
width: 100%;
height: 100%;
@layer base {
* {
border-color: var(--border);
}
html, body, #root {
height: 100%;
}
body {
margin: 0;
background-color: var(--background);
color: var(--foreground);
font-family: var(--font-sans);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
line-height: 1.5;
}
::selection {
background-color: color-mix(in oklab, var(--primary) 28%, transparent);
color: var(--foreground);
}
/* Density: compact tightens the global rhythm a touch. */
html[data-density="compact"] body {
font-size: 13.5px;
line-height: 1.45;
}
html[data-density="compact"] {
--tw-leading: 1.4;
}
}
* {
box-sizing: border-box;
}
h1, h2, h3, h4, p {
margin: 0;
}
/* ── Scrollbar ── */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.08);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.15);
}
/* ── Selection ── */
::selection {
background: rgba(56, 189, 248, 0.25);
color: #f1f5f9;
}