Extensive UI changes
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 28s

This commit is contained in:
Elijah 2026-10-20 19:46:08 -07:00
parent 6fc0a01c56
commit ddea7fc512
16 changed files with 675 additions and 493 deletions

View file

@ -17,6 +17,7 @@ import { metrics } from "./types";
import { downloadExport, offsetDay, today } from "./utils";
import { logout, saveRecord, sync, useSyncStatus } from "./store";
import { accentPresets, DEFAULT_ACCENT } from "../shared/theme.js";
import { useTilt } from "./useTilt";
export function Settings({
settings,
@ -36,6 +37,7 @@ export function Settings({
update: (() => void) | null;
}) {
const [draft, setDraft] = useState(settings);
const tilt = useTilt();
const [busy, setBusy] = useState(false);
const [format, setFormat] = useState(settings.exportFormat);
const [range, setRange] = useState(settings.exportDays);
@ -174,6 +176,26 @@ export function Settings({
))}
<div className="settings-section">
<h3>Look & feel</h3>
<div className="preference-row">
<label className="toggle-label">
<input
className="switch"
type="checkbox"
checked={tilt.enabled}
onChange={() => void tilt.toggleTilt()}
/>
Tilt calorie bubbles
</label>
</div>
<p className="small muted" role="status">
{tilt.status === "denied"
? "Motion permission was not granted. Check your browser’s website permissions."
: tilt.status === "unavailable"
? "Orientation sensors are unavailable on this device. Bubbles still fall normally."
: tilt.status === "permission"
? "Enable tilt again to grant motion access for this session."
: "Uses this device’s orientation. iPhone may request permission again after reopening. Reduced motion pauses the animation."}
</p>
<div className="segmented theme-control">
{(
[