Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout d'une barre de navigation #46

Merged
merged 6 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions front-end/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<template>
<div id="nav">
<h1>Ma Cantine Egalim</h1>
<Welcome msg="Tout savoir sur la loi Egalim"/>
<TheNavbar/>
hfroot marked this conversation as resolved.
Show resolved Hide resolved

<router-link to="/about">About</router-link>
</div>
<router-view/>
</template>

<script>
// @ is an alias to /src
import Welcome from '@/components/Welcome.vue'
import TheNavbar from '@/components/TheNavbar.vue'

export default {
components: {
Welcome
TheNavbar
}
}
</script>
Expand All @@ -27,17 +23,4 @@ export default {
text-align: center;
color: #2c3e50;
}

#nav {
padding: 30px;
}

#nav a {
font-weight: bold;
color: #2c3e50;
}

#nav a.router-link-exact-active {
color: #42b983;
}
</style>
Binary file added front-end/src/assets/Marianne.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front-end/src/assets/logo-ma-cantine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed front-end/src/assets/logo.png
Binary file not shown.
84 changes: 84 additions & 0 deletions front-end/src/components/TheNavbar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<template>
<div id="navbar">
<router-link :to="{ name: 'LandingPage' }" id="landing">
<img src="@/assets/Marianne.png" id="Marianne">
<div id="logo">
hfroot marked this conversation as resolved.
Show resolved Hide resolved
<div id="ma-cantine-beta-gouv"><span id="ma-cantine">ma-cantine</span>.beta.gouv.fr</div>
<div id="egalim">Pour une alimentatation saine, de qualité et plus durable dans nos assiettes grâce à EGAlim</div>
hfroot marked this conversation as resolved.
Show resolved Hide resolved
</div>
</router-link>
<router-link :to="{ name: 'KeypointsPage' }" class="navbar-item">Mesures phares</router-link>
<a class="navbar-item" href="https://beta.gouv.fr/startups/egalim.html" target="_blank">A propos</a>
hfroot marked this conversation as resolved.
Show resolved Hide resolved
</div>
</template>

<script>
export default {
name: 'TheNavbar',
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
a {
text-decoration: none;
}

#navbar {
display: flex;
justify-content: space-between;
padding: 10px 50px;
}

#landing {
display: flex;
}

#Marianne {
height: 75px;
}

#logo {
display: flex;
flex-direction: column;
justify-content: space-around;
margin-left: 30px;
text-align: left;
width: 300px;
text-decoration: none;
}

#ma-cantine-beta-gouv {
font-style: italic;
font-weight: 200;
font-size: 25px;
line-height: 29px;
color: rgba(64, 64, 64, 0.85);
}

#ma-cantine {
font-weight: bold;
color: #F7B48E;
}

#egalim {
font-size: 11px;
font-weight: 600;
line-height: 15px;
color: rgba(0,0,0,0.83);
}

.navbar-item {
margin: auto 0;
border-radius: 25px;
padding: 15px;
font-size: 17px;
line-height: 20px;
color: rgba(64, 64, 64, 0.85);
}

.navbar-item:hover {
color: white;
background-color: #F7B48E;
}
</style>
21 changes: 0 additions & 21 deletions front-end/src/components/Welcome.vue

This file was deleted.

24 changes: 14 additions & 10 deletions front-end/src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { createRouter, createWebHistory } from 'vue-router'
import { createRouter, createWebHistory } from 'vue-router';
import LandingPage from '@/views/LandingPage.vue';
import KeypointsPage from '@/views/KeypointsPage.vue';

const routes = [
{
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
path: '/',
name: 'LandingPage',
component: LandingPage,
},
{
path: '/mesures-phares',
name: 'KeypointsPage',
component: KeypointsPage,
hfroot marked this conversation as resolved.
Show resolved Hide resolved
}
]
];

const router = createRouter({
history: createWebHistory(),
routes
})
});

export default router
export default router;
5 changes: 0 additions & 5 deletions front-end/src/views/About.vue

This file was deleted.

5 changes: 5 additions & 0 deletions front-end/src/views/KeypointsPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
<h1>Mesures Phares</h1>
</div>
</template>
5 changes: 5 additions & 0 deletions front-end/src/views/LandingPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
<h1>Welcome</h1>
</div>
</template>