diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-13 00:17:32 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-13 00:17:32 +0000 |
| commit | 543aa0cd4a461285298d33a90ab3f11a9f084ca5 (patch) | |
| tree | ffbaec5f495b2cf8b891690642df161464ac6e95 /components | |
| parent | a072c91cc0dc26e417c51f666e8547e08ef40942 (diff) | |
Add home page
Diffstat (limited to 'components')
| -rw-r--r-- | components/editor/EditorSidebarCategory.vue | 4 | ||||
| -rw-r--r-- | components/editor/EditorSidebarItem.vue | 4 | ||||
| -rw-r--r-- | components/editor/EditorSidebarMainConfiguration.vue | 4 | ||||
| -rw-r--r-- | components/editor/EditorSidebarQuest.vue | 2 | ||||
| -rw-r--r-- | components/header/SiteHeader.vue | 18 | ||||
| -rw-r--r-- | components/loader/LoaderFileSystemModal.vue | 3 | ||||
| -rw-r--r-- | components/loader/LoaderTestDataModal.vue | 3 |
7 files changed, 29 insertions, 9 deletions
diff --git a/components/editor/EditorSidebarCategory.vue b/components/editor/EditorSidebarCategory.vue index cfabf39..27a5ce0 100644 --- a/components/editor/EditorSidebarCategory.vue +++ b/components/editor/EditorSidebarCategory.vue @@ -22,11 +22,11 @@ const expandCategory = () => { }; const setSelectedCategory = () => { - navigateTo({ path: `/category/${category.value.id}` }) + navigateToEditorPane('category', category.value.id); }; const selected = computed(() => { - return route.path.startsWith('/category') && route.params.id === category.value.id; + return route.path.startsWith('/editor/category') && route.params.id === category.value.id; }); </script> diff --git a/components/editor/EditorSidebarItem.vue b/components/editor/EditorSidebarItem.vue index 4696bb1..55f81d0 100644 --- a/components/editor/EditorSidebarItem.vue +++ b/components/editor/EditorSidebarItem.vue @@ -10,11 +10,11 @@ const { item } = toRefs(props); const route = useRoute(); const setSelectedItem = () => { - navigateTo({ path: `/item/${item.value.id}` }) + navigateToEditorPane('item', item.value.id); }; const selected = computed(() => { - return route.path.startsWith('/item') && route.params.id === item.value.id; + return route.path.startsWith('/editor/item') && route.params.id === item.value.id; }); </script> diff --git a/components/editor/EditorSidebarMainConfiguration.vue b/components/editor/EditorSidebarMainConfiguration.vue index c4727c6..bf7196b 100644 --- a/components/editor/EditorSidebarMainConfiguration.vue +++ b/components/editor/EditorSidebarMainConfiguration.vue @@ -4,11 +4,11 @@ import { computed } from 'vue'; const route = useRoute(); const setSelected = () => { - navigateTo({ path: '/config' }) + navigateToEditorPane('config'); }; const selected = computed(() => { - return route.path.startsWith('/config'); + return route.path.startsWith('/editor/config'); }); </script> diff --git a/components/editor/EditorSidebarQuest.vue b/components/editor/EditorSidebarQuest.vue index 85edb38..c40b22c 100644 --- a/components/editor/EditorSidebarQuest.vue +++ b/components/editor/EditorSidebarQuest.vue @@ -11,7 +11,7 @@ const { quest } = toRefs(props); const route = useRoute(); const setSelectedQuest = () => { - navigateTo({ path: `/quest/${quest.value.id}` }) + navigateToEditorPane('quest', quest.value.id); }; const selected = computed(() => { diff --git a/components/header/SiteHeader.vue b/components/header/SiteHeader.vue index 75686d8..015af3d 100644 --- a/components/header/SiteHeader.vue +++ b/components/header/SiteHeader.vue @@ -1,11 +1,16 @@ <script setup land="ts"> +const navigateHome = () => { + navigateTo('/'); +} </script> <template> <header> <div id="nav"> - <img src="@/assets/quests-logo.png" alt="Quests logo" /> - <h1>Quests Web Editor</h1> + <span id="logo" @click="navigateHome"> + <img src="@/assets/quests-logo.png" alt="Quests logo" /> + <h1>Quests Web Editor</h1> + </span> <code>Preview</code> </div> @@ -44,6 +49,15 @@ } +#logo { + cursor: pointer; + display: flex; + align-items: center; + justify-content: flex-start; + gap: 1rem; + color: var(--color-header-text); +} + #controls { padding: 1rem; display: flex; diff --git a/components/loader/LoaderFileSystemModal.vue b/components/loader/LoaderFileSystemModal.vue index 27f4e12..25fcfa2 100644 --- a/components/loader/LoaderFileSystemModal.vue +++ b/components/loader/LoaderFileSystemModal.vue @@ -16,6 +16,9 @@ const confirm = () => { session.setCategories(categories); session.setQuests(quests); session.setItems(items); + session.setSessionType('filesystem'); + + navigateToEditorPane(null); showModal.value = false; } diff --git a/components/loader/LoaderTestDataModal.vue b/components/loader/LoaderTestDataModal.vue index 36d2d6d..8b0df21 100644 --- a/components/loader/LoaderTestDataModal.vue +++ b/components/loader/LoaderTestDataModal.vue @@ -18,6 +18,9 @@ const confirm = () => { session.setQuests(quests); session.setCategories(categories); session.setItems(items); + session.setSessionType('demo'); + + navigateToEditorPane(null); showModal.value = false; } |
