commit relout parce que l'écran est pété

This commit is contained in:
Lou 2021-08-27 20:28:17 +02:00
commit 86fd9d3a6d
4 changed files with 76 additions and 16 deletions

View file

@ -54,3 +54,14 @@ header {
}
}
}
@media screen and (max-width: 800px) {
header {
margin-top: -8rem;
height: 102vh;
.hero {
margin-top: 10rem;
}
}
}

View file

@ -1,11 +1,13 @@
import React, { useContext } from "react";
import React, { useContext, useState, useEffect } from "react";
import { Link } from "gatsby";
import HeaderContext from "../../context/headerContext";
import "./index.scss";
import MenuIcon from "../../images/menu.svg";
const Navbar = () => {
const headerContext = useContext(HeaderContext);
const [toogleMenu, setToogleMenu] = useState(false);
const handleShowNavbar = (context) => {
if (context.isHeaderHidden === true) {
@ -15,20 +17,41 @@ const Navbar = () => {
}
};
const handleMenu = () => {
setToogleMenu(!toogleMenu);
};
const menuStyle = {
background: "red";
}
return (
<div id="navbar-container">
<nav style={handleShowNavbar(headerContext)}>
<div className="details">
<Link to="/services" className="menu-btn">
<Link to="/services" className="menu-btn" style={{ toogleMenu ? `${menuStyle}` : "" }}>
{/* the above line does not work */}
<span>Services</span>
</Link>
<Link to="/a-propos" className="menu-btn">
<span>L'Association</span>
</Link>
</div>
<Link id="navbar-title" to="/">
<span>CLI</span>
</Link>
<div className="title-container">
<Link id="navbar-title" to="/">
<span>CLI</span>
</Link>
<span className="menu-icon-container" onClick={handleMenu}>
<img
src={MenuIcon}
className="menu-icon"
alt="Menu icon"
height="30px"
width="30px"
/>
</span>
</div>
<Link to="/nous-contacter" id="contact-btn" className="menu-btn">
<button className="btn">Nous contacter</button>
</Link>

View file

@ -32,16 +32,23 @@ nav {
}
}
#navbar-title {
font-family: "Cutive Mono";
font-size: 2.5rem;
font-weight: bold;
color: $dark;
div.title-container {
margin: 0 auto;
span {
#navbar-title {
font-family: "Cutive Mono";
font-size: 2.5rem;
font-weight: bold;
color: $dark;
margin: 0;
padding: 0;
span {
margin: 0;
padding: 0;
}
}
.menu-icon-container {
display: none;
}
}
@ -72,14 +79,33 @@ nav {
position: relative;
z-index: 0;
display: flex;
flex-direction: column;
flex-direction: column-reverse;
align-items: center;
justify-content: space-between;
margin-top: 3rem;
.details {
display: flex;
flex-direction: column;
align-items: center;
margin-left: 0;
}
div.title-container {
display: flex;
align-items: center;
.menu-icon-container {
display: block;
margin-left: 1rem;
&:hover {
cursor: pointer;
}
}
}
#contact-btn {
display: none;
}
}
}

View file

@ -1,3 +1,3 @@
<svg width="87" height="87" viewBox="0 0 87 87" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M78.8438 70.6875H8.15625C7.43519 70.6875 6.74367 70.9739 6.2338 71.4838C5.72394 71.9937 5.4375 72.6852 5.4375 73.4062L5.4375 78.8438C5.4375 79.5648 5.72394 80.2563 6.2338 80.7662C6.74367 81.2761 7.43519 81.5625 8.15625 81.5625H78.8438C79.5648 81.5625 80.2563 81.2761 80.7662 80.7662C81.2761 80.2563 81.5625 79.5648 81.5625 78.8438V73.4062C81.5625 72.6852 81.2761 71.9937 80.7662 71.4838C80.2563 70.9739 79.5648 70.6875 78.8438 70.6875ZM78.8438 48.9375H8.15625C7.43519 48.9375 6.74367 49.2239 6.2338 49.7338C5.72394 50.2437 5.4375 50.9352 5.4375 51.6562L5.4375 57.0938C5.4375 57.8148 5.72394 58.5063 6.2338 59.0162C6.74367 59.5261 7.43519 59.8125 8.15625 59.8125H78.8438C79.5648 59.8125 80.2563 59.5261 80.7662 59.0162C81.2761 58.5063 81.5625 57.8148 81.5625 57.0938V51.6562C81.5625 50.9352 81.2761 50.2437 80.7662 49.7338C80.2563 49.2239 79.5648 48.9375 78.8438 48.9375ZM78.8438 27.1875H8.15625C7.43519 27.1875 6.74367 27.4739 6.2338 27.9838C5.72394 28.4937 5.4375 29.1852 5.4375 29.9062L5.4375 35.3438C5.4375 36.0648 5.72394 36.7563 6.2338 37.2662C6.74367 37.7761 7.43519 38.0625 8.15625 38.0625H78.8438C79.5648 38.0625 80.2563 37.7761 80.7662 37.2662C81.2761 36.7563 81.5625 36.0648 81.5625 35.3438V29.9062C81.5625 29.1852 81.2761 28.4937 80.7662 27.9838C80.2563 27.4739 79.5648 27.1875 78.8438 27.1875ZM78.8438 5.4375H8.15625C7.43519 5.4375 6.74367 5.72394 6.2338 6.2338C5.72394 6.74367 5.4375 7.43519 5.4375 8.15625L5.4375 13.5938C5.4375 14.3148 5.72394 15.0063 6.2338 15.5162C6.74367 16.0261 7.43519 16.3125 8.15625 16.3125H78.8438C79.5648 16.3125 80.2563 16.0261 80.7662 15.5162C81.2761 15.0063 81.5625 14.3148 81.5625 13.5938V8.15625C81.5625 7.43519 81.2761 6.74367 80.7662 6.2338C80.2563 5.72394 79.5648 5.4375 78.8438 5.4375V5.4375Z" fill="black"/>
<path d="M78.8438 70.6875H8.15625C7.43519 70.6875 6.74367 70.9739 6.2338 71.4838C5.72394 71.9937 5.4375 72.6852 5.4375 73.4062L5.4375 78.8438C5.4375 79.5648 5.72394 80.2563 6.2338 80.7662C6.74367 81.2761 7.43519 81.5625 8.15625 81.5625H78.8438C79.5648 81.5625 80.2563 81.2761 80.7662 80.7662C81.2761 80.2563 81.5625 79.5648 81.5625 78.8438V73.4062C81.5625 72.6852 81.2761 71.9937 80.7662 71.4838C80.2563 70.9739 79.5648 70.6875 78.8438 70.6875ZM78.8438 48.9375H8.15625C7.43519 48.9375 6.74367 49.2239 6.2338 49.7338C5.72394 50.2437 5.4375 50.9352 5.4375 51.6562L5.4375 57.0938C5.4375 57.8148 5.72394 58.5063 6.2338 59.0162C6.74367 59.5261 7.43519 59.8125 8.15625 59.8125H78.8438C79.5648 59.8125 80.2563 59.5261 80.7662 59.0162C81.2761 58.5063 81.5625 57.8148 81.5625 57.0938V51.6562C81.5625 50.9352 81.2761 50.2437 80.7662 49.7338C80.2563 49.2239 79.5648 48.9375 78.8438 48.9375ZM78.8438 27.1875H8.15625C7.43519 27.1875 6.74367 27.4739 6.2338 27.9838C5.72394 28.4937 5.4375 29.1852 5.4375 29.9062L5.4375 35.3438C5.4375 36.0648 5.72394 36.7563 6.2338 37.2662C6.74367 37.7761 7.43519 38.0625 8.15625 38.0625H78.8438C79.5648 38.0625 80.2563 37.7761 80.7662 37.2662C81.2761 36.7563 81.5625 36.0648 81.5625 35.3438V29.9062C81.5625 29.1852 81.2761 28.4937 80.7662 27.9838C80.2563 27.4739 79.5648 27.1875 78.8438 27.1875ZM78.8438 5.4375H8.15625C7.43519 5.4375 6.74367 5.72394 6.2338 6.2338C5.72394 6.74367 5.4375 7.43519 5.4375 8.15625L5.4375 13.5938C5.4375 14.3148 5.72394 15.0063 6.2338 15.5162C6.74367 16.0261 7.43519 16.3125 8.15625 16.3125H78.8438C79.5648 16.3125 80.2563 16.0261 80.7662 15.5162C81.2761 15.0063 81.5625 14.3148 81.5625 13.5938V8.15625C81.5625 7.43519 81.2761 6.74367 80.7662 6.2338C80.2563 5.72394 79.5648 5.4375 78.8438 5.4375V5.4375Z" fill="#2f2e41"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After