From dc6b02c8172dc11995c0406564819a07e900aa02 Mon Sep 17 00:00:00 2001 From: Thiago Bronisio <86695254+ThiagoBronisio@users.noreply.github.com> Date: Thu, 5 Jan 2023 23:23:44 -0300 Subject: [PATCH] feat: adiciona o html estatico do header mobile --- src/assets/img/close.svg | 4 ++ src/assets/img/hamburguer.svg | 5 ++ src/components/Header/Header.module.scss | 56 ++++++++++++++----- src/components/Header/Header.tsx | 25 ++++++--- .../InputMenuMobile/InputMenuMobile.tsx | 27 +++++++++ .../inputMenuMobile.module.scss | 47 ++++++++++++++++ .../MenuHamburguer/MenuHamburguer.module.scss | 18 ++++++ .../Header/MenuHamburguer/MenuHamburguer.tsx | 50 +++++++++++++++++ src/global.scss | 1 + 9 files changed, 211 insertions(+), 22 deletions(-) create mode 100644 src/assets/img/close.svg create mode 100644 src/assets/img/hamburguer.svg create mode 100644 src/components/Header/InputMenuMobile/InputMenuMobile.tsx create mode 100644 src/components/Header/InputMenuMobile/inputMenuMobile.module.scss create mode 100644 src/components/Header/MenuHamburguer/MenuHamburguer.module.scss create mode 100644 src/components/Header/MenuHamburguer/MenuHamburguer.tsx diff --git a/src/assets/img/close.svg b/src/assets/img/close.svg new file mode 100644 index 0000000..e0e6d36 --- /dev/null +++ b/src/assets/img/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/img/hamburguer.svg b/src/assets/img/hamburguer.svg new file mode 100644 index 0000000..6cadeb3 --- /dev/null +++ b/src/assets/img/hamburguer.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/Header/Header.module.scss b/src/components/Header/Header.module.scss index e3f2622..6dbe7a1 100644 --- a/src/components/Header/Header.module.scss +++ b/src/components/Header/Header.module.scss @@ -1,5 +1,5 @@ -.container-header { - .header-wrapper { +.container { + &__wrapper { display: flex; align-items: center; justify-content: space-between; @@ -7,12 +7,17 @@ background-color: var(--black); border-bottom: 1px solid var(--gray-100); + @media (max-width: 1024px) { + border: none; + padding: 25px 16px; + } + &__container-logo { - width: 12.597%; + width: 136px; height: 25.86px; - @media screen and (min-width: 2500px) { - width: 11.55%; + @media (min-width: 2500px) { + width: 265.62px; height: 50.5px; } @@ -22,7 +27,7 @@ .logo-m3 { width: 100%; - @media screen and (min-width: 2500px) { + @media (min-width: 2500px) { height: 50.5px; } } @@ -32,8 +37,11 @@ &__container-input-busca { position: relative; width: 24.452%; + @media (max-width: 1024px) { + display: none; + } - @media screen and (min-width: 2500px) { + @media (min-width: 2500px) { width: 22.421%; } @@ -52,7 +60,7 @@ //font-family: roboto; - @media screen and (min-width: 2500px) { + @media (min-width: 2500px) { height: 57px; font-weight: 400; @@ -75,7 +83,11 @@ right: 17px; cursor: pointer; - @media screen and (min-width: 2500px) { + @media (max-width: 1025px) { + display: none; + } + + @media (min-width: 2500px) { width: 35.15px; height: 35.15px; top: 10px; @@ -85,7 +97,8 @@ img { height: 18px; width: 18px; - @media screen and (min-width: 2500px) { + color: var(--black-200); + @media (min-width: 2500px) { width: 35.15px; height: 35.15px; } @@ -107,21 +120,31 @@ font-family: var(--font-roboto); cursor: pointer; - @media screen and (min-width: 2500px) { + @media (max-width: 1024px) { + display: none; + } + + @media (min-width: 2500px) { font-weight: 400; font-size: 28px; line-height: 33px; } } - img { + button { + background: transparent; + border: none; width: 28px; height: 28px; - @media screen and (min-width: 2500px) { + @media (min-width: 2500px) { width: 54.68px; height: 54.68px; } + + img { + width: 100%; + } } } } @@ -129,6 +152,9 @@ .container-nav { background-color: var(--black); padding: 14px 100.32px 14px 100px; + @media (max-width: 1025px) { + display: none; + } ul { display: flex; @@ -141,7 +167,7 @@ color: var(--white); font-family: var(--font-roboto); - @media screen and (min-width: 2500px) { + @media (min-width: 2500px) { font-weight: 500; font-size: 28px; line-height: 33px; @@ -156,7 +182,7 @@ li:nth-child(2) { margin: 0 55px; - @media screen and (min-width: 2500px) { + @media (min-width: 2500px) { margin: 0 55.92px 0 55.71px; } } diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 07b9587..0c8b70a 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -1,4 +1,7 @@ import React from "react"; +import { InputMenuMobile } from "./InputMenuMobile/InputMenuMobile" +import { MenuHamburguer } from "./MenuHamburguer/MenuHamburguer" + import styleHeader from "./Header.module.scss" import logo from "../../assets/img/logo-m3.png" @@ -8,17 +11,21 @@ import search from "../../assets/img/search.svg" export function Header() { - return ( - - - + return ( + + + + + + + - + @@ -28,13 +35,17 @@ export function Header() { - + ENTRAR - + + + + + CURSOS diff --git a/src/components/Header/InputMenuMobile/InputMenuMobile.tsx b/src/components/Header/InputMenuMobile/InputMenuMobile.tsx new file mode 100644 index 0000000..11ed94a --- /dev/null +++ b/src/components/Header/InputMenuMobile/InputMenuMobile.tsx @@ -0,0 +1,27 @@ +import React from "react"; +import styleInput from "./inputMenuMobile.module.scss" + +import search from "../../../assets/img/search.svg" + +export const InputMenuMobile = () => { + return ( + + + + + + + + + + ) +} + +export default InputMenuMobile; \ No newline at end of file diff --git a/src/components/Header/InputMenuMobile/inputMenuMobile.module.scss b/src/components/Header/InputMenuMobile/inputMenuMobile.module.scss new file mode 100644 index 0000000..e420a5a --- /dev/null +++ b/src/components/Header/InputMenuMobile/inputMenuMobile.module.scss @@ -0,0 +1,47 @@ +.container { + &__form-input-button { + background: var(--black); + position: relative; + padding: 0 16px 25px; + display: flex; + + @media (min-width: 1025px) { + display: none; + } + + &__input { + width: 100%; + height: 36px; + border: 2px solid var(--white-100); + border-radius: 5px; + padding: 10px 40px 10px 16px; + + font-weight: 400; + font-size: 14px; + line-height: 16px; + font-family: var(--font-roboto); + + &::placeholder { + color: var(--gray-100); + } + } + + &__button { + position: absolute; + z-index: 10; + border: none; + background: transparent; + outline: none; + top: 8px; + right: 30px; + width: 18px; + height: 18px; + + img { + width: 18px; + height: 18px; + color: var(--black-200); + } + } + } +} diff --git a/src/components/Header/MenuHamburguer/MenuHamburguer.module.scss b/src/components/Header/MenuHamburguer/MenuHamburguer.module.scss new file mode 100644 index 0000000..60ff545 --- /dev/null +++ b/src/components/Header/MenuHamburguer/MenuHamburguer.module.scss @@ -0,0 +1,18 @@ +.container { + &__wrapper { + &__btnHamburguer { + @media (min-width: 1025px) { + display: none; + } + button { + background: transparent; + border: none; + + img { + width: 28px; + height: 22.5px; + } + } + } + } +} diff --git a/src/components/Header/MenuHamburguer/MenuHamburguer.tsx b/src/components/Header/MenuHamburguer/MenuHamburguer.tsx new file mode 100644 index 0000000..979c464 --- /dev/null +++ b/src/components/Header/MenuHamburguer/MenuHamburguer.tsx @@ -0,0 +1,50 @@ +import React, { useState } from "react"; +import styleMenu from "./MenuHamburguer.module.scss" + +import hamburguer from "../../../assets/img/hamburguer.svg" +import closeMenu from "../../../assets/img/close.svg" + +export const MenuHamburguer = () => { + + const [menuOpen, setMenuOpen] = useState(false); + + const handleMenuHamburguer = (state: boolean) => { + setMenuOpen(!state) + + }; + + return ( + <> + + + handleMenuHamburguer(menuOpen)}> + + + + + + {menuOpen && + <> + + Entrar + + + + + + + + Cursos + Saiba mais + Institucionais + + + + > + } + + > + ) +} + +export default MenuHamburguer; \ No newline at end of file diff --git a/src/global.scss b/src/global.scss index 296b4ca..20560f4 100644 --- a/src/global.scss +++ b/src/global.scss @@ -4,6 +4,7 @@ --black: #000000; --black-100: #303030; + --black-200: #292929; --white: #ffffff; --white-100: #f0f0f0;
ENTRAR