feat: implement evolution and gradient systems with settings modal

- Add EvolutionController to manage spawning and physics of icons.
- Introduce GradientController for animated gradient backgrounds.
- Create iconLoader for fetching and caching SVG icons.
- Implement modal functionality for settings adjustments.
- Connect UI controls to controllers via SettingsController.
- Add CSS styles for gradient animations, icons, and modal.
- Create utility functions for color manipulation in gradients.
This commit is contained in:
sha
2026-02-21 13:53:46 +02:00
commit 899d9d7c13
59 changed files with 1765 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
/**
* constants.js
* Single source of truth for all application defaults and tuneable values.
* Import from here — never hardcode magic numbers elsewhere.
*/
export const DEFAULTS = {
// ── Gradient background ────────────────────────────────────
/** Base colour the gradient is derived from */
GRADIENT_COLOR: '#4d22b3',
/** Flow animation speed, slider 110 */
GRADIENT_SPEED: 2,
/** Clockwise rotation off by default */
GRADIENT_ROTATION: true,
// ── Icon evolution ─────────────────────────────────────────
/** Min ms before the first / next icon spawns */
SPAWN_DELAY_MIN: 3_000,
/** Max ms before the first / next icon spawns */
SPAWN_DELAY_MAX: 20_000,
/** Final rendered icon size in px */
ICON_SIZE: 24,
/** Half of ICON_SIZE — used for edge/collision math */
ICON_HALF: 12,
/** Movement speed slider default (110) */
MOVE_SPEED: 5,
/** Base px-per-frame at MOVE_SPEED */
BASE_SPEED: 0.8,
/** Hard cap: max speed = BASE_SPEED × this factor */
MAX_SPEED_FACTOR: 2.5,
/** ms for dot → full-icon grow animation */
APPEAR_DURATION: 600,
/** Probability per frame of a random velocity "kick" (chaotic drift) */
DRIFT_CHANCE: 0.02,
/** Max |Δv| applied on each drift kick */
DRIFT_MAGNITUDE: 0.25,
};