nuts / files / src / config.ts
config.ts
| 1 | export const CONFIG = { |
| 2 | // Nuts |
| 3 | nutBaseRadius: 130, // px – semi-major axis (runtime overridden by size slider) |
| 4 | nutMinRadius: 4, // px – slider minimum |
| 5 | nutMaxRadius: 180, // px – slider maximum |
| 6 | nutAspectRatio: 1.75, // width:height – peanut-like elongation |
| 7 | nutRadiusVariance: 0.12, // ±12% size variance |
| 8 | |
| 9 | // Physics |
| 10 | restitution: 0.7, // bounciness |
| 11 | friction: 0.02, // surface friction |
| 12 | frictionAir: 0.002, // air resistance / damping |
| 13 | gravityScale: 1, |
| 14 | |
| 15 | // Walls |
| 16 | wallThickness: 60, |
| 17 | |
| 18 | // Collision haptics |
| 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 |
| 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 |
| 29 | |
| 30 | // Debug |
| 31 | logToVite: false, // POST logs to Vite dev server (/__log) — useful for phone debugging |
| 32 | } as const |