feat(wip): button to switch assets

This commit is contained in:
2024-05-19 17:49:33 +02:00
parent 40d0c65eb1
commit 5cd57a7266
140 changed files with 366 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
import { defineStore } from "pinia";
const CARDS_COOKIE_NAME = 'cards_type';
const CARDS_DEFAULT_VALUE = 'heron';
export function getCardsType(): ReturnType<typeof useCookie>{
const cookie = useCookie(CARDS_COOKIE_NAME)
if (!cookie.value) {
cookie.value = CARDS_DEFAULT_VALUE;
}
return cookie;
}
export const useSettingsStore = defineStore("settingstore", {
state: () => ({
cardStyle: "heron" as string,
}),
actions: {
changeCardStyle(style: string) {
this.cardStyle = style;
getCardsType().value = style;
}
},
});