feat: compose the portfolio journey layer

This commit is contained in:
2026-09-02 16:21:13 +03:00
parent 7e48aad6a8
commit 8c17af22a0
26 changed files with 962 additions and 368 deletions

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { SectionId } from "@/content/types";
import { onMounted, ref } from 'vue';
import type { SectionId } from '@/content/types';
import type { JourneySnapshot } from '@/journey/types';
const props = defineProps<{
@@ -18,21 +19,35 @@ const navigationLabels: Readonly<Record<SectionId, string>> = {
toolkit: 'Toolkit',
contact: 'Contact',
};
const disclosure = ref<HTMLDetailsElement | null>(null);
onMounted(() => {
if (window.matchMedia('(max-width: 767px)').matches) disclosure.value?.removeAttribute('open');
});
const navigate = (event: MouseEvent): void => {
props.onSectionLinkClick(event);
if (window.matchMedia('(max-width: 767px)').matches) disclosure.value?.removeAttribute('open');
};
</script>
<template>
<nav class="site-navigation" aria-label="Portfolio sections">
<ul>
<li v-for="item in items" :key="item.id">
<a
:href="`#${item.id}`"
:aria-current="
props.journey.activeSectionId === item.id ? 'page' : undefined
"
@click="props.onSectionLinkClick"
>{{ navigationLabels[item.id] }}</a
>
</li>
</ul>
<details ref="disclosure" class="site-navigation__disclosure" open>
<summary>Navigate</summary>
<ul>
<li v-for="item in items" :key="item.id">
<a
:href="`#${item.id}`"
:aria-current="
props.journey.activeSectionId === item.id ? 'page' : undefined
"
@click="navigate"
>{{ navigationLabels[item.id] }}</a
>
</li>
</ul>
</details>
</nav>
</template>