Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | import { ReactElement } from "react";
interface IHero {
heroTitle: string;
imgSrc: string;
imgAlt: string;
}
export default function Hero({
heroTitle,
imgSrc,
imgAlt,
}: IHero): ReactElement {
return (
<section>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={imgSrc} alt={imgAlt} width={500} className="hero-image" />
<div className="hero-title">
<h1>{heroTitle}</h1>
</div>
<style jsx>
{`
section {
margin-top: 64px;
width: 100%;
display: grid;
grid-template-columns: repeat(12, 1fr);
position: relative;
}
div {
display: flex;
justify-content: center;
align-items: center;
background-color: rgb(112, 83, 120);
grid-column-start: 7;
grid-column-end: 13;
margin-left: -280px;
height: 700px;
}
h1 {
font-size: 64px;
line-height: 64px;
color: rgb(255, 205, 210);
margin-left: 24%;
max-width: 56.43%;
padding: 0px;
width: 100%;
}
img {
width: 500px;
margin: 0 auto;
left: 0px;
top: 50%;
transform: translateY(-50%);
position: relative;
width: 100%;
height: 80%;
grid-column-start: 1;
grid-column-end: 7;
}
@media screen and (min-width: 0px) and (max-width: 1100px) {
section {
display: block;
}
img {
transform: translateY(0px);
}
div {
height: auto;
padding: 40px 0;
margin: 0;
margin-top: -10px;
}
h1 {
font-size: 40px;
line-height: 40px;
max-width: fit-content;
margin-left: 0;
padding: 10px;
}
}
`}
</style>
</section>
);
}
|