diff --git a/src/components/YrhButton.vue b/src/components/YrhButton.vue index 53d2167..65a72ff 100644 --- a/src/components/YrhButton.vue +++ b/src/components/YrhButton.vue @@ -9,10 +9,15 @@ const btnRef = ref() const isBtnHovered = useElementHover(btnRef) const { focused: isBtnFocused } = useFocus(btnRef) -const shouldArrowDisplay = computed(() => isBtnFocused.value || isBtnHovered.value) +const emit = defineEmits(['clicked']) + +const shouldArrowDisplay = computed( + () => isBtnFocused.value || isBtnHovered.value || props.hasArrow === 'force' +) function handleClick() { clickSfx.play() + emit('clicked') } function handleMouseOver() { @@ -31,7 +36,7 @@ const props = defineProps<{ disabled?: boolean isActive?: boolean hasSquare?: boolean - hasArrow?: boolean + hasArrow?: boolean | 'force' }>() const attributes = { @@ -63,7 +68,8 @@ const elementTag = computed(() => (props.href ? 'a' : 'button')) src="/yorha-cursor.svg" height="32" width="32" - class="absolute top-1/2 -translate-y-1/2 -left-10 scale-90 pointer-events-none" + class="absolute top-1/2 -translate-y-1/2 -left-10 scale-90 pointer-events-none transition-all" + :class="{ 'invert-[.33] opacity-60': props.hasArrow === 'force' }" alt="" /> diff --git a/src/components/YrhMainNav.vue b/src/components/YrhMainNav.vue deleted file mode 100644 index 14432dd..0000000 --- a/src/components/YrhMainNav.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - - - diff --git a/src/components/YrhNav.vue b/src/components/YrhNav.vue new file mode 100644 index 0000000..dc65ee2 --- /dev/null +++ b/src/components/YrhNav.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/models/YrhNavItem.ts b/src/models/YrhNavItem.ts new file mode 100644 index 0000000..2994d31 --- /dev/null +++ b/src/models/YrhNavItem.ts @@ -0,0 +1,5 @@ +export interface MenuItem { + id: string + label: string + bannerText: string +} diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index eea1b15..16f4fd0 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -3,12 +3,37 @@ import { computed, ref } from 'vue' import YrhBanner from '@/components/YrhBanner.vue' import YrhHeading from '@/components/YrhHeading.vue' -import YrhMainNav from '@/components/YrhMainNav.vue' +import YrhNav from '@/components/YrhNav.vue' import { useBannerStore } from '@/stores/banner' import { storeToRefs } from 'pinia' +import type { MenuItem } from '@/models/YrhNavItem' const { bannerText } = storeToRefs(useBannerStore()) + +const availableRoutes: MenuItem[] = [ + { + id: 'current-data', + label: 'Current Data', + bannerText: 'Search through current file data' + }, + { + id: 'settings', + label: 'Settings', + bannerText: 'Modify personnal data' + }, + { + id: 'credits', + label: 'Credits', + bannerText: "Search through personnel's archive" + } +] + +const activeRoute = ref('') + +function switchActiveRoute(key: string | null) { + activeRoute.value = key +}