mirror of
https://github.com/shadoll/dev.shadoll.git
synced 2026-08-28 03:26:56 +00:00
feat: implement GuideController for evolution guide panel
- Added GuideController to manage the evolution guide panel, including event listeners for opening/closing the panel and spawning entities. - Introduced a new guide.js file with the GuideController implementation. - Created guide.css for styling the guide panel and its elements. - Updated main.js to initialize the GuideController and link it with the EvolutionController. - Enhanced settings.js to include functionality for resetting settings to defaults and saving state to localStorage. - Modified modal.css to improve the layout and styling of the modal footer and reset button. - Adjusted main.css to unify button styles for settings and guide buttons. - Updated icons.css to add animations for entity interactions. - Refactored gradient.js to utilize constants for default values.
This commit is contained in:
@@ -14,12 +14,14 @@ import { GradientController } from './gradient.js';
|
||||
import { ModalController } from './modal.js';
|
||||
import { SettingsController } from './settings.js';
|
||||
import { EvolutionController } from './evolution.js';
|
||||
import { GuideController } from './guide.js';
|
||||
import { DEFAULTS } from './constants.js';
|
||||
|
||||
// ── Initialise controllers ─────────────────────────────────
|
||||
const gradient = new GradientController();
|
||||
const modal = new ModalController();
|
||||
const evolution = new EvolutionController();
|
||||
const guide = new GuideController();
|
||||
|
||||
// SettingsController bridges UI → gradient + evolution
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
@@ -30,8 +32,14 @@ document.getElementById('settingsBtn').addEventListener('click', (e) => {
|
||||
modal.open(/** @type {HTMLElement} */ (e.currentTarget));
|
||||
});
|
||||
|
||||
// ── Wire up evolution guide ────────────────────────────────
|
||||
guide.init(evolution);
|
||||
|
||||
// ── Boot gradient ──────────────────────────────────────────
|
||||
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'));
|
||||
|
||||
Reference in New Issue
Block a user