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

@ -102,7 +102,8 @@ export function createBubbleWorld(initialCount = 0, random = Math.random) {
}
function step(delta = 1000 / 60) {
spawnTime += delta;
if (balls.length < target && spawnTime >= 45) {
// Two 60 Hz frames per bubble, previously three: 50% more arrivals/second.
if (balls.length < target && spawnTime >= 1000 / 30) {
spawnTime = 0;
// Each new bubble enters at the upper inside edge, then falls naturally.
const x = 160 + (random() - 0.5) * 55;

View file

@ -31,6 +31,10 @@ const food = z.object({
const entry = food
.extend({
date,
time: z
.string()
.regex(/^([01]\d|2[0-3]):[0-5]\d$/)
.optional(),
meal: z.enum(["Breakfast", "Lunch", "Dinner", "Snacks"]),
quantity: z.number().finite().positive().max(1000),
})

22
shared/entry.js Normal file
View file

@ -0,0 +1,22 @@
/** @returns {'Breakfast' | 'Lunch' | 'Dinner' | 'Snacks'} */
export function suggestedMeal(date = new Date()) {
const hour = date.getHours();
if (hour >= 5 && hour < 11) return "Breakfast";
if (hour >= 11 && hour < 16) return "Lunch";
if (hour >= 16 && hour < 22) return "Dinner";
return "Snacks";
}
export function localTime(date = new Date()) {
return `${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
}
export function nextFoodName(prefix, names) {
let highest = 0;
for (const name of names) {
if (!name.startsWith(prefix + " ")) continue;
const suffix = name.slice(prefix.length + 1);
if (/^\d+$/.test(suffix)) highest = Math.max(highest, Number(suffix));
}
return `${prefix} ${highest + 1}`;
}