feat: clock fonts and glass and tinted clock styles
images / check (push) Successful in 27s
images / image (push) Successful in 28s

This commit is contained in:
2026-11-18 16:56:46 +01:00
parent 4a4401ddb0
commit 7798432de6
14 changed files with 932 additions and 25 deletions
+71
View File
@@ -10,6 +10,7 @@ import {
ArrowLeft,
Check,
CircleUser,
Clock,
Image,
LogOut,
Search,
@@ -19,6 +20,13 @@ import {
import { Logo } from "@/components/logo"
import { DEFAULT_WALLPAPER } from "@/components/wallpaper"
import { authClient } from "@/lib/auth-client"
import {
CLOCK_FONTS,
CLOCK_FONT_NAMES,
CLOCK_STYLES,
CLOCK_STYLE_NAMES,
} from "@/lib/clock"
import type { ClockFont, ClockStyle } from "@/lib/clock"
import { getDashboard, saveSettings } from "@/lib/dashboard.functions"
import { ENGINES, ENGINE_NAMES } from "@/lib/search"
import type { Engine } from "@/lib/search"
@@ -68,6 +76,7 @@ export const Route = createFileRoute("/settings")({
const SECTIONS = [
{ id: "general", label: "General", icon: SlidersHorizontal },
{ id: "clock", label: "Clock", icon: Clock },
{ id: "search", label: "Search", icon: Search },
{ id: "wallpaper", label: "Wallpaper", icon: Image },
{ id: "account", label: "Account", icon: CircleUser },
@@ -97,6 +106,8 @@ function Settings() {
title?: string
searchEngine?: Engine
wallpaperUrl?: string | null
clockFont?: ClockFont
clockStyle?: ClockStyle
}) => run(() => saveSettings({ data: patch }))
const upload = (image: File) =>
run(async () => {
@@ -215,6 +226,66 @@ function Settings() {
</SettingsRow>
</SettingsSection>
<SettingsSection id="clock" className={section}>
<SettingsSectionHeader>
<SettingsSectionTitle>Clock</SettingsSectionTitle>
<SettingsSectionDescription>
How the time on the dashboard looks.
</SettingsSectionDescription>
</SettingsSectionHeader>
<SettingsRow>
<SettingsRowText>
<div id="settings-font" className="leading-tight font-bold">
Font
</div>
</SettingsRowText>
<SettingsRowControl>
<SegmentedControl
aria-labelledby="settings-font"
size="md"
value={data.clockFont}
onValueChange={(v) => save({ clockFont: v as ClockFont })}
>
{CLOCK_FONTS.map((f) => (
<SegmentedControlItem key={f} value={f}>
{CLOCK_FONT_NAMES[f]}
</SegmentedControlItem>
))}
</SegmentedControl>
</SettingsRowControl>
</SettingsRow>
<SettingsRow>
<SettingsRowText>
<div
id="settings-style"
className="leading-tight font-bold"
>
Style
</div>
<SettingsRowDescription>
Glass shows the wallpaper blurred through the digits.
Tinted takes its color from the wallpaper.
</SettingsRowDescription>
</SettingsRowText>
<SettingsRowControl>
<SegmentedControl
aria-labelledby="settings-style"
size="md"
value={data.clockStyle}
onValueChange={(v) =>
save({ clockStyle: v as ClockStyle })
}
>
{CLOCK_STYLES.map((s) => (
<SegmentedControlItem key={s} value={s}>
{CLOCK_STYLE_NAMES[s]}
</SegmentedControlItem>
))}
</SegmentedControl>
</SettingsRowControl>
</SettingsRow>
</SettingsSection>
<SettingsSection id="search" className={section}>
<SettingsSectionHeader>
<SettingsSectionTitle>Search</SettingsSectionTitle>