mirror of
https://github.com/shadoll/dev.shadoll.git
synced 2026-08-28 11:33:15 +00:00
feat: add logo word with letter icons and physics
- Introduced a new logo system consisting of individual letter SVG icons for "shadolldev". - Implemented LogoController to manage the floating logo word, including physics for movement and collisions with entities. - Added LogoLetter class to handle individual letter behavior, including ejection and reattachment based on collisions. - Integrated logo functionality into the main application flow, ensuring it initializes alongside the evolution system. - Enhanced settings to control debug visibility for letter hit counts. - Created styles for the logo letters, including animations for ejection and hit effects. - Updated constants to define logo-related parameters such as letter size, speed, and collision properties.
This commit is contained in:
+14
-3
@@ -15,6 +15,7 @@ import { ModalController } from './modal.js';
|
||||
import { SettingsController } from './settings.js';
|
||||
import { EvolutionController } from './evolution.js';
|
||||
import { GuideController } from './guide.js';
|
||||
import { LogoController } from './logoController.js';
|
||||
import { DEFAULTS } from './constants.js';
|
||||
|
||||
// ── Initialise controllers ─────────────────────────────────
|
||||
@@ -24,7 +25,6 @@ const evolution = new EvolutionController();
|
||||
const guide = new GuideController();
|
||||
|
||||
// SettingsController bridges UI → gradient + evolution
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const settings = new SettingsController(gradient, evolution);
|
||||
|
||||
// ── Wire up settings button ────────────────────────────────
|
||||
@@ -41,5 +41,16 @@ gradient.init(DEFAULTS.GRADIENT_COLOR);
|
||||
// Apply saved settings after gradient has set its defaults
|
||||
settings.loadSaved();
|
||||
|
||||
// ── Boot evolution (async — loads icons.json + warms SVG cache) ──
|
||||
evolution.init(document.getElementById('evolutionContainer'));
|
||||
// ── Boot logo + evolution ──────────────────────────────────
|
||||
// Sequence: evolution.init() → reads localStorage (populates savedLogoState)
|
||||
// logo.init(savedLogoState) → mounts letters, restores state
|
||||
// setLogoController(logo) → arms per-tick calls
|
||||
const logo = new LogoController();
|
||||
const container = document.getElementById('evolutionContainer');
|
||||
|
||||
evolution.init(container)
|
||||
.then(() => logo.init(container, evolution.savedLogoState))
|
||||
.then(() => {
|
||||
evolution.setLogoController(logo);
|
||||
settings.setLogoController(logo);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user