2026-03-24 23:19:26 +01:00
|
|
|
<template>
|
|
|
|
|
<div id="app-root">
|
2026-03-26 23:35:14 +01:00
|
|
|
<MealPlanner v-if="page === 'meal'" @go-shop="page = 'shop'" />
|
2026-03-24 23:19:26 +01:00
|
|
|
<Converter v-else-if="page === 'convert'" />
|
|
|
|
|
<ShoppingList v-else-if="page === 'shop'" />
|
|
|
|
|
<BottomNav v-model="page" />
|
2026-03-25 08:38:47 +01:00
|
|
|
|
|
|
|
|
<!-- bottone info fisso in alto a destra -->
|
|
|
|
|
<button class="btn-info" @click="showInfo = true" aria-label="Informazioni app">
|
|
|
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
|
|
|
<circle cx="12" cy="12" r="10"/>
|
|
|
|
|
<line x1="12" y1="16" x2="12" y2="12"/>
|
|
|
|
|
<line x1="12" y1="8" x2="12.01" y2="8"/>
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
|
2026-03-27 14:32:36 +01:00
|
|
|
<InfoPanel v-model="showInfo" @open-docs="showDocs = true" />
|
|
|
|
|
<DocsPanel v-model="showDocs" />
|
2026-03-24 23:19:26 +01:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import BottomNav from './components/BottomNav.vue'
|
2026-03-25 08:38:47 +01:00
|
|
|
import InfoPanel from './components/InfoPanel.vue'
|
2026-03-27 14:32:36 +01:00
|
|
|
import DocsPanel from './components/DocsPanel.vue'
|
2026-03-24 23:19:26 +01:00
|
|
|
import MealPlanner from './pages/MealPlanner.vue'
|
|
|
|
|
import Converter from './pages/Converter.vue'
|
|
|
|
|
import ShoppingList from './pages/ShoppingList.vue'
|
|
|
|
|
|
2026-03-27 14:32:36 +01:00
|
|
|
const page = ref('meal')
|
2026-03-25 08:38:47 +01:00
|
|
|
const showInfo = ref(false)
|
2026-03-27 14:32:36 +01:00
|
|
|
const showDocs = ref(false)
|
2026-03-24 23:19:26 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
#app-root {
|
|
|
|
|
height: 100dvh;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-03-25 08:38:47 +01:00
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-info {
|
|
|
|
|
position: fixed;
|
2026-03-26 19:48:07 +01:00
|
|
|
top: calc(14px + env(safe-area-inset-top));
|
2026-03-25 08:38:47 +01:00
|
|
|
right: 16px;
|
|
|
|
|
/* centra rispetto al max-width del layout */
|
|
|
|
|
max-width: calc(480px);
|
|
|
|
|
background: var(--color-surface);
|
|
|
|
|
color: var(--color-muted);
|
|
|
|
|
min-height: 36px;
|
|
|
|
|
min-width: 36px;
|
|
|
|
|
padding: 0;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
box-shadow: var(--shadow-sm);
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
z-index: 50;
|
|
|
|
|
transition: color var(--transition), box-shadow var(--transition);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-info:active {
|
|
|
|
|
color: var(--color-primary);
|
|
|
|
|
box-shadow: var(--shadow-md);
|
|
|
|
|
opacity: 1;
|
2026-03-24 23:19:26 +01:00
|
|
|
}
|
|
|
|
|
</style>
|