Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mobile #8

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions client/src/components/menuHamburguer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React, { useState } from 'react';
import { MenuWrapper, HamburguerButton, MenuItems, MenuItem } from './styles';

export const HamburguerMenu = () => {
const [isOpen, setIsOpen] = useState(false);

const toggleMenu = () => {
setIsOpen(!isOpen);
};

return (
<MenuWrapper>
<HamburguerButton onClick={toggleMenu}>
<span></span>
<span></span>
<span></span>
</HamburguerButton>
{isOpen && (
<MenuItems>
<MenuItem><a href='#'>Home</a></MenuItem>
<MenuItem><a href='#'>Benefícios</a></MenuItem>
<MenuItem><a href='#'>Contato</a></MenuItem>
</MenuItems>
)}
</MenuWrapper>
);
};
60 changes: 60 additions & 0 deletions client/src/components/menuHamburguer/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import styled from 'styled-components';

export const MenuWrapper = styled.div`
position: absolute;
display: block;
margin-left: 730px;
margin-top: -80px;

/* Responsividade menu hamburguer */
@media (min-width: 780px){
display: none;
}

@media (max-width: 800px){
margin-left: 630px;
}

@media (max-width: 700px){
margin-left: 530px;
}

@media (max-width: 600px){
margin-left: 430px;
}

@media (max-width: 500px){
margin-left: 370px;
}
`;

export const HamburguerButton = styled.div`
display: flex;
flex-direction: column;
justify-content: space-between;
width: 38px;
height: 28px;
cursor: pointer;
border: 1px solid #FFF;
padding: 5px;
border-radius: 5px;

span {
width: 100%;
height: 2px;
background-color: #FFF;
}
`;

export const MenuItems = styled.ul`
position: absolute;
padding: 20px;
list-style: none;
margin-left: -90px;
text-align: center;
background-color: red;
`;

export const MenuItem = styled.li`
margin-bottom: 20px;
`;
18 changes: 9 additions & 9 deletions client/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import React from "react";
import { HomeContainer } from './styles';
import { HomeContainer, HomeSection, Overlay, BlockContent, Content, BlueLine } from './styles';
import { Button } from "../../components";
import { Navbar } from "../navbar";

export const Home: React.FC = () => {
return (
<HomeContainer>
<Navbar />
<section className="home-section">
<div className="overlay">
<div className="content">
<h2>Personalize sua <br /> casa nova sem dor <br />de cabeça</h2>
<HomeSection>
<Overlay>
<BlockContent>
<Content>Personalize sua <br /> casa nova sem dor <br />de cabeça</Content>
<Button />
</div>
</div>
</section>
<span className="highlight-line" />
</BlockContent>
</Overlay>
</HomeSection>
<BlueLine />
</HomeContainer>
);
}
139 changes: 104 additions & 35 deletions client/src/pages/home/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,110 @@ export const HomeContainer = styled.div`

background-image: url(${(props) => props.theme.backgroundImage.background});
background-size: cover;
}
`;

.home-section {
position: relative;
height: 100vh;
margin-left: 146px;
}

.overlay {
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: left;
}

.content {
text-align: left;
color: #fff;
line-height: 85px;
letter-spacing: 1.5px;
}

.content h2 {
font-size: 68px;
}

.highlight-line {
position: absolute;
left: 0;
width: 37%;
height: 4px;
background-color: #1A0289;
margin-top: -460px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.25);
}
export const HomeSection = styled.section`
position: relative;
height: 100vh;
margin-left: 146px;

/* Responsividade Home */
@media (min-width: 1140px) and (max-width: 1260px) {
margin-left: 125px;
}

@media (min-width: 1020px) and (max-width: 1140px) {
margin-left: 115px;
}

@media (min-width: 900px) and (max-width: 1020px) {
margin-left: 105px;
}

@media (min-width: 780px) and (max-width: 900px) {
margin-left: 100px;
}

@media (min-width: 660px) and (max-width: 780px) {
margin-left: 100px;
}

@media (min-width: 540px) and (max-width: 660px) {
margin-left: 100px;
}

@media (min-width: 420px) and (max-width: 540px) {
margin-left: 90px;
}
`;

export const Overlay = styled.div`
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: left;
`;

export const BlockContent = styled.section`
text-align: left;
color: #fff;
line-height: 85px;
letter-spacing: 1.5px;

/* Responsividade Home */
@media (min-width: 420px) and (max-width: 540px) {
letter-spacing: 0px;
line-height: 69px;
}
`;

export const Content = styled.h2`
font-size: 68px;

/* Responsividade Home */
@media (min-width: 1140px) and (max-width: 1260px) {
font-size: 58px;
}

@media (min-width: 1020px) and (max-width: 1140px) {
font-size: 52px;
}

@media (min-width: 900px) and (max-width: 1020px) {
font-size: 50px;
}

@media (min-width: 780px) and (max-width: 900px) {
font-size: 48px;
}

@media (min-width: 660px) and (max-width: 780px) {
font-size: 46px;
}

@media (min-width: 540px) and (max-width: 660px) {
font-size: 44px;
}

@media (min-width: 420px) and (max-width: 540px) {
font-size: 38px;
}
`;

export const BlueLine = styled.span`
position: absolute;
left: 0;
width: 37%;
height: 4px;
background-color: #1A0289;
margin-top: -460px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.25);

/* Responsividade Home */
@media (max-width: 780px){
display: none;
}
`;
12 changes: 12 additions & 0 deletions client/src/pages/intro/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ export const Introimg1 = styled.img`
margin-right: 0px;
margin-bottom: 0px;
margin-top: -640px;

@media (max-width: 1260px) {
display: none;
}

@media (min-width: 1260px) and (max-width:1350px) {
margin-left: 400px;
}

@media (min-width: 1350px) {
margin-right: 30px;
}
`;

export const Introa = styled.a`
Expand Down
30 changes: 18 additions & 12 deletions client/src/pages/navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
import React from "react";
import { NavbarContainer } from './styles';
import { NavbarContainer, Logo, SecondContainer, ListItem, List } from './styles';
import { LogoMeuApe } from '../../assets';

import { useState } from "react";
import { HamburguerMenu } from "../../components/menuHamburguer";

export const Navbar: React.FC = () => {
const [active, setMode] = useState(false)
const ToggleMode = () => {
setMode(!active)
}
return (
<NavbarContainer>
<nav>
<div id="logo">
<SecondContainer>
<Logo>
<a href="#">
<img src={LogoMeuApe} alt="Logo principal" />
</a>
</div>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Quem somos</a></li>
<li><a href="#">Benefícios</a></li>
<li><a href="#">Contato</a></li>
</ul>
</nav>
</Logo>
<List>
<ListItem><a href="#">Home</a></ListItem>
<ListItem><a href="#">Quem somos</a></ListItem>
<ListItem><a href="#">Benefícios</a></ListItem>
<ListItem><a href="#">Contato</a></ListItem>
</List>
<HamburguerMenu />
</SecondContainer>
</NavbarContainer>
);
}
Loading