Skip to content

Commit

Permalink
Commit
Browse files Browse the repository at this point in the history
Ajustements animation et feuilles scss
  • Loading branch information
ValerianMermoz committed Jul 18, 2023
1 parent fd58f06 commit 17701f4
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 136 deletions.
4 changes: 2 additions & 2 deletions Kasa/src/Composants/Banners/Banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
top : 100px;
text-align: center;
@include s.mobile-only {
top : 35px;
top : 100px;
width: 100%;
text-align: center;
}
Expand All @@ -33,7 +33,7 @@
height: 220px;
border-radius: 40px;
@include s.mobile-only {
height : 110px;
border-radius : 20px;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Kasa/src/Composants/Footer/Footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
& h2 {
font-weight : 500;
font-size : 24px;
font-size : 18px;
Line-height : 34.22px;
color: white;
}
Expand Down
2 changes: 1 addition & 1 deletion Kasa/src/Composants/Logement/Accordionlogement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const AccordionLogement = ({ content, text }) => {
></img>
</div>
</div>
{isActive && <p className="accordion-content">{content}</p>}
{isActive && <div className={`accordion-content ${rotateChevron ? "ouvert" : ""}`}>{content}</div>}
</div>
);
};
Expand Down
73 changes: 45 additions & 28 deletions Kasa/src/Composants/Logement/CarrouselComposent.jsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,52 @@
import React, {useState} from "react"
import React, { useState } from "react";
import Flechegauche from "../../Images/Flechegauche.png";
import Flechedroite from "../../Images/Flechedroite.png";
import "../../Pages/Fichelogement/Fichelogement.scss";
import useLogement from "./Datalogement";

const Carrousel = () => {
const logement = useLogement();
const [imageActuelle, setImageActuelle] = useState(0);
const image = logement.pictures[imageActuelle];
const compteur = `${imageActuelle + 1} / ${logement.pictures.length}`;

const imageSuivante = () => {
setImageActuelle((prevIndex) => {
const nextIndex = prevIndex + 1;
return nextIndex === logement.pictures.length ? 0 : nextIndex;
});
};

const imagePrecedente = () => {
setImageActuelle((prevIndex) => {
const nextIndex = prevIndex - 1;
return nextIndex < 0 ? logement.pictures.length - 1 : nextIndex;
});
};
const logement = useLogement();
const [imageActuelle, setImageActuelle] = useState(0);
const image = logement.pictures[imageActuelle];
const compteur = `${imageActuelle + 1} / ${logement.pictures.length}`;

const imageSuivante = () => {
setImageActuelle((prevIndex) => {
const nextIndex = prevIndex + 1;
return nextIndex === logement.pictures.length ? 0 : nextIndex;
});
};

const imagePrecedente = () => {
setImageActuelle((prevIndex) => {
const nextIndex = prevIndex - 1;
return nextIndex < 0 ? logement.pictures.length - 1 : nextIndex;
});
};
if (logement.pictures.length <= 1) {
return (
<div className="carrousel">
<img className="carrousel_img" src={image} alt="logement"/>
<img className="carrousel__arrow carrousel__flechedroite" src={Flechedroite} alt="" onClick={imageSuivante}></img>
<img className="carrousel__arrow carrousel__flechegauche" src={Flechegauche} alt="" onClick={imagePrecedente}></img>
<div className="carrousel_compteur">{compteur}</div>
</div>
)
}
export default Carrousel;
<div className="carrousel">
<img className="carrousel_img" src={image} alt="logement" />
</div>
);
}
return (
<div className="carrousel">
<img className="carrousel_img" src={image} alt="logement" />
<img
className="carrousel__fleche carrousel__flechedroite"
src={Flechedroite}
alt=""
onClick={imageSuivante}
></img>
<img
className="carrousel__fleche carrousel__flechegauche"
src={Flechegauche}
alt=""
onClick={imagePrecedente}
></img>
<div className="carrousel_compteur">{compteur}</div>
</div>
);
};
export default Carrousel;
6 changes: 3 additions & 3 deletions Kasa/src/Composants/Logement/Contenulogement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const Titrelogement = () => {
}
return (
<section>
<div className="title">
<div className="tilte_info">
<div className="titre">
<div className="titre_info">
<h1>{logement.title}</h1>
<p>{logement.location}</p>
</div>
<div className="title_name">
<div className="titre_nom">
<p>{logement.host.name}</p>
<img className="photovendeur" src={logement.host.picture} alt={logement.host.name}></img>
</div>
Expand Down
19 changes: 6 additions & 13 deletions Kasa/src/Pages/Apropos/Apropos.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,26 @@

@keyframes openModal {
0% {
transform: translateY(5%);
transform: scaleY(0);
}
100% {
transform: translateY(0);
}
}

@keyframes closeModal {
0% {
transform: translateY(0);
80% {
transform: scaleY(1.1);
}
100% {
transform: translateY(5%);
transform: scaleY(1);
}
}

& .accordion-content {
transition: all 10s linear;
font-size: 18px;
color: #ff6060;
background-color: #f6f6f6;
padding: 1rem;
border-radius: 5px;
animation: openModal .5s linear;
}
.accordion-content.ouvert {
animation: closeModal .5s linear;
animation: openModal 0.5s ease-in-out forwards;
transform-origin: top center;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Kasa/src/Pages/D404/D404.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './D404.scss';

function Error() {
return (
<div class="texterreur">
<div className="texterreur">
<img src={Erreurimg} className='Erreurimg' alt="404" />
<h4>Oups! La page que vous demandez n'existe pas.</h4>
<a href="../">Retourner sur la page d'accueil</a>
Expand Down
5 changes: 2 additions & 3 deletions Kasa/src/Pages/D404/D404.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
@use "../../index.scss" as s;



.texterreur {
display: flex;
color: #ff6060;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 80px;
padding-top: 80px;
padding-bottom: 80px;

& .Erreurimg {
width: 25%;
width: 30%;
}

@include s.mobile-only {
Expand Down
Loading

0 comments on commit 17701f4

Please sign in to comment.