diff --git a/src/components/CapaciteFile.vue b/src/components/CapaciteFile.vue new file mode 100644 index 0000000..34bf483 --- /dev/null +++ b/src/components/CapaciteFile.vue @@ -0,0 +1,53 @@ + + + diff --git a/src/components/capacites/CapaciteCard.vue b/src/components/capacites/CapaciteCard.vue new file mode 100644 index 0000000..406741c --- /dev/null +++ b/src/components/capacites/CapaciteCard.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/components/capacites/CapaciteCategory.vue b/src/components/capacites/CapaciteCategory.vue new file mode 100644 index 0000000..3282b34 --- /dev/null +++ b/src/components/capacites/CapaciteCategory.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/router/index.ts b/src/router/index.ts index 086e1f0..480cc6c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -6,6 +6,7 @@ import FichesView from "../views/FichesView.vue"; import ObjetsView from "../views/ObjetsView.vue"; import EquipView from "../views/EquipView.vue"; import ElementsView from "../views/ElementsView.vue"; +import CapaciteView from "../views/CapaciteView.vue"; const router = createRouter({ history: createWebHashHistory(import.meta.env.BASE_URL), @@ -47,6 +48,10 @@ const router = createRouter({ path: "/jdr/:jdr/elements/", component: ElementsView, }, + { + path: "/jdr/:jdr/pouvoirs/:filepath", + component: CapaciteView, + }, ], scrollBehavior(to, from, savedPosition) { if (to.hash) { diff --git a/src/stores/config.ts b/src/stores/config.ts index e3755e1..67ffc3f 100644 --- a/src/stores/config.ts +++ b/src/stores/config.ts @@ -62,7 +62,9 @@ export const useConfigStore = defineStore("config", () => { function getSidebar(): LinkList[] { if (isJdrLoaded()) { - return sidebar.value; + return ( + sidebar.value.sort((a, b) => a.id - b.id) ?? [{ id: 0, links: [] }] + ); } else { return ( config.value?.jdr?.sort((a, b) => a.id - b.id) ?? [{ id: 0, links: [] }] diff --git a/src/types/Capacite.ts b/src/types/Capacite.ts new file mode 100644 index 0000000..1a7e070 --- /dev/null +++ b/src/types/Capacite.ts @@ -0,0 +1,13 @@ +export default interface Capacite { + nom: string; + description: string; + stats?: string[]; + couts?: string[]; + type?: "posture" | "passif"; + levelups?: LevelUp[][]; +} + +interface LevelUp { + niveau: number; + effet: string; +} diff --git a/src/types/CapaciteList.ts b/src/types/CapaciteList.ts new file mode 100644 index 0000000..d8dfaaa --- /dev/null +++ b/src/types/CapaciteList.ts @@ -0,0 +1,4 @@ +export default interface CapaciteList { + title: string; + capacites: string[]; +} diff --git a/src/views/CapaciteView.vue b/src/views/CapaciteView.vue new file mode 100644 index 0000000..1782acb --- /dev/null +++ b/src/views/CapaciteView.vue @@ -0,0 +1,26 @@ + + +