nuts / files / src / config.ts
config.ts
44eb5832 2026-04-12 Pavel Safronov | 1 | export const CONFIG = { |
| 2 | // Nuts | |
f1262fd9 2026-04-12 Pavel Safronov | 3 | nutBaseRadius: 130, // px – semi-major axis (runtime overridden by size slider) |
937f9abc 2026-04-12 Pavel Safronov | 4 | nutMinRadius: 4, // px – slider minimum |
f1262fd9 2026-04-12 Pavel Safronov | 5 | nutMaxRadius: 180, // px – slider maximum |
| 6 | nutAspectRatio: 1.75, // width:height – peanut-like elongation | |
| 7 | nutRadiusVariance: 0.12, // ±12% size variance | |
44eb5832 2026-04-12 Pavel Safronov | 8 | |
| 9 | // Physics | |
f1262fd9 2026-04-12 Pavel Safronov | 10 | restitution: 0.7, // bounciness |
| 11 | friction: 0.02, // surface friction | |
| 12 | frictionAir: 0.002, // air resistance / damping | |
44eb5832 2026-04-12 Pavel Safronov | 13 | gravityScale: 1, |
| 14 | ||
| 15 | // Walls | |
| 16 | wallThickness: 60, | |
| 17 | ||
| 18 | // Collision haptics | |
f1262fd9 2026-04-12 Pavel Safronov | 19 | impactThreshold: 0.5, // min speed (px/step) to trigger vibration |
| 20 | maxVibrationMs: 120, // cap on vibration duration | |
| 21 | vibrationCooldownMs: 150, // min ms between vibration calls | |
44eb5832 2026-04-12 Pavel Safronov | 22 | |
| 23 | // Shake | |
| 24 | shakeAccelThreshold: 14, // m/s² delta to count as shake | |
| 25 | shakeForceScale: 0.007, // impulse magnitude per unit of shake intensity | |
| 26 | ||
| 27 | // Orientation gravity | |
| 28 | orientationMaxTilt: 80, // degrees before clamping | |
aa6e5a99 2026-04-13 Pavel Safronov | 29 | |
| 30 | // Debug | |
1f6f4741 2026-04-13 Pavel Safronov | 31 | logToVite: false, // POST logs to Vite dev server (/__log) — useful for phone debugging |
44eb5832 2026-04-12 Pavel Safronov | 32 | } as const |