Native-feel polish: autosaving settings, stacked sheets, desktop type scale
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 28s
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 28s
- Settings apply as they change; theme/accent preview instantly and a background sync no longer discards in-progress edits - Food journal stays open beneath edit/add/delete sheets - Toasts render in the top layer above open sheets, with an error tone - Follow the new day when the PWA resumes after midnight - Add-food sheet: day/time row, one-tap meal picker, blank nutrient fields - Library cards gain a Log action; compact rows on phones - Desktop type scale raised from 7-12px to 10-15px (desktop.css) - Hover styles limited to hover-capable devices; touch press dimming and no text selection on app chrome - Sheets slide opaque on the UIKit curve; drag-to-dismiss tracks 1:1, supports flicks and departs from the dragged position - Removed calorie bubbles fade out; no progress dot at 0 kcal - Friendly network/proxy error messages; fresh outbox check before update Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3c0d6560f1
commit
c3b9376508
16 changed files with 1043 additions and 290 deletions
|
|
@ -44,6 +44,8 @@ export function createBubbleWorld(initialCount = 0, random = Math.random) {
|
|||
});
|
||||
engine.gravity.scale = 0.00035;
|
||||
const balls = [];
|
||||
// Removed bubbles leave the simulation at once but fade out where they were.
|
||||
const fading = [];
|
||||
let target = initialCount;
|
||||
let spawnTime = 0;
|
||||
const walls = Array.from({ length: 72 }, (_, i) => {
|
||||
|
|
@ -82,6 +84,7 @@ export function createBubbleWorld(initialCount = 0, random = Math.random) {
|
|||
function seed(count) {
|
||||
for (const ball of balls) Composite.remove(engine.world, ball);
|
||||
balls.length = 0;
|
||||
fading.length = 0;
|
||||
target = Math.min(MAX_BUBBLES, Math.max(0, count));
|
||||
for (let i = 0; i < target; i++)
|
||||
add(packedPositions[i].x, packedPositions[i].y);
|
||||
|
|
@ -89,7 +92,16 @@ export function createBubbleWorld(initialCount = 0, random = Math.random) {
|
|||
seed(initialCount);
|
||||
function setTarget(count) {
|
||||
target = Math.min(MAX_BUBBLES, Math.max(0, count));
|
||||
while (balls.length > target) Composite.remove(engine.world, balls.pop());
|
||||
while (balls.length > target) {
|
||||
const ball = balls.pop();
|
||||
Composite.remove(engine.world, ball);
|
||||
fading.push({
|
||||
id: ball.id,
|
||||
x: ball.position.x,
|
||||
y: ball.position.y,
|
||||
life: 1,
|
||||
});
|
||||
}
|
||||
wake();
|
||||
}
|
||||
function gravity(x, y) {
|
||||
|
|
@ -102,6 +114,9 @@ export function createBubbleWorld(initialCount = 0, random = Math.random) {
|
|||
}
|
||||
function step(delta = 1000 / 60) {
|
||||
spawnTime += delta;
|
||||
for (const bubble of fading) bubble.life -= delta / 220;
|
||||
for (let i = fading.length - 1; i >= 0; i--)
|
||||
if (fading[i].life <= 0) fading.splice(i, 1);
|
||||
// Two 60 Hz frames per bubble, previously three: 50% more arrivals/second.
|
||||
if (balls.length < target && spawnTime >= 1000 / 30) {
|
||||
spawnTime = 0;
|
||||
|
|
@ -143,13 +158,16 @@ export function createBubbleWorld(initialCount = 0, random = Math.random) {
|
|||
return {
|
||||
engine,
|
||||
balls,
|
||||
fading,
|
||||
step,
|
||||
seed,
|
||||
setTarget,
|
||||
gravity,
|
||||
nudge,
|
||||
awake: () =>
|
||||
balls.length < target || balls.some((ball) => !ball.isSleeping),
|
||||
fading.length > 0 ||
|
||||
balls.length < target ||
|
||||
balls.some((ball) => !ball.isSleeping),
|
||||
dispose: () => {
|
||||
Composite.clear(engine.world, false);
|
||||
Engine.clear(engine);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue