Skip to content

Commit

Permalink
Styling Menu Items
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Aug 9, 2019
1 parent 711f42d commit e99fdec
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
4 changes: 4 additions & 0 deletions public/index.html
Expand Up @@ -10,6 +10,10 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link
href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300&display=swap"
rel="stylesheet"
/>
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
Expand Down
3 changes: 3 additions & 0 deletions src/App.css
@@ -0,0 +1,3 @@
body {
font-family: "Open Sans Condensed", sans-serif;
}
11 changes: 6 additions & 5 deletions src/components/menu-item/menu-item.component.jsx
Expand Up @@ -2,12 +2,13 @@ import React from "react";
import "./menu-item.styles.scss"; import "./menu-item.styles.scss";


const MenuItem = ({ title, imageUrl, size }) => ( const MenuItem = ({ title, imageUrl, size }) => (
<div <div className={`${size} menu-item`}>
style={{ backgroundImage: `url(${imageUrl})` }} <div
className={`${size} menu-item`} style={{ backgroundImage: `url(${imageUrl})` }}
> className="background-image"
/>
<div className="content"> <div className="content">
<h1 className="title">{title}</h1> <h1 className="title">{title.toUpperCase()}</h1>
<span className="subtitle">SHOP NOW</span> <span className="subtitle">SHOP NOW</span>
</div> </div>
</div> </div>
Expand Down
26 changes: 24 additions & 2 deletions src/components/menu-item/menu-item.styles.scss
Expand Up @@ -7,13 +7,32 @@
justify-content: center; justify-content: center;
border: 1px solid black; border: 1px solid black;
margin: 0 7.5px 15px; margin: 0 7.5px 15px;
background-position: center; overflow: hidden;
background-size: cover;
&:hover {
cursor: pointer;

& .background-image {
transform: scale(1.1);
transition: transform 3s cubic-bezier(0.25, 0.45, 0.45, 0.95);
}

& .content {
opacity: 0.9;
}
}


&.large { &.large {
height: 380px; height: 380px;
} }


.background-image {
width: 100%;
height: 100%;
background-position: center;
background-size: cover;
}

&:first-child { &:first-child {
margin-right: 7.5px; margin-right: 7.5px;
} }
Expand All @@ -30,6 +49,9 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border: 1px solid black; border: 1px solid black;
background-color: white;
opacity: 0.7;
position: absolute;


.title { .title {
font-weight: bold; font-weight: bold;
Expand Down

0 comments on commit e99fdec

Please sign in to comment.