diff --git a/src/components/HeaderBottom/HeaderBottom.module.scss b/src/components/HeaderBottom/HeaderBottom.module.scss new file mode 100644 index 0000000..b6bb0e5 --- /dev/null +++ b/src/components/HeaderBottom/HeaderBottom.module.scss @@ -0,0 +1,7 @@ +@use '../../variables'; + +.header-bottom { + @media (max-width: 1024px) { + display: none; + } +} diff --git a/src/components/HeaderBottom/HeaderBottom.tsx b/src/components/HeaderBottom/HeaderBottom.tsx new file mode 100644 index 0000000..7984c44 --- /dev/null +++ b/src/components/HeaderBottom/HeaderBottom.tsx @@ -0,0 +1,16 @@ +import React from 'react'; + +import styles from "./HeaderBottom.module.scss"; + +import { HeaderNavBar } from '../HeaderNavBar/HeaderNavBar'; + +const HeaderBottom = () => { + + return ( +
+ +
+ ); +} + +export {HeaderBottom}; diff --git a/src/components/HeaderNavBar/HeaderNavBar.module.scss b/src/components/HeaderNavBar/HeaderNavBar.module.scss new file mode 100644 index 0000000..6361cc0 --- /dev/null +++ b/src/components/HeaderNavBar/HeaderNavBar.module.scss @@ -0,0 +1,43 @@ +@use '../../variables'; + +.header-nav-bar { + height: 44px; + + @media (min-width: 3600px) { + height: 70px; + } + + @media ((min-width: 2500px) and (max-width: 3599px)){ + height: 61px; + } + + @media (max-width: 1024px) { + height: 0; + } + + &__ul { + display: flex; + align-items: center; + text-transform: none; + padding: 14px 100px; + height: 44px; + gap: 55px; + + @media (min-width: 3600px) { + height: 70px; + } + + @media ((min-width: 2500px) and (max-width: 3599px)){ + height: 61px; + } + + @media (max-width: 1024px) { + flex-direction: column; + align-items: flex-start; + background-color: variables.$white; + height: 507px; + padding: 31px 16px; + gap: 0; + } + } +} diff --git a/src/components/HeaderNavBar/HeaderNavBar.tsx b/src/components/HeaderNavBar/HeaderNavBar.tsx new file mode 100644 index 0000000..54811a7 --- /dev/null +++ b/src/components/HeaderNavBar/HeaderNavBar.tsx @@ -0,0 +1,20 @@ +import React from 'react'; + +import styles from "./HeaderNavBar.module.scss"; + +import { ItemNavBar } from '../ItemNavBar/ItemNavBar'; + +const HeaderNavBar = () => { + + return ( + + ); +} + +export {HeaderNavBar}; diff --git a/src/components/HeaderTop/HeaderTop.module.scss b/src/components/HeaderTop/HeaderTop.module.scss new file mode 100644 index 0000000..6489ff8 --- /dev/null +++ b/src/components/HeaderTop/HeaderTop.module.scss @@ -0,0 +1,324 @@ +@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; + } + + @media (max-width: 1024px) { + grid-template-columns: 10% 80% 10%; + padding: 25px 16px; + height: 139px; + } + } + + &__btn-hamburger { + display: none; + + @media (max-width: 1024px) { + display: flex; + align-items: center; + background: transparent; + border: none; + grid-area: 1/1; + + &__img { + width: 100%; + max-width: 28px; + } + + &:hover { + filter: brightness(80%); + } + } + } + + &__menu-mobile { + &__active, + &__desactive { + width: 96.484375%; + height: 585px; + position: absolute; + top: 0; + left: 0; + z-index: map-get(variables.$z-index, level2); + + @media (min-width: 1025px) { + display: none; + } + + @media (max-width: 375px) { + width: 90.4%; + } + } + + &__active { + opacity: 1; + visibility: visible; + transition: all 0.5s ease; + transform: translateX(0%); + } + + &__desactive { + opacity: 0; + visibility: hidden; + transition: all 0.5s ease; + transform: translateX(-100%); + } + + &__items { + display: flex; + justify-content: space-between; + height: 78px; + padding: 31px 16px; + background-color: variables.$black; + } + + &__login{ + display: flex; + align-items: center; + font-size: 14px; + line-height: 16px; + text-transform: uppercase; + color: variables.$white; + + &:hover { + filter: brightness(80%); + } + } + + &__close-btn { + background: transparent; + border: none; + + &__img { + width: 100%; + max-width: 15px; + } + + &:hover { + filter: brightness(80%); + } + } + } + + &__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; + + @media (max-width: 1024px) { + grid-area: 2 / 1 / 2 / 4; + } + + &__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; + } + + @media (max-width: 1024px) { + min-width: 100%; + margin-top: 25px; + height: 36px; + } + + &::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; + } + + @media (max-width: 1024px) { + top: 34px; + } + + &__img { + + @media (min-width: 2500px) { + width: 100%; + min-width: 35px; + } + } + } + } + + &__menu { + display: flex; + align-items: center; + justify-content: right; + gap: 55px; + + @media (max-width: 1024px) { + grid-area: 1/3; + gap: 0; + } + + &__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; + } + + @media (max-width: 1024px) { + display: none; + } + } + + &__btn-cart { + background: transparent; + border: none; + + &:hover { + filter: brightness(80%); + } + + &__img { + width: 100%; + max-width: 28px; + + @media (min-width: 2500px) { + min-width: 54px; + } + } + } + } + + &__overlay { + display: block; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: variables.$shadow2; + z-index: map-get(variables.$z-index, level1); + transition: all 0.5s ease-in-out; + + @media (min-width: 1025px) { + display: none; + } + } + + &__overlay-close { + display: none; + } +} diff --git a/src/components/HeaderTop/HeaderTop.tsx b/src/components/HeaderTop/HeaderTop.tsx new file mode 100644 index 0000000..5425f0d --- /dev/null +++ b/src/components/HeaderTop/HeaderTop.tsx @@ -0,0 +1,107 @@ +import { useState, useEffect, useRef } 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"; +import imgHamburgerBtn from "./assets/hamburger-menu-btn-icon.svg"; +import imgCloseBtn from "./assets/close-menu-btn-icon.svg"; + +import { HeaderNavBar } from '../HeaderNavBar/HeaderNavBar'; + +const HeaderTop = () => { + + const [open, setOpen] = useState(false); + + const handleOpen = () => setOpen(true); + const handleClose = () => setOpen(false); + + let menuRef:any= useRef(); + + useEffect(() => { + let handler = (e:any) => { + if (!menuRef.current.contains(e.target)) { + setOpen(false) + } + }; + + document.addEventListener("mousedown", handler); + }); + + //-------------------------------------------------------- + + const [search, setSearch] = useState(""); + + const handleSearch = (target:any) => { + setSearch(target.value); + } + + const cleanSearch = () => setSearch(''); + + return ( +
+
+ + + +
+ +
+ + Entrar + + + +
+ + +
+ + + + Logo M3 Academy + + + +
+ + + +
+ +
+ + Entrar + + + +
+
+ +
+
+ +
+ ); +} + +export {HeaderTop}; diff --git a/src/components/HeaderTop/assets/cart.svg b/src/components/HeaderTop/assets/cart.svg new file mode 100644 index 0000000..78ac70f --- /dev/null +++ b/src/components/HeaderTop/assets/cart.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/components/HeaderTop/assets/close-menu-btn-icon.svg b/src/components/HeaderTop/assets/close-menu-btn-icon.svg new file mode 100644 index 0000000..e0e6d36 --- /dev/null +++ b/src/components/HeaderTop/assets/close-menu-btn-icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/HeaderTop/assets/hamburger-menu-btn-icon.svg b/src/components/HeaderTop/assets/hamburger-menu-btn-icon.svg new file mode 100644 index 0000000..6cadeb3 --- /dev/null +++ b/src/components/HeaderTop/assets/hamburger-menu-btn-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/HeaderTop/assets/logo-m3academy.png b/src/components/HeaderTop/assets/logo-m3academy.png new file mode 100644 index 0000000..7f6b6ad Binary files /dev/null and b/src/components/HeaderTop/assets/logo-m3academy.png differ diff --git a/src/components/HeaderTop/assets/search.svg b/src/components/HeaderTop/assets/search.svg new file mode 100644 index 0000000..6619486 --- /dev/null +++ b/src/components/HeaderTop/assets/search.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/components/ItemNavBar/ItemNavBar.module.scss b/src/components/ItemNavBar/ItemNavBar.module.scss new file mode 100644 index 0000000..1f5b977 --- /dev/null +++ b/src/components/ItemNavBar/ItemNavBar.module.scss @@ -0,0 +1,29 @@ +@use '../../variables'; + +.nav-bar__item { + font-weight: 500; + font-size: 14px; + line-height: 16px; + text-transform: uppercase; + color: variables.$white; + cursor: pointer; + + @media (min-width: 3600px) { + font-size: 32px; + line-height: 38px; + } + + @media ((min-width: 2500px) and (max-width: 3599px)) { + font-size: 28px; + line-height: 33px; + } + + @media (max-width: 1024px) { + color: variables.$gray-400; + margin-bottom: 12px; + } + + &:hover { + filter: brightness(80%); + } +} diff --git a/src/components/ItemNavBar/ItemNavBar.tsx b/src/components/ItemNavBar/ItemNavBar.tsx new file mode 100644 index 0000000..7d37cf7 --- /dev/null +++ b/src/components/ItemNavBar/ItemNavBar.tsx @@ -0,0 +1,10 @@ +import React from 'react'; + +import styles from "./ItemNavBar.module.scss"; + +const ItemNavBar = ( props:any) => { + const { text } = props; + return
  • { text }
  • ; +}; + +export { ItemNavBar }; diff --git a/src/pages/Home.module.scss b/src/pages/Home.module.scss new file mode 100644 index 0000000..0e249ac --- /dev/null +++ b/src/pages/Home.module.scss @@ -0,0 +1,18 @@ +@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; + } + + @media (max-width: 1024px) { + height: 139px; + } +} \ No newline at end of file diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index cd6761d..4ef54c4 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,11 +1,21 @@ import React from 'react'; +import styles from "./Home.module.scss"; + +import { HeaderTop } from '../components/HeaderTop/HeaderTop'; +import { HeaderBottom } from '../components/HeaderBottom/HeaderBottom'; + const Home = () => { return ( <> -
    +
    + + +
    +
    + );