feat: initial prototype
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 47s

This commit is contained in:
2026-01-14 20:56:28 -08:00
parent daf1bfecb8
commit f393dfb359
68 changed files with 9391 additions and 12 deletions
+40
View File
@@ -0,0 +1,40 @@
import { writable, derived } from "svelte/store";
import { CHARACTER_STATES, type CharacterState } from "$lib/types/states";
function createCharacterStore() {
const { subscribe, set, update } = writable<CharacterState>("idle");
let stateTimeout: ReturnType<typeof setTimeout> | null = null;
return {
subscribe,
setState: (state: CharacterState) => {
if (stateTimeout) {
clearTimeout(stateTimeout);
stateTimeout = null;
}
set(state);
},
setTemporaryState: (state: CharacterState, durationMs: number = 2000) => {
if (stateTimeout) {
clearTimeout(stateTimeout);
}
set(state);
stateTimeout = setTimeout(() => {
set("idle");
stateTimeout = null;
}, durationMs);
},
reset: () => {
if (stateTimeout) {
clearTimeout(stateTimeout);
stateTimeout = null;
}
set("idle");
},
};
}
export const characterState = createCharacterStore();
export const characterInfo = derived(characterState, ($state) => CHARACTER_STATES[$state]);