add Header component
This commit is contained in:
parent
2c22f8223e
commit
7f49cd68e2
BIN
src/assets/meals.jpg
Normal file
BIN
src/assets/meals.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 407 KiB |
20
src/components/Layout/Header.js
Normal file
20
src/components/Layout/Header.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import mealsImage from '../../assets/meals.jpg';
|
||||||
|
import classes from './Header.module.css';
|
||||||
|
|
||||||
|
const Header = () => {
|
||||||
|
|
||||||
|
return <>
|
||||||
|
<header className={classes.header}>
|
||||||
|
<h1>ReactMeals</h1>
|
||||||
|
<button>Cart</button>
|
||||||
|
</header>
|
||||||
|
<div className={classes['main-image']}>
|
||||||
|
<img src={mealsImage} alt="A table full of delicious food!" />
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default Header;
|
29
src/components/Layout/Header.module.css
Normal file
29
src/components/Layout/Header.module.css
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
.header {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 5rem;
|
||||||
|
background-color: #8a2b06;
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 10%;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 25rem;
|
||||||
|
z-index: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-image img {
|
||||||
|
width: 110%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
transform: rotateZ(-5deg) translateY(-4rem) translateX(-1rem);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user