munch-ease-frontend/src/App.vue
2025-10-18 12:36:55 +11:00

92 lines
1.8 KiB
Vue

<template>
<div>
<ul class="nav">
<li class="nav-item">
<router-link class="nav-link" :to="{ name: 'recipes' }" active-class="active">Recipes</router-link>
</li>
<li class="nav-item">
<router-link class="nav-link" :to="{ name: 'mealplan' }" active-class="active">Meal Plan</router-link>
</li>
<li class="nav-item">
<router-link class="nav-link" :to="{ name: 'shopping' }" active-class="active">Shopping</router-link>
</li>
</ul>
</div>
<div class="viewport">
<router-view/>
</div>
<alert-toast />
</template>
<script>
import AlertToast from './components/AlertToast.vue'
export default {
name: 'App',
components: {
'alert-toast': AlertToast
},
computed: {
currentRoute() {
return this.$route.path
}
}
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
/* Make nav bar links buttons across top of screen */
.nav {
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 1;
display: flex;
justify-content: space-around;
list-style-type: none;
margin: 0;
padding: 0;
position: fixed;
top: 0;
width: 100%;
background-color: #333;
}
.nav li {
flex: 1;
}
/* Style the links inside the navigation bar */
.nav a {
display: inline-block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* Have active route use different color */
.nav li:has(> a.active) {
background-color: #4CAF50;
color: white;
}
.viewport {
max-width: 1200px;
margin: auto;
}
</style>