Skip to content
Snippets Groups Projects
Commit ad660859 authored by Juliette Kalflèche's avatar Juliette Kalflèche
Browse files

Merge branch 'suite-front' into 'master'

front 2, le retour, début page home

See merge request !9
parents dd863756 ff588cdc
No related branches found
No related tags found
1 merge request!9front 2, le retour, début page home
Pipeline #42512 passed
This diff is collapsed.
...@@ -8,10 +8,13 @@ ...@@ -8,10 +8,13 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@splidejs/splide": "^4.0.6",
"@splidejs/vue-splide": "^0.6.6",
"axios": "^0.27.2", "axios": "^0.27.2",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-router": "^4.0.3" "vue-router": "^4.0.3",
"vue3-carousel": "^0.1.40"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.12.16", "@babel/core": "^7.12.16",
......
<template> <template>
<Banner /> <Banner />
<NavBar />
<router-view /> <router-view />
<Footer /> <Footer />
</template> </template>
<script> <script>
import NavBar from "@/components/NavBar.vue";
import Footer from "@/components/Footer.vue"; import Footer from "@/components/Footer.vue";
import Banner from "@/components/Banner.vue"; import Banner from "@/components/Banner.vue";
export default { export default {
name: "App", name: "App",
components: { components: {
NavBar,
Footer, Footer,
Banner, Banner,
}, },
......
<template> <template>
<div class="banner"> <div class="banner">
<Text>CaCaoCritics</Text> <div class="name">
<img class="logo" alt="Vue logo" src="../assets/logo.png" />
<h1 class="text" >CaCaoCritics</h1>
</div>
<div class="menu">
<BurgerMenu />
</div>
</div> </div>
</template> </template>
<script> <script>
import BurgerMenu from "@/components/BurgerMenu.vue";
export default { export default {
name: "Banner", name: "Banner",
components: {
BurgerMenu,
},
}; };
</script> </script>
<style> <style>
.banner { .banner {
background-color: #912F56;
flex-direction: row;
vertical-align: middle;
display: flex;
width: 100%;
justify-content: space-between;
}
.name {
text-align: left; text-align: left;
background-color: #FF68AD; background-color: #912F56;
flex-direction: row;
vertical-align: middle;
display: flex;
}
.logo {
max-width: 70px;
max-height: 70px;
margin-right: 20px;
margin-top: 15px;
margin-left: 20px;
}
.text {
width: 100px;
color: #ffffff;
margin-top: 35px;
} }
</style> </style>
<template>
<div id="root">
<div id="topnav" class="topnav">
<a id="home_link" class="topnav_link" href="/">HOME</a>
<!-- Classic Menu -->
<nav role="navigation" id="topnav_menu">
<a class="topnav_link" href="/about">ABOUT</a>
<a class="topnav_link" href="/counter">COUNTER</a>
<a class="topnav_link" href="/users">USER</a>
</nav>
<a id="topnav_hamburger_icon" href="javascript:void(0);" onclick="showResponsiveMenu()">
<!-- Some spans to act as a hamburger -->
<span></span>
<span></span>
<span></span>
</a>
<!-- Responsive Menu -->
<nav role="navigation" id="topnav_responsive_menu">
<ul>
<li><a href="/">HOME</a></li>
<li><a href="/about">ABOUT</a></li>
<li><a href="/contact-us">CONTACT</a></li>
<li><a href="/privacy-policy">PRIVACY POLICY</a></li>
<li><a href="/terms-and-conditions">TERMS AND CONDITIONS</a></li>
</ul>
</nav>
</div>
</div>
</template>
<script>
export default {
methods: {
showResponsiveMenufunction: function () {
var menu = document.getElementById("topnav_responsive_menu");
var icon = document.getElementById("topnav_hamburger_icon");
var root = document.getElementById("root");
if (menu.className === "") {
menu.className = "open";
icon.className = "open";
root.style.overflowY = "hidden";
} else {
menu.className = "";
icon.className = "";
root.style.overflowY = "";
}
},
},
};
</script>
<style scoped>
/* ******************** NAV BAR ******************** */
.topnav {
background-color: #912F56;
display: flex;
align-items: center;
width: 100%;
}
.topnav_link {
color: white;
padding: 12px;
text-decoration: none;
}
.topnav_link:hover {
color: #0078b4;
}
/* hide responsive menu */
#topnav_hamburger_icon,
#topnav_responsive_menu {
display: none;
}
@media only screen and (max-width: 768px) {
/* hide classic menu */
#topnav_menu {
display: none;
}
/* position home link at left and hamburger at right */
#home_link {
flex-grow: 1;
}
/* disable horizontal scrolling */
#root {
overflow-x: hidden;
position: absolute;
}
/* show responsive menu and position at the right of the screen */
#topnav_responsive_menu {
display: block;
position: absolute;
margin: 0;
right: 0;
top: 0;
width: 100vw;
height: 100vh;
z-index: 99;
transform-origin: 0% 0%;
transform: translate(200%, 0);
transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
}
#topnav_responsive_menu ul {
display: flex;
flex-direction: column;
position: absolute;
margin: 0;
right: 0;
top: 0;
min-width: 50vw;
height: 100vh;
padding: 56px 0 0;
text-align: center;
background: #ededed;
list-style-type: none;
-webkit-font-smoothing: antialiased;
}
#topnav_responsive_menu li {
padding: 12px 24px;
}
#topnav_responsive_menu a {
white-space: nowrap;
color: #333;
text-decoration: none;
}
/* And let's slide it in from the right */
#topnav_responsive_menu.open {
transform: none;
position: fixed;
}
/* ******************** HAMBURGER ICON ******************** */
/* define size and position of the hamburger link */
#topnav_hamburger_icon {
display: block;
position: relative;
margin: 16px;
width: 33px;
height: 28px;
z-index: 100;
-webkit-user-select: none;
user-select: none;
cursor: pointer;
}
/* define the style (size, color, position, animation, ...) of the 3 spans */
#topnav_hamburger_icon span {
display: block;
position: absolute;
height: 4px;
width: 100%;
margin-bottom: 5px;
background: #ededed;
border-radius: 3px;
z-index: 100;
opacity: 1;
left: 0;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: 0.25s ease-in-out;
-moz-transition: 0.25s ease-in-out;
-o-transition: 0.25s ease-in-out;
transition: 0.25s ease-in-out;
}
/* set the 3 spans position to look like a hamburger */
#topnav_hamburger_icon span:nth-child(1) {
top: 0px;
-webkit-transform-origin: left top;
-moz-transform-origin: left top;
-o-transform-origin: left top;
transform-origin: left top;
}
#topnav_hamburger_icon span:nth-child(2) {
top: 12px;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
#topnav_hamburger_icon span:nth-child(3) {
top: 24px;
-webkit-transform-origin: left bottom;
-moz-transform-origin: left bottom;
-o-transform-origin: left bottom;
transform-origin: left bottom;
}
/* change color when opening the menu */
#topnav_hamburger_icon.open span {
background: #333;
}
/* the first span rotates 45° \ */
#topnav_hamburger_icon.open span:nth-child(1) {
width: 110%;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
/* the second span disappears */
#topnav_hamburger_icon.open span:nth-child(2) {
width: 0%;
opacity: 0;
}
/* the last span rotates -45° / */
#topnav_hamburger_icon.open span:nth-child(3) {
width: 110%;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
}
</style>
<template>
<div class="nav">
<router-link class="nav-link" to="/">Accueil</router-link> |
<router-link class="nav-link" to="/counter">Counter</router-link> |
<router-link class="nav-link" to="/users">Users</router-link> |
<router-link class="nav-link" to="/about">About</router-link>
</div>
</template>
<script>
export default {
name: "NavBar",
};
</script>
<style scoped>
.nav {
text-align: center;
padding: 30px;
}
.nav-link {
font-weight: bold;
color: #2c3e50;
}
.nav-link.router-link-exact-active {
color: #FF68AD;
}
</style>
<template>
<form id="content">
<input type="text" name="input" class="input" :class="{ square: closed}">
<button @click="toggleClose" type="reset" class="search" :class="{ close: closed }"></button>
</form>
</template>
<script>
export default {
data: function() {
return {
closed: false
}
},
methods: {
toggleClose() {
this.closed = !this.closed
}
},
}
</script>
<style scoped>
#content {
height: 50px;
width: 300px;
margin-left: 500px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
#content.on {
-webkit-animation-name: in-out;
animation-name: in-out;
-webkit-animation-duration: 0.7s;
animation-duration: 0.7s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: 1;
animation-iteration-count: 1;
}
input {
box-sizing: border-box;
width: 50px;
height: 50px;
border: 4px solid #000000;
border-radius: 50%;
background: none;
color: #fff;
font-size: 16px;
font-weight: 400;
font-family: Roboto;
outline: 0;
-webkit-transition: width 0.4s ease-in-out, border-radius 0.8s ease-in-out, padding 0.2s;
transition: width 0.4s ease-in-out, border-radius 0.8s ease-in-out, padding 0.2s;
-webkit-transition-delay: 0.4s;
transition-delay: 0.4s;
-webkit-transform: translate(-100%, -50%);
-ms-transform: translate(-100%, -50%);
transform: translate(-100%, -50%);
}
.search {
background: none;
position: absolute;
top: 0px;
left: 0;
height: 50px;
width: 50px;
padding: 0;
border-radius: 100%;
outline: 0;
border: 0;
color: inherit;
cursor: pointer;
-webkit-transition: 0.2s ease-in-out;
transition: 0.2s ease-in-out;
-webkit-transform: translate(-100%, -50%);
-ms-transform: translate(-100%, -50%);
transform: translate(-100%, -50%);
}
.search:before {
content: "";
position: absolute;
width: 20px;
height: 4px;
background-color: #000;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
margin-top: 26px;
margin-left: 17px;
-webkit-transition: 0.2s ease-in-out;
transition: 0.2s ease-in-out;
}
.close {
-webkit-transition: 0.4s ease-in-out;
transition: 0.4s ease-in-out;
-webkit-transition-delay: 0.4s;
transition-delay: 0.4s;
}
.close:before {
content: "";
position: absolute;
width: 27px;
height: 4px;
margin-top: -1px;
margin-left: -13px;
background-color: #000;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transition: 0.2s ease-in-out;
transition: 0.2s ease-in-out;
}
.close:after {
content: "";
position: absolute;
width: 27px;
height: 4px;
background-color: #000;
margin-top: -1px;
margin-left: -13px;
cursor: pointer;
-webkit-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.square {
box-sizing: border-box;
padding: 0 40px 0 10px;
width: 300px;
height: 50px;
border: 4px solid #000000;
border-radius: 0;
background: none;
color: #000;
font-family: Roboto;
font-size: 16px;
font-weight: 400;
outline: 0;
-webkit-transition: width 0.4s ease-in-out, border-radius 0.4s ease-in-out, padding 0.2s;
transition: width 0.4s ease-in-out, border-radius 0.4s ease-in-out, padding 0.2s;
-webkit-transition-delay: 0.4s, 0s, 0.4s;
transition-delay: 0.4s, 0s, 0.4s;
-webkit-transform: translate(-100%, -50%);
-ms-transform: translate(-100%, -50%);
transform: translate(-100%, -50%);
}
</style>
\ No newline at end of file
body {
margin: 0;
background-color: #EAF2EF;
}
#app { #app {
font-family: Avenir, Helvetica, Arial, sans-serif; font-family: Avenir, Helvetica, Arial, sans-serif;
} }
<template> <template>
<div class="home"> <div class="home">
<h1>Bienvenue sur CaCaoCritics</h1> <div class="carousel">
<img class="logo" alt="Vue logo" src="../assets/logo.png" /> <carousel :items-to-show="5.5" autoplay=1300>
<slide v-for="movie in movies" :key="movie.id" autoplay='True' transition="100" >
<img
:src="'https://image.tmdb.org/t/p/original/' + movie.poster_path"
withd="100"
height="300"
/>
</slide>
<template #addons>
<navigation />
<pagination />
</template>
</carousel>
</div>
<br /> <br />
<input type="text" v-model="moviename" placeholder="enter a movie name" /> <div class="search">
<SearchBar />
</div>
<div class="film-name">Le film est : {{ moviename }}</div> <div class="film-name">Le film est : {{ moviename }}</div>
<li v-for="movie in movies" :key="movie.id"> <li v-for="movie in movies" :key="movie.id">
<p class="movie-title"> <p class="movie-title">
{{ movie.title }} {{ movie.title }}
</p> </p>
<p> <p class="film">
<img <img
:src="'https://image.tmdb.org/t/p/original/' + movie.poster_path" :src="'https://image.tmdb.org/t/p/original/' + movie.poster_path"
withd="100" withd="100"
...@@ -22,9 +37,19 @@ ...@@ -22,9 +37,19 @@
<script> <script>
import axios from "axios"; import axios from "axios";
import 'vue3-carousel/dist/carousel.css';
import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel';
import SearchBar from "../components/SearchBar.vue";
export default { export default {
name: "Home", name: "Home",
components: {
Carousel,
Slide,
Pagination,
Navigation,
SearchBar,
},
data: function () { data: function () {
return { return {
moviename: "", moviename: "",
...@@ -42,7 +67,7 @@ export default { ...@@ -42,7 +67,7 @@ export default {
this.movies = response.data.results; this.movies = response.data.results;
}) })
.catch((error) => { .catch((error) => {
this.moviesLoadingError = "An error occured while fetching movies."; this.moviesLoadingError = "An error occured while e ing movies.";
console.error(error); console.error(error);
}); });
}, },
...@@ -55,9 +80,6 @@ export default { ...@@ -55,9 +80,6 @@ export default {
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped> <style scoped>
.home {
text-align: center;
}
.logo { .logo {
max-width: 100px; max-width: 100px;
...@@ -80,4 +102,12 @@ li { ...@@ -80,4 +102,12 @@ li {
a { a {
color: #ff68ad; color: #ff68ad;
} }
.carousel {
margin-top: 30px;
margin-left: 5px;
margin-right: 5px;
}
.film {
text-align: center;
}
</style> </style>
{
"lockfileVersion": 1
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment