✨ add banner component
This commit is contained in:
parent
dd2c22ec6f
commit
ff47a4d1aa
24
src/components/banner/Banner.tsx
Normal file
24
src/components/banner/Banner.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
30
src/components/banner/BannerView.ts
Normal file
30
src/components/banner/BannerView.ts
Normal 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;
|
||||
}
|
||||
`
|
||||
Loading…
x
Reference in New Issue
Block a user