feat(header): Cria o header top para desktop

This commit is contained in:
Sabrina Miranda 2023-01-07 20:26:58 -03:00
parent 0e31e2ae68
commit 161a43f6cc
8 changed files with 291 additions and 1 deletions

View File

@ -0,0 +1,185 @@
@use '../../variables';
.header-top {
border-bottom: 1px solid variables.$gray-400;
@media (max-width: 1024px) {
border-bottom: none;
}
&__wrapper {
display: grid;
grid-template-columns: 1fr minmax(264px, 24.4445%) 1fr;
padding: 22px 100px;
height: 76px;
@media (min-width: 3600px) {
grid-template-columns: 1fr 700px 1fr;
height: 111px;
}
@media ((min-width: 2500px) and (max-width: 3599px)) {
grid-template-columns: 1fr 515px 1fr;
height: 101px;
}
@media ((min-width: 1900px) and (max-width: 2499px)) {
grid-template-columns: 1fr 415px 1fr;
}
}
&__logo {
display: flex;
align-items: center;
justify-content: left;
@media (max-width: 1024px) {
justify-content: center;
grid-area: 1/2;
}
&__img {
width: 100%;
max-width: 136px;
@media (min-width: 3600px) {
min-width: 290px;
}
@media ((min-width: 2500px) and (max-width: 3599px)) {
min-width: 265px;
}
}
}
&__search-bar {
display: flex;
justify-content: center;
align-items: center;
position: relative;
&__input {
margin: 0 auto;
width: 100%;
min-width: 264px;
height: 32px;
background-color: variables.$white;
border: 2px solid variables.$gray-500;
border-radius: 5px;
padding: 12px 16px;
font-size: 14px;
line-height: 16px;
color: variables.$gray-300;
@media (min-width: 3600px) {
max-width: 700px;
height: 62px;
font-size: 32px;
line-height: 38px;
}
@media ((min-width: 2500px) and (max-width: 3599px)) {
max-width: 515px;
height: 57px;
font-size: 28px;
line-height: 33px;
}
@media ((min-width: 1900px) and (max-width: 2499px)){
max-width: 415px;
}
&::placeholder {
font-size: 14px;
line-height: 16px;
color: variables.$gray-300;
@media (min-width: 3600px) {
font-size: 32px;
line-height: 38px;
}
@media ((min-width: 2500px) and (max-width: 3599px)) {
font-size: 28px;
line-height: 33px;
}
}
&::-webkit-search-cancel-button {
-webkit-appearance: none;
}
}
&__btn {
border: none;
background: transparent;
position: absolute;
top: 7px;
right: 16px;
@media (min-width: 3600px) {
top: 16px;
bottom: 11px;
}
@media ((min-width: 2500px) and (max-width: 3599px)){
top: 11px;
bottom: 11px;
}
&__img {
@media (min-width: 2500px) {
width: 100%;
min-width: 35px;
}
}
}
}
&__menu {
display: flex;
align-items: center;
justify-content: right;
gap: 55px;
&__login {
color: variables.$white;
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
&:hover {
filter: brightness(80%);
}
@media (min-width: 3600px) {
font-size: 32px;
line-height: 38px;
}
@media ((min-width: 2500px) and (max-width: 3599px)) {
font-size: 28px;
line-height: 33px;
}
}
&__btn-cart {
background: transparent;
border: none;
&:hover {
filter: brightness(80%);
}
&__img {
width: 100%;
max-width: 28px;
@media (min-width: 2500px) {
min-width: 54px;
}
}
}
}
}

View File

@ -0,0 +1,56 @@
import {useState} from 'react';
import styles from "./HeaderTop.module.scss";
import imgLogo from "./assets/logo-m3academy.png";
import imgCart from "./assets/cart.svg";
import imgSearch from "./assets/search.svg";
const HeaderTop = () => {
const [search, setSearch] = useState("");
const handleSearch = ({target}:any) =>{
setSearch(target.value);
}
const cleanSearch = () => setSearch('');
return (
<div className={styles["header-top"]}>
<div className={styles["header-top__wrapper"]}>
<picture className={styles["header-top__logo"]}>
<a href="/">
<img className={styles["header-top__logo__img"]} src= {imgLogo} alt="Logo M3 Academy" />
</a>
</picture>
<div className={styles["header-top__search-bar"]}>
<input className={styles["header-top__search-bar__input"]}
type='search' id='search-bar' name='search' placeholder='Buscar...'
value={search}
onChange={handleSearch}
onBlur={cleanSearch}
/>
<button className={styles["header-top__search-bar__btn"]} type='submit'>
<img className={styles["header-top__search-bar__btn__img"]} src= {imgSearch} alt="ìcone Lupa" />
</button>
</div>
<div className={styles["header-top__menu"]}>
<a href='/' className={styles["header-top__menu__login"]}>
Entrar
</a>
<button className={styles["header-top__menu__btn-cart"]}>
<img className={styles["header-top__menu__btn-cart__img"]} src={imgCart} alt="Ícone Carrinho" />
</button>
</div>
</div>
</div>
);
}
export {HeaderTop};

View File

@ -0,0 +1,12 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5696_970)">
<path d="M27.823 4.07236C27.6697 3.88079 27.4377 3.76928 27.1923 3.76928H5.69581L5.09469 1.16451C5.01009 0.798054 4.68377 0.538452 4.30768 0.538452H0.80768C0.361648 0.538452 0 0.9001 0 1.34619C0 1.79227 0.361648 2.15387 0.80768 2.15387H3.66516L7.7455 19.8355C7.83005 20.2019 8.15642 20.4615 8.53251 20.4615H24.7154C25.1614 20.4615 25.523 20.0999 25.523 19.6539C25.523 19.2078 25.1614 18.8462 24.7154 18.8462H9.17509L8.55384 16.1539H24.7693C25.1471 16.1539 25.4744 15.892 25.5573 15.5235L27.9803 4.75426C28.0342 4.51483 27.9763 4.26398 27.823 4.07236Z" fill="white"/>
<path d="M11.8462 21.5385C10.2132 21.5385 8.88464 22.867 8.88464 24.5C8.88464 26.133 10.2132 27.4615 11.8462 27.4615C13.4792 27.4615 14.8077 26.133 14.8077 24.5C14.8077 22.867 13.4792 21.5385 11.8462 21.5385Z" fill="white"/>
<path d="M21.5385 21.5385C19.9055 21.5385 18.5769 22.867 18.5769 24.5C18.5769 26.133 19.9054 27.4615 21.5385 27.4615C23.1714 27.4615 24.5 26.133 24.5 24.5C24.5 22.867 23.1715 21.5385 21.5385 21.5385Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_5696_970">
<rect width="28" height="28" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,5 @@
<svg width="28" height="23" viewBox="0 0 28 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26.25 19.0001H1.75002C0.783509 19.0001 0 19.7836 0 20.7501C0 21.7166 0.783508 22.5001 1.75002 22.5001H26.25C27.2165 22.5001 28 21.7166 28 20.7501C28 19.7836 27.2165 19.0001 26.25 19.0001Z" fill="white"/>
<path d="M26.25 9.5H1.75002C0.783509 9.5 0 10.2835 0 11.25C0 12.2165 0.783508 13 1.75002 13H26.25C27.2165 13 28 12.2165 28 11.25C28 10.2835 27.2165 9.5 26.25 9.5Z" fill="white"/>
<path d="M26.25 0H1.75002C0.783509 0 0 0.783509 0 1.75002C0 2.71652 0.783508 3.50003 1.75002 3.50003H26.25C27.2165 3.50003 28 2.71652 28 1.75002C28 0.783509 27.2165 0 26.25 0Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,10 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5696_966)">
<path d="M13.2094 11.6186C14.0951 10.409 14.6249 8.92328 14.6249 7.31261C14.6249 3.28064 11.3444 0.00012207 7.31245 0.00012207C3.28048 0.00012207 0 3.28064 0 7.31261C0 11.3446 3.28052 14.6251 7.31248 14.6251C8.92315 14.6251 10.409 14.0952 11.6186 13.2094L16.4092 18L18 16.4092C18 16.4092 13.2094 11.6186 13.2094 11.6186ZM7.31248 12.3751C4.52086 12.3751 2.25001 10.1042 2.25001 7.31261C2.25001 4.52098 4.52086 2.25013 7.31248 2.25013C10.1041 2.25013 12.375 4.52098 12.375 7.31261C12.375 10.1042 10.1041 12.3751 7.31248 12.3751Z" fill="#303030"/>
</g>
<defs>
<clipPath id="clip0_5696_966">
<rect width="18" height="18" rx="5" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 799 B

View File

@ -0,0 +1,14 @@
@use '../variables';
.header {
background-color: variables.$black;
height: 120px;
@media (min-width: 3600px) {
height: 182px;
}
@media ((min-width: 2500px) and (max-width: 3599px)) {
height: 162px;
}
}

View File

@ -1,11 +1,19 @@
import React from 'react';
import styles from "./Home.module.scss";
import { HeaderTop } from '../components/HeaderTop/HeaderTop';
const Home = () => {
return (
<>
<header></header>
<header className={styles["header"]}>
<HeaderTop />
</header>
<main></main>
<footer></footer>
</>
);