Files
front/stores/settingsStore.ts
T
legonzaur f68304cf22
release-tag / release-image (push) Successful in 32s
Fix : switch to localStorage for persistent session data
2024-07-31 19:50:05 +02:00

34 lines
776 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,
enableDragging: 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,
},
});