mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
The phone shell no longer builds its tab bar and backdrop or writes their aria-expanded, aria-hidden and hidden state: it publishes its tabs, whether it is on and the open sheet to the gev-display store, and a new PhoneTabBar component in the dock teleports them to the end of the page from the first publish until the shell is destroyed, so they still follow the scene's credits. The shell takes tab and backdrop clicks from the document and returns focus to a tab once the tab bar shows it closed; a reopen or destroy cancels a pending return.
20 lines
1.0 KiB
Vue
20 lines
1.0 KiB
Vue
<script setup>
|
|
import { storeToRefs } from 'pinia';
|
|
import { t } from '../../../i18n/index.js';
|
|
import { useDisplayStore } from '../../stores/display.js';
|
|
|
|
// The phone shell's tab bar and sheet backdrop. They join the end of the
|
|
// page when the shell first publishes, after the scene's credits, and leave
|
|
// it when the shell is destroyed; desktop CSS hides them meanwhile.
|
|
const { phoneShell: phone } = storeToRefs(useDisplayStore());
|
|
</script>
|
|
|
|
<template>
|
|
<Teleport v-if="phone" to="body">
|
|
<div id="mobile-sheet-backdrop" :hidden="!phone.sheet"></div>
|
|
<nav id="mobile-tab-bar" :aria-label="t('Panels')" :aria-hidden="String(!phone.enabled)">
|
|
<button v-for="tab in phone.tabs" :key="tab.sheet" type="button" class="mobile-tab" :data-mobile-sheet="tab.sheet" :aria-expanded="String(phone.sheet === tab.sheet)"><span class="material-symbols-outlined mobile-tab-icon" aria-hidden="true">{{ tab.icon }}</span><span class="mobile-tab-label">{{ t(tab.label) }}</span></button>
|
|
</nav>
|
|
</Teleport>
|
|
</template>
|