Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 148 additions & 69 deletions src/app/(app)/page.tsx

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions src/app/(app)/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { modelOptions, saveChoice } from "@/components/Assistant";
import { CountryField } from "@/components/CountryPicker";
import { Dropdown } from "@/components/Dropdown";
import { Modal } from "@/components/Modal";
import { ThemeToggle } from "@/components/Nav";
import { SkinPicker, ThemeToggle } from "@/components/Nav";
import { SignOut } from "@/components/SignOut";
import { countryOf } from "@/lib/countries";
import { bandLabel, creditOf, monthText } from "@/lib/credit";
Expand Down Expand Up @@ -120,9 +120,14 @@ export function Settings({ signedIn, local, folder, repo, update, email, profile

{group === "profile" && <ProfileCards email={email} profile={profile} />}
{group === "appearance" && (
<Card title="Theme" what="System follows your device. Saved in this browser.">
<ThemeToggle />
</Card>
<>
<Card title="Theme" what="Retro is Mac OS X circa 2006: Aqua gel buttons, brushed metal and striped rows. Saved in this browser.">
<SkinPicker />
</Card>
<Card title="Light or dark" what="System follows your device. Works with either theme. Saved in this browser.">
<ThemeToggle />
</Card>
</>
)}
{group === "improve" && update && <Card title="A new version of broke is ready" what={folder ? "Your changes stay. Stop broke first, then run this in your broke folder, and start broke again." : "Use Get the latest broke below. Your changes stay."}>{folder && <code className="block font-mono text-[13px] rounded-lg border border-line px-3 py-2">npm run update</code>}</Card>}
{group === "improve" && <ImproveCard folder={folder} repo={repo} />}
Expand Down
67 changes: 64 additions & 3 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
--plum: #2b1840;
--on-ink: #ffffff; /* text on bg-ink */
--chart-mute: #c7d3fa;
--shadow-card: 0 1px 2px #0000000a, 0 6px 20px -8px #00000014;
--shadow-card: 0 1px 2px #0000000a; /* a hairline lift; the border does the work (Mercury look, 2026-11-10) */
--shadow-pop: 0 1px 3px #0000000f, 0 18px 44px -14px #00000038;
--backdrop: #0000004d; /* behind a modal */
color-scheme: light;
Expand Down Expand Up @@ -90,9 +90,9 @@ body {
}
button:not(:disabled):active, a:active { transform: scale(.98); }
.row-hover:hover, a.row-hover:focus-visible { background: var(--hover); }
.card-link { @apply bg-surface rounded-3xl border border-line; box-shadow: var(--shadow-card); }
.card-link { @apply bg-surface rounded-xl border border-line; box-shadow: var(--shadow-card); }
.card-link:hover { background: linear-gradient(0deg, var(--hover), var(--hover)), var(--surface); box-shadow: var(--shadow-pop); }
.card { @apply bg-surface rounded-3xl border border-line; box-shadow: var(--shadow-card); }
.card { @apply bg-surface rounded-xl border border-line; box-shadow: var(--shadow-card); }
.card-title { @apply text-[17px] font-semibold tracking-[-0.01em]; }
/* Headline money: Current Spend, Safe to Spend, balances. */
.figure { @apply text-[32px] leading-tight font-semibold tracking-[-0.025em] tabular-nums; }
Expand All @@ -106,4 +106,65 @@ body {
.select { @apply w-full bg-surface border border-line rounded-xl px-3 py-2.5 text-sm outline-none focus:border-ink; }
.filter { @apply bg-transparent text-sm px-3 py-1.5 rounded-full outline-none hover:bg-[var(--hover)] cursor-pointer; }
.tabular { font-variant-numeric: tabular-nums; }
/* Money: cents smaller and lighter so the dollars read first (components/Amount.tsx). */
.money { font-variant-numeric: tabular-nums; transition: filter var(--dur) var(--ease-out); }
.cents { font-size: .62em; color: var(--muted); margin-left: 1px; vertical-align: .42em; letter-spacing: 0; }
.figure .cents { font-size: .5em; vertical-align: .8em; }
/* Segmented control: 1W / 1M and the like. */
.seg { @apply inline-flex gap-0.5; }
.seg button { @apply px-2 py-0.5 rounded-md text-xs font-medium text-muted hover:bg-[var(--hover)]; }
.seg button[aria-pressed="true"] { @apply bg-[var(--hover-strong)] text-ink; }
}

/* Hide balances (components/Amount.tsx HideMoney): every .money and headline figure blurs. */
.hide-money .money, .hide-money .figure { filter: blur(7px); user-select: none; }

/* Retro theme: Settings > Appearance > Retro. Mac OS X Aqua and iTunes 7, the era of broke's 2006 logo set (design/logo-2000s.png).
Light and dark come from the same System / Light / Dark choice. Charts stay plain in every theme (Max, 2026-11-10). */
:root[data-skin="retro"] {
--canvas: #e4e7ec; --surface: #ffffff; --ink: #141414; --muted: #545b67; --line: #b3b9c3;
--brand: #2f78dc; --brand-soft: #d9e7fb; --chart: #2f78dc; --chart-soft: #d9e7fb; --chart-mute: #a9c8f2;
--good: #2c862c; --bad: #c3312b; --hover: #0000000d; --hover-strong: #00000017;
--shadow-card: 0 1px 3px #00000024; --shadow-pop: 0 2px 4px #00000026, 0 18px 40px -12px #00000059;
--retro-stripe: #ffffff80; --track-1: #c9ced6; --track-2: #eef0f3; --metal-hi: #eceef1; --metal-lo: #c3c8cf; --gel-top: #ffffff; --gel-mid: #e6e9ee; --gel-low: #d3d8df; --gel-edge: #8f96a1;
--aqua-1: #b6dbff; --aqua-2: #5ea6f6; --aqua-3: #2f7fe6; --aqua-4: #86c2ff; --aqua-edge: #2a5ea8; --sel-1: #70adf4; --sel-2: #2d6fd4;
}
@media (prefers-color-scheme: dark) {
:root[data-skin="retro"]:not([data-theme="light"]) {
--canvas: #1b1c1f; --surface: #25262a; --ink: #ececee; --muted: #a3a6ae; --line: #45474e;
--brand: #64a6ff; --brand-soft: #64a6ff26; --chart: #64a6ff; --chart-soft: #64a6ff26; --chart-mute: #2f4d78;
--good: #5fcf6a; --bad: #ff7b72; --hover: #ffffff0f; --hover-strong: #ffffff1c;
--shadow-card: inset 0 1px 0 #ffffff0d, 0 1px 3px #00000066; --shadow-pop: inset 0 1px 0 #ffffff12, 0 18px 44px -14px #000000b3;
--retro-stripe: #ffffff06; --track-1: #141517; --track-2: #2a2b30; --metal-hi: #3c3d42; --metal-lo: #26272b; --gel-top: #55565d; --gel-mid: #3e3f45; --gel-low: #323338; --gel-edge: #141518;
--aqua-1: #7fb9ff; --aqua-2: #3d86e8; --aqua-3: #1f62c7; --aqua-4: #5b9df5; --aqua-edge: #0f3a7a; --sel-1: #4a8be0; --sel-2: #1f56b0;
}
}
:root[data-skin="retro"][data-theme="dark"] {
--canvas: #1b1c1f; --surface: #25262a; --ink: #ececee; --muted: #a3a6ae; --line: #45474e;
--brand: #64a6ff; --brand-soft: #64a6ff26; --chart: #64a6ff; --chart-soft: #64a6ff26; --chart-mute: #2f4d78;
--good: #5fcf6a; --bad: #ff7b72; --hover: #ffffff0f; --hover-strong: #ffffff1c;
--shadow-card: inset 0 1px 0 #ffffff0d, 0 1px 3px #00000066; --shadow-pop: inset 0 1px 0 #ffffff12, 0 18px 44px -14px #000000b3;
--retro-stripe: #ffffff06; --track-1: #141517; --track-2: #2a2b30; --metal-hi: #3c3d42; --metal-lo: #26272b; --gel-top: #55565d; --gel-mid: #3e3f45; --gel-low: #323338; --gel-edge: #141518;
--aqua-1: #7fb9ff; --aqua-2: #3d86e8; --aqua-3: #1f62c7; --aqua-4: #5b9df5; --aqua-edge: #0f3a7a; --sel-1: #4a8be0; --sel-2: #1f56b0;
}
[data-skin="retro"] body { font-family: "Lucida Grande", "Lucida Sans Unicode", var(--font-figtree), system-ui, sans-serif;
background: repeating-linear-gradient(90deg, #ffffff0d 0 1px, #00000008 1px 3px), linear-gradient(var(--metal-hi), var(--metal-lo)) fixed; }
[data-skin="retro"] main.bg-canvas { background-color: var(--canvas); background-image: repeating-linear-gradient(0deg, var(--retro-stripe) 0 2px, transparent 2px 4px); }
[data-skin="retro"] .card, [data-skin="retro"] .card-link { border-radius: 8px; }
[data-skin="retro"] nav a[aria-current="page"] { background: linear-gradient(var(--sel-1), var(--sel-2)); color: #fff; text-shadow: 0 -1px 0 #00000040; box-shadow: inset 0 1px 0 #ffffff40; }
[data-skin="retro"] .btn, [data-skin="retro"] .pill-tab-active, [data-skin="retro"] .seg button {
border: 1px solid var(--gel-edge); background: linear-gradient(var(--gel-top), var(--gel-mid) 50%, var(--gel-low) 51%, var(--gel-mid)); color: var(--ink); box-shadow: 0 1px 1px #00000022, inset 0 1px 0 #ffffff80; }
[data-skin="retro"] .seg { gap: 0; }
[data-skin="retro"] .seg button { border-radius: 0; margin-left: -1px; padding: 1px 10px; }
[data-skin="retro"] .seg button:first-child { border-radius: 12px 0 0 12px; }
[data-skin="retro"] .seg button:last-child { border-radius: 0 12px 12px 0; }
[data-skin="retro"] .btn-primary, [data-skin="retro"] .seg button[aria-pressed="true"], [data-skin="retro"] .pill-tab-active {
border: 1px solid var(--aqua-edge); color: #fff; text-shadow: 0 -1px 0 #00000040;
background: linear-gradient(var(--aqua-1), var(--aqua-2) 50%, var(--aqua-3) 51%, var(--aqua-4)); box-shadow: 0 1px 2px #00000033, inset 0 1px 0 #ffffff99; }
[data-skin="retro"] .soon, [data-skin="retro"] .chip { background: linear-gradient(var(--aqua-1), var(--aqua-3)); color: #fff; border: 1px solid var(--aqua-edge); text-shadow: 0 -1px 0 #00000033; }
[data-skin="retro"] .chip.text-good { background: linear-gradient(#a6e39a, #3fa33f); border-color: #2b6e2b; }
[data-skin="retro"] .bar { height: 9px; background: linear-gradient(var(--track-1), var(--track-2)); box-shadow: inset 0 1px 2px #00000040; }
[data-skin="retro"] .bar i { background-image: linear-gradient(#ffffff73, #ffffff1a 50%, #00000014 51%) !important; }
[data-skin="retro"] .bar i.bg-good, [data-skin="retro"] .bar i.bg-chart { background-image: repeating-linear-gradient(-45deg, #ffffff40 0 7px, transparent 7px 14px), linear-gradient(#ffffff73, #ffffff1a 50%, #00000014 51%) !important; background-size: 20px 20px, auto; animation: retro-pole 1s linear infinite; }
@keyframes retro-pole { to { background-position: 20px 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { [data-skin="retro"] .bar i { animation: none; } }
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export default function RootLayout({ children }: Readonly<{ children: React.Reac
return (
<html lang="en" suppressHydrationWarning>
<head>
{/* Apply the saved theme before paint; no attribute means follow the system. */}
<script dangerouslySetInnerHTML={{ __html: `try{var t=localStorage.getItem("theme");if(t==="light"||t==="dark")document.documentElement.dataset.theme=t}catch(e){}` }} />
{/* Apply the saved mode, theme and Hide balances before paint; no data-theme means follow the system. */}
<script dangerouslySetInnerHTML={{ __html: `try{var d=document.documentElement,t=localStorage.getItem("theme");if(t==="light"||t==="dark")d.dataset.theme=t;if(localStorage.getItem("skin")==="retro")d.dataset.skin="retro";if(localStorage.getItem("hideMoney"))d.classList.add("hide-money")}catch(e){}` }} />
</head>
<body className={`${figtree.variable} antialiased`}>{children}</body>
</html>
Expand Down
61 changes: 61 additions & 0 deletions src/components/Amount.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"use client";

import { useEffect, useRef, useState } from "react";
import { useMoney } from "@/components/Money";

// A money string with its cents set smaller and lighter ("$2,340.00" -> "$2,340" + ".00"). class "money" lets Hide
// balances blur it. Works on any locale's string: "1.234,56 €" splits at ",56". No cents (JPY) shows as is.
export function Amount({ text, className = "" }: { text: string; className?: string }) {
const m = text.match(/^(.*?\d)([.,]\d{2})(\D*)$/);
return <span className={`money ${className}`}>{m ? <>{m[1]}<span className="cents">{m[2]}</span>{m[3]}</> : text}</span>;
}

// A headline figure that rolls up to its value once, on first paint. Reduced motion shows the value at once.
export function CountUp({ value, className = "" }: { value: number; className?: string }) {
const { money } = useMoney();
const [n, setN] = useState(value);
const done = useRef(false);
useEffect(() => {
if (done.current || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
done.current = true;
const t0 = performance.now();
let raf = 0;
const step = (t: number) => {
const p = Math.min(1, (t - t0) / 450);
setN(value * (1 - Math.pow(1 - p, 3)));
if (p < 1) raf = requestAnimationFrame(step);
};
raf = requestAnimationFrame(step);
return () => cancelAnimationFrame(raf);
}, [value]);
return <Amount text={money(n)} className={className} />;
}

// Hide balances: blurs every .money on the page. Saved in this browser; the root layout applies it before paint. H toggles it.
export function HideMoney() {
const [on, setOn] = useState(false);
useEffect(() => {
setOn(document.documentElement.classList.contains("hide-money"));
const key = (e: KeyboardEvent) => {
const t = e.target as HTMLElement;
if (e.key.toLowerCase() !== "h" || e.metaKey || e.ctrlKey || e.altKey || /input|textarea|select/i.test(t.tagName) || t.isContentEditable) return;
flip();
};
window.addEventListener("keydown", key);
return () => window.removeEventListener("keydown", key);
}, []);
function flip() {
const next = !document.documentElement.classList.contains("hide-money");
document.documentElement.classList.toggle("hide-money", next);
setOn(next);
try { if (next) localStorage.setItem("hideMoney", "1"); else localStorage.removeItem("hideMoney"); } catch {}
}
return (
<button onClick={flip} aria-pressed={on} title={on ? "Show balances (H)" : "Hide balances (H)"} aria-label={on ? "Show balances" : "Hide balances"}
className={`size-8 grid place-items-center rounded-lg ${on ? "bg-brand-soft text-brand" : "text-muted hover:text-ink hover:bg-[var(--hover)]"}`}>
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" aria-hidden>
<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z" /><circle cx="12" cy="12" r="3" />{on && <path d="M3 3l18 18" />}
</svg>
</button>
);
}
Loading
Loading