Skip to content

Commit

Permalink
feat: add v2 da tela home mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
aridsm committed Aug 13, 2023
1 parent 4aa0157 commit c9dd212
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 36 deletions.
1 change: 1 addition & 0 deletions src/assets/imgs/pattern.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/General/CartNavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const CartNavLink: React.FC = () => {
return (
<NavLink to="/cart" className="flex items-center gap-2" title="Carrinho">
<FontAwesomeIcon icon={faCartShopping} />
<div className="bg-neutral-200/[.5] text-neutral-500 text-base rounded-sm px-2">
<div className="bg-neutral-200/[.3] text-base rounded-sm px-2">
{cart.totalItems}
</div>
</NavLink>
Expand Down
19 changes: 19 additions & 0 deletions src/routes/pages/Home/Home.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.listPayments li {
@apply flex items-center gap-2;
}

.imgsOptions img {
@apply w-12 h-12 xl:w-16 xl:h-16 rounded-full border-[5px] border-white-beige;
}

.imgsOptions img + img {
@apply -ml-6;
}

.imgsOptions p {
@apply ml-6;
}

.container {
background-image: url("../../../assets/imgs/pattern.svg");
}
74 changes: 39 additions & 35 deletions src/routes/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,51 @@ import ArcSvg from "../../../assets/imgs/arc.tsx";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faGithub } from "@fortawesome/free-brands-svg-icons";
import SubHeaderTop from "../../../components/General/SubHeaderTop.tsx";
import HomeMobile from "./HomeMobile.tsx";

const Home: React.FC = () => {
return (
<div className="flex flex-col xl:flex-row h-full w-full">
<SubHeaderTop className="block xl:hidden" />
<div className={`hidden xl:block bg-red-theme w-[47%] relative`}>
<img
src={imgHome}
className="w-full h-full absolute top-0 left-0 object-cover mix-blend-luminosity opacity-[.15]"
/>
<p className="z-20 relative text-white-beige text-[2.8rem] p-12 pb-4 leading-[160%] font-bold">
Nunc hendrerit magna sit amet justo
</p>
<p className="text-white-beige px-12 z-20 relative">
Praesent vitae pellentesque augue
</p>
<span className="text-white-beige z-20 absolute bottom-8 left-8 text-base flex">
Feito por
<a
href="https://github.com/aridsm"
target="_blank"
className="xl:ml-1"
>
Ariane Morelato <FontAwesomeIcon icon={faGithub} />
</a>
</span>
<>
<div className="hidden xl:flex flex-col xl:flex-row h-full w-full">
<SubHeaderTop className="block xl:hidden" />
<div className={`hidden xl:block bg-red-theme w-[47%] relative`}>
<img
src={imgHome}
className="w-full h-full absolute top-0 left-0 object-cover mix-blend-luminosity opacity-[.15]"
/>
<p className="z-20 relative text-white-beige text-[2.8rem] p-12 pb-4 leading-[160%] font-bold">
Nunc hendrerit magna sit amet justo
</p>
<p className="text-white-beige px-12 z-20 relative">
Praesent vitae pellentesque augue
</p>
<span className="text-white-beige z-20 absolute bottom-8 left-8 text-base flex">
Feito por
<a
href="https://github.com/aridsm"
target="_blank"
className="xl:ml-1"
>
Ariane Morelato <FontAwesomeIcon icon={faGithub} />
</a>
</span>

<ArcSvg className="absolute bottom-0 -right-[120px]" />
<ArcSvg className="absolute bottom-32 left-0 rotate-180" />
</div>
<div className="w-full">
<ArcSvg className="absolute top-[24px] xl:top-0 -right-[80px] xl:-right-[120px] rotate-180 -z-10" />
<div className="max-w-[980px] xl:w-[840px] mx-auto xl:px-10 px-2 py-4 xl:py-8 min-h-screen flex flex-col">
<Header className="hidden xl:flex" />
<Header2 className="flex xl:hidden" />
<Content />
<Footer />
<ArcSvg className="absolute bottom-0 -right-[120px]" />
<ArcSvg className="absolute bottom-32 left-0 rotate-180" />
</div>
<div className="w-full">
<ArcSvg className="absolute top-[24px] xl:top-0 -right-[80px] xl:-right-[120px] rotate-180 -z-10" />
<div className="max-w-[980px] xl:w-[840px] mx-auto xl:px-10 px-2 py-4 xl:py-8 min-h-screen flex flex-col">
<Header className="hidden xl:flex" />
<Header2 className="flex xl:hidden" />
<Content />
<Footer />
</div>
</div>
<ArcSvg className="xl:hidden absolute -left-[40px] bottom-[15%] rotate-90 -z-10" />
</div>
<ArcSvg className="xl:hidden absolute -left-[40px] bottom-[15%] rotate-90 -z-10" />
</div>
<HomeMobile className="flex xl:hidden" />
</>
);
};

Expand Down
114 changes: 114 additions & 0 deletions src/routes/pages/Home/HomeMobile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import Header from "../../../components/General/Header.tsx";
import ArrowSvg from "../../../assets/imgs/arrow.tsx";
import img1 from "../../../assets/imgs/home1.jpg";
import img2 from "../../../assets/imgs/home2.jpg";
import img3 from "../../../assets/imgs/home3.jpg";
import ArcSvg from "../../../assets/imgs/arc.tsx";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
faClock,
faMoneyBill,
faPhone,
faTruck,
} from "@fortawesome/free-solid-svg-icons";
import { NavLink } from "react-router-dom";
import classes from "./Home.module.css";
import {
faCcMastercard,
faCcVisa,
faGithub,
faPix,
} from "@fortawesome/free-brands-svg-icons";

const HomeMobile: React.FC<{ className?: string }> = ({ className }) => {
return (
<div className={`${className} flex flex-col h-full w-full pt-2`}>
<div
className={`${classes.container} overflow-hidden relative rounded-t-lg rounded-b-[3rem] text-white-beige flex flex-col items-center mx-2`}
>
<ArrowSvg className="absolute w-32 h-28 right-16 bottom-1/3 text-mostard rotate-90" />
<div className="flex gap-4 items-end rotate-[35deg] absolute -bottom-6 left-0">
<div className="w-8 h-24 bg-mostard rounded-sm"></div>
<div className="w-8 h-28 bg-mostard rounded-sm"></div>
</div>
<Header className=" text-white-beige py-6 max-w-[980px] w-full" />
<div className="w-fit max-w-[750px] pt-10 pb-24 self-center relative">
<p className=" bg-white-beige/[.05] text-white-beige rounded-sm py-2 px-4 mb-4 flex items-center w-fit">
<FontAwesomeIcon icon={faClock} className="mr-3" />
<time>17:00</time>h - <time>23:00</time>h
</p>
<h2 className="text-5xl leading-[130%] relative ">
Orci varius natoque penatibus et magnis dis parturient montes
</h2>
<div className="mt-20 flex gap-16">
<NavLink
to="/menu"
className={`py-4 px-9 rounded-sm text-white-beige hover:bg-red-hover border-[3px] border-white-beige relative self-start`}
>
Ver cardápio
</NavLink>
<div className={`flex items-center ${classes.imgsOptions}`}>
<img src={img1} />
<img src={img2} />
<img src={img3} />
<p>+60 opções</p>
</div>
</div>
</div>
</div>
<div className="w-full flex flex-col items-center mb-16">
<ul
aria-label="Formas de pagamento"
className={`flex items-center gap-10 my-16 text-neutral-400 ${classes.listPayments}`}
>
<li>
<FontAwesomeIcon icon={faPix} />
<p>Pix</p>
</li>

<li>
<FontAwesomeIcon icon={faCcVisa} />
<p>Visa</p>
</li>

<li>
<FontAwesomeIcon icon={faCcMastercard} />
<p>MasterCard</p>
</li>

<li>
<FontAwesomeIcon icon={faMoneyBill} />
<p>Dinheiro</p>
</li>
</ul>
<ArrowSvg className=" w-32 h-28 text-red-theme rotate-180" />
<ArcSvg className="absolute top-0 -right-[90px] rotate-180 z-10" />
<ArcSvg className="absolute bottom-24 left-10 rotate-180 z-10" />
</div>
<footer className="bg-red-theme py-2 text-sm text-white-beige">
<div className=" max-w-[980px] w-full mx-auto flex items-center justify-between">
<span>
<FontAwesomeIcon icon={faTruck} className="mr-3" /> Delivery -
Fortaleza/CE
</span>
<span className="flex">
Feito por
<a
href="https://github.com/aridsm"
target="_blank"
className="xl:ml-1"
>
Ariane Morelato <FontAwesomeIcon icon={faGithub} />
</a>
</span>
<span>
<FontAwesomeIcon icon={faPhone} className="mr-3" />
+55 (00) 1234-5678
</span>
</div>
</footer>
</div>
);
};

export default HomeMobile;

0 comments on commit c9dd212

Please sign in to comment.