Files
front/stores/settingsStore.ts
T
legonzaur 2876f7b91e
release-tag / release-image (push) Successful in 28s
Feat: better discard overlay
2024-08-01 22:53:30 +02:00

35 lines
807 B
TypeScript

import { defineStore } from "pinia";
export enum CardStyles {
HERON = "heron",
ORIGINAL = "original",
SVG = "heron-svg",
}
export const useSettingsStore = defineStore("settingstore", {
state: () => ({
cardStyle: CardStyles.SVG,
animationSpeed: 100,
fastAnimations: false,
shaderQuality: 3,
shaderFramerate: 10,
shaderPixelated: true,
saveDiscardSize: false,
discardFullscreen: false,
}),
actions: {
switchCardStyles() {
if (this.cardStyle === CardStyles.HERON) {
this.cardStyle = CardStyles.ORIGINAL;
} else if (this.cardStyle === CardStyles.ORIGINAL) {
this.cardStyle = CardStyles.SVG;
} else {
this.cardStyle = CardStyles.HERON;
}
},
},
persist: {
storage: persistedState.localStorage,
},
});