Initial commit

This commit is contained in:
2026-05-25 13:00:20 -04:00
commit e14e43da42
49 changed files with 26892 additions and 0 deletions

30
js/state.js Normal file
View File

@@ -0,0 +1,30 @@
window.GDD = window.GDD || {};
/* Simple pub/sub state store — Zustand-like for prototype */
window.GDD.createStore = function createStore(initialState) {
let state = { ...initialState };
const listeners = new Set();
return {
getState: () => ({ ...state }),
setState: (partial) => {
const next = typeof partial === 'function' ? partial(state) : partial;
state = { ...state, ...next };
listeners.forEach(fn => fn(state));
},
subscribe: (fn) => {
listeners.add(fn);
return () => listeners.delete(fn);
}
};
};
/* App-level store */
window.GDD.appStore = window.GDD.createStore({
currentPage: 'overview',
sidebarCollapsed: false,
sidebarOpen: false, // mobile
connected: true,
playerName: 'Captain Riker',
playerCredits: 125000,
});