- init all 6 effects modules in app.js (matrix-rain, lightning, energy-beam, rune-ring, gravity-zones, shockwave) - subscribe each to globalTicker; tick() called in the RAF loop - add subscribe() named export to core/ticker.js for panels compatibility - bridge data to core/state.js: zoneIntensity from heatmap.js, activeAgentCount + commitHashes from data/gitea.js, portals from portals.js - update portals.js and weather.js to use new effects/rune-ring and effects/gravity-zones instead of legacy effects.js Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
303 B
JavaScript
12 lines
303 B
JavaScript
export class Ticker {
|
|
constructor() {
|
|
this.callbacks = [];
|
|
}
|
|
subscribe(fn) { this.callbacks.push(fn); }
|
|
tick(delta, elapsed) {
|
|
this.callbacks.forEach(fn => fn(delta, elapsed));
|
|
}
|
|
}
|
|
export const globalTicker = new Ticker();
|
|
export function subscribe(fn) { globalTicker.subscribe(fn); }
|