feature/header #1

Merged
YahToth merged 4 commits from feature/header into main 2023-01-20 20:43:39 +00:00
22 changed files with 38835 additions and 0 deletions

23
desafio-react-e-typescript/.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@ -0,0 +1,46 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

28815
desafio-react-e-typescript/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
{
"name": "desafio-react-e-typescript",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.11",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"sass": "^1.57.1",
"typescript": "^4.9.4",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Desafio 05</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,12 @@
<svg width="55" height="55" viewBox="0 0 55 55" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_3751_539)">
<path d="M54.3344 7.95273C54.0351 7.57862 53.5819 7.36086 53.1027 7.36086H11.1231L9.9492 2.27412C9.78398 1.55848 9.14672 1.05151 8.41228 1.05151H1.57728C0.706248 1.05151 0 1.75776 0 2.6289C0 3.50004 0.706248 4.20619 1.57728 4.20619H7.15753L15.1259 38.7358C15.291 39.4515 15.9283 39.9585 16.6628 39.9585H48.2656C49.1367 39.9585 49.8428 39.2522 49.8428 38.3812C49.8428 37.51 49.1366 36.8039 48.2656 36.8039H17.9176L16.7044 31.5462H48.3709C49.1086 31.5462 49.7478 31.0348 49.9097 30.3151L54.6416 9.28438C54.7467 8.81682 54.6338 8.32694 54.3344 7.95273Z" fill="white"/>
<path d="M23.1338 42.0615C19.9449 42.0615 17.3503 44.6559 17.3503 47.845C17.3503 51.0341 19.9448 53.6285 23.1338 53.6285C26.3228 53.6285 28.9173 51.0341 28.9173 47.845C28.9173 44.6559 26.3229 42.0615 23.1338 42.0615Z" fill="white"/>
<path d="M42.0614 42.0615C38.8725 42.0615 36.278 44.6559 36.278 47.845C36.278 51.0341 38.8724 53.6285 42.0614 53.6285C45.2504 53.6285 47.8449 51.0341 47.8449 47.845C47.8449 44.6559 45.2505 42.0615 42.0614 42.0615Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_3751_539">
<rect width="54.68" height="54.68" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,4 @@
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.2284 1.28215L1.22996 10.9942C0.550673 11.6541 0.568968 12.7044 1.27083 13.3401C1.97268 13.9759 3.09232 13.9564 3.77161 13.2966L13.77 3.58449C14.4493 2.92466 14.431 1.87436 13.7292 1.23858C13.0273 0.602806 11.9077 0.622311 11.2284 1.28215Z" fill="white"/>
<path d="M1.65213 3.40819L10.8751 13.7186C11.5082 14.4263 12.6262 14.5239 13.3724 13.9366C14.1185 13.3493 14.2102 12.2995 13.5771 11.5918L4.35414 1.28143C3.72107 0.573715 2.603 0.476092 1.85686 1.06338C1.11072 1.65067 1.01906 2.70048 1.65213 3.40819Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 638 B

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

View File

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.2094 11.6187C14.0951 10.4091 14.6249 8.92334 14.6249 7.31267C14.6249 3.2807 11.3444 0.000183105 7.31245 0.000183105C3.28048 0.000183105 0 3.2807 0 7.31267C0 11.3446 3.28052 14.6252 7.31248 14.6252C8.92315 14.6252 10.409 14.0953 11.6186 13.2095L16.4092 18.0001L18 16.4093C18 16.4092 13.2094 11.6187 13.2094 11.6187V11.6187ZM7.31248 12.3751C4.52086 12.3751 2.25001 10.1043 2.25001 7.31267C2.25001 4.52104 4.52086 2.25019 7.31248 2.25019C10.1041 2.25019 12.375 4.52104 12.375 7.31267C12.375 10.1043 10.1041 12.3751 7.31248 12.3751Z" fill="#303030"/>
</svg>

After

Width:  |  Height:  |  Size: 663 B

View File

@ -0,0 +1,3 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M25.7949 22.6886C27.5246 20.3265 28.5592 17.4252 28.5592 14.2799C28.5592 6.40637 22.1531 0.000244141 14.2796 0.000244141C6.40606 0.000244141 0 6.40637 0 14.2799C0 22.1534 6.40613 28.5596 14.2797 28.5596C17.4249 28.5596 20.3266 27.5248 22.6886 25.7951L32.0435 35.15L35.15 32.0436C35.15 32.0435 25.7949 22.6886 25.7949 22.6886ZM14.2797 24.1658C8.82824 24.1658 4.39377 19.7313 4.39377 14.2799C4.39377 8.82848 8.82824 4.39401 14.2797 4.39401C19.7311 4.39401 24.1655 8.82848 24.1655 14.2799C24.1655 19.7313 19.731 24.1658 14.2797 24.1658Z" fill="#292929"/>
</svg>

After

Width:  |  Height:  |  Size: 664 B

View File

@ -0,0 +1,170 @@
.container-top {
display: flex;
align-items: center;
justify-content: space-between;
background-color: black;
width: 100%;
height: 76px;
padding: 24px 100px;
@media screen and (min-width: 2500px) {
width: 100%;
max-width: unset;
height: 101px;
}
@media screen and (max-width: 1024px) {
display: none;
}
.container-logo {
button {
background: transparent;
}
.academy-logo {
width: 100%;
max-width: 136px;
height: 26px;
cursor: pointer;
@media screen and (min-width: 2500px) {
width: 100%;
max-width: unset;
height: unset;
}
}
}
}
.container-input {
width: 100%;
max-width: 264px;
display: flex;
position: relative;
@media screen and (min-width: 2500px) {
width: 100%;
max-width: 515px;
}
input {
width: 100%;
height: 32px;
border: 2px solid #f2f2f2;
border-radius: 5px;
padding: 8px 10px 8px 16px;
@media screen and (min-width: 2500px) {
padding-top: 20px;
height: 58px;
}
&::placeholder {
color: #c6c6c6;
@media screen and (min-width: 2500px) {
font-size: 28px;
line-height: 33px;
}
}
}
button {
position: absolute;
outline: 0;
width: 18px;
height: 18px;
right: 0;
background-color: transparent;
background-image: url(../../assets/images/searchicon.svg);
background-repeat: no-repeat;
margin: 8px 10px 8px 16px;
cursor: pointer;
@media screen and (min-width: 2500px) {
width: 35px;
height: 35px;
margin: 11px 16px 11px 16px;
background-image: url(../../assets/images/searchicon4k.svg);
}
}
}
.container-login-carrinho {
display: flex;
justify-content: center;
align-items: center;
button {
background-color: transparent;
}
a {
font-family: "Roboto", sans-serif;
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
text-decoration: none;
color: #fff;
margin-right: 55px;
@media screen and (min-width: 2500px) {
font-size: 28px;
line-height: 33px;
}
}
.carticon {
width: 100%;
max-width: 28px;
height: 28px;
cursor: pointer;
@media screen and (min-width: 2500px) {
width: 100%;
max-width: 54px;
height: 54px;
}
}
}
.container-bottom {
display: flex;
align-items: center;
background-color: black;
border-top: 1px solid #c4c4c4;
width: 100%;
height: 44px;
@media screen and (min-width: 2500px) {
width: 100%;
max-width: unset;
height: 61px;
}
@media screen and (max-width: 1024px) {
display: none;
}
.container-bottom-menu {
width: 100%;
margin-left: 100px;
a {
text-decoration: none;
color: #fff;
font-family: "Roboto", sans-serif;
font-weight: 500;
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
margin-right: 55px;
@media screen and (min-width: 2500px) {
font-weight: 500;
font-size: 28px;
line-height: 33px;
}
}
}
}

View File

@ -0,0 +1,59 @@
import React from "react";
import logo from "../../assets/images/Logo-M3Academy 1.svg";
import cart from "../../assets/images/carticon.svg";
import { MenuHamb } from "../MenuHamburguer/MenuHamb";
import styles from "./Header.module.scss";
const Header = () => {
return (
<header id="header">
<MenuHamb />
<div className={styles["container-top"]}>
<div className={styles["container-logo"]}>
<button>
<img
src={logo}
alt="Academy-Logo"
className={styles["academy-logo"]}
/>
</button>
</div>
<div className={styles["container-input"]}>
<input
type="text"
className={styles["input-busca"]}
placeholder="Buscar..."
/>
<button className={styles["search-button"]}></button>
</div>
<div className={styles["container-login-carrinho"]}>
<a href="/" className={styles["login"]}>
Entrar
</a>
<button>
<img src={cart} alt="cart-icon" className={styles["carticon"]} />
</button>
</div>
</div>
<div className={styles["container-bottom"]}>
<div className={styles["container-bottom-menu"]}>
<a href="/" className={styles["menu-text"]}>
Cursos
</a>
<a href="/" className={styles["menu-text"]}>
Saiba Mais
</a>
<a href="/" className={styles["menu-text"]}>
Institucionais
</a>
</div>
</div>
</header>
);
};
export { Header };

View File

@ -0,0 +1,147 @@
.container-menu {
width: 100%;
height: 140px;
background-color: black;
@media screen and (min-width: 1025px) {
display: none;
}
button {
background-color: black;
border: none;
padding: unset;
cursor: pointer;
}
.container-menu-top {
display: flex;
padding: 25px 16px 25px 16px;
width: 100%;
max-width: 1024px;
.container-menu-top-icons {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.academy-logo {
width: 100%;
max-width: 136px;
}
.carticon {
width: 100%;
max-width: 28px;
height: 28px;
}
}
}
.container-input {
width: 100%;
display: flex;
padding: 0 16px;
position: relative;
.input-busca {
width: 100%;
height: 36px;
border: 2px solid #f2f2f2;
border-radius: 5px;
padding: 8px 10px 8px 16px;
&::placeholder {
font-size: 14px;
line-height: 16px;
color: #c6c6c6;
}
}
button {
position: absolute;
outline: 0;
width: 18px;
height: 18px;
right: 16px;
background-color: transparent;
background-image: url(../../assets/images/searchicon.svg);
background-repeat: no-repeat;
margin: 9px 16px 9px 16px;
cursor: pointer;
}
}
.container-menu-bottom {
width: 100%;
max-width: 988px;
max-height: 0px;
margin-top: 18px;
transform: translateY(-100%);
left: -100%;
.container-menu-bottom-buttons,
.menu-nav {
display: none;
}
}
.container-menu-bottomActive {
width: 100%;
max-width: 1024px;
max-height: 585px;
position: fixed;
top: 0;
z-index: 50;
transition: left 300ms ease-in;
padding-right: 36px;
left: 0;
.container-menu-bottom-buttons {
display: flex;
justify-content: space-between;
height: 78px;
background-color: black;
padding: 31px 16px 31px 16px;
}
.login {
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
text-decoration: none;
color: #fff;
}
.menu-nav {
display: flex;
flex-direction: column;
gap: 12px;
height: 507px;
background-color: white;
padding: 31px 16px;
border: 1px solid black;
}
.menu-text {
font-weight: 500;
font-size: 14px;
line-height: 16px;
text-transform: uppercase;
text-decoration: none;
color: #c4c4c4;
}
}
.container-overlay {
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 3;
}
}

View File

@ -0,0 +1,90 @@
import React, { useState } from "react";
import menuhambicon from "../../assets/images/menuhambicon.svg";
import logo from "../../assets/images/Logo-M3Academy 1.svg";
import cart from "../../assets/images/carticon.svg";
import close from "../../assets/images/closeicon.svg";
import styles from "./MenuHamb.module.scss";
const MenuHamb = () => {
const [active, setActive] = useState(false);
const toggleMode = () => {
setActive(!active);
};
return (
<div className={styles["container-menu"]}>
<div className={styles["container-menu-top"]}>
<div className={styles["container-menu-top-icons"]}>
<button
className={
styles[
active
? "menu-hamb-icon menu-hamb-iconActive"
: "menu-hamb-icon"
]
}
onClick={toggleMode}
>
<img src={menuhambicon} alt="menu-hamburger-icon" />
</button>
<img
src={logo}
alt="Academy-Logo"
className={styles["academy-logo"]}
/>
<button className={styles["cart-icon"]}>
<img src={cart} alt="cart-icon" className={styles["carticon"]} />
</button>
</div>
</div>
<div className={styles["container-menu-top-input"]}>
<div className={styles["container-input"]}>
<input
type="text"
className={styles["input-busca"]}
placeholder="Buscar..."
/>
<button className={styles["search-button"]}></button>
</div>
</div>
<div
className={styles[active ? "container-overlay" : ""]}
onClick={toggleMode}
></div>
<div
className={
styles[
active ? "container-menu-bottomActive" : "container-menu-bottom"
]
}
>
<div className={styles["container-menu-bottom-buttons"]}>
<a href="/" className={styles["login"]}>
Entrar
</a>
<button
className={
styles[active ? "close-icon close-iconActive" : "close-icon"]
}
onClick={toggleMode}
>
<img src={close} alt="" className={styles["closeicon"]} />
</button>
</div>
<div className={styles["menu-nav"]}>
<a href="/" className={styles["menu-text"]}>
Cursos
</a>
<a href="/" className={styles["menu-text"]}>
Saiba Mais
</a>
<a href="/" className={styles["menu-text"]}>
Institucionais
</a>
</div>
</div>
</div>
);
};
export { MenuHamb };

View File

@ -0,0 +1,27 @@
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html {
scroll-behavior: smooth;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
button {
border: none;
}

View File

@ -0,0 +1,14 @@
import React from "react";
import ReactDOM from "react-dom/client";
import "./global.css";
import { Home } from "./pages/Home";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
root.render(<Home />);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals

View File

@ -0,0 +1,13 @@
import React from "react";
import { Header } from "../components/Header/Header";
const Home = () => {
return (
<div>
<Header />
</div>
);
};
export { Home };

View File

@ -0,0 +1 @@
/// <reference types="react-scripts" />

View File

@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}

File diff suppressed because it is too large Load Diff