feat/switch-assets #86

Merged
legonzaur merged 22 commits from feat/switch-assets into main 2024-05-21 19:09:34 +00:00
2 changed files with 3 additions and 25 deletions
Showing only changes of commit 2aac51a018 - Show all commits
-10
View File
@@ -1,10 +0,0 @@
const CARDS_COOKIE_NAME = 'cards_type';
const CARDS_DEFAULT_VALUE = 'heron';
export function getCardsType(): CookieRef<string | null | undefined> {
const cookie = useCookie(CARDS_COOKIE_NAME)
if (!cookie.value) {
cookie.value = CARDS_DEFAULT_VALUE;
}
return cookie;
}
+3 -15
View File
@@ -3,24 +3,12 @@ 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,
cardStyle: "heron",
shaderQuality: 6,
shaderFramerate: 60,
}),
actions: {
changeCardStyle(style: string) {
this.cardStyle = style;
getCardsType().value = style;
}
},
persist: true
});