add banner component

This commit is contained in:
José Corte 2022-05-06 12:47:34 -03:00
parent dd2c22ec6f
commit ff47a4d1aa
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,24 @@
import React from 'react'
import Image from 'next/image'
import { BannerView } from './BannerView'
interface BannerInterface {
title: string,
subtitle: string,
imgSource: string
}
export default function Banner({ title, subtitle, imgSource }: BannerInterface) {
return (
<BannerView>
{/* <Image src={imgSource} width={1458} height={302} layout='intrinsic' /> */}
<Image src={imgSource} layout='fill' />
<div className='gradient' />
<div className='text'>
<h1>{title}</h1>
<p>{subtitle}</p>
</div>
</BannerView>
)
}

View File

@ -0,0 +1,30 @@
import styled from 'styled-components'
export const BannerView = styled.div`
position: relative;
width: 100%;
height: 19rem;
.gradient {
position: absolute;
width: 100%;
height: 19rem;
background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), rgba(7, 23, 100, 0.6);
opacity: 0.9;
z-index: 1;
}
.text {
position: relative;
margin: 82px 0 0 20px;
font-family: 'Poppins';
font-style: normal;
color: white;
z-index: 2;
}
`