-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Brahmware:add-koel-container
Add-koel-container
- Loading branch information
Showing
7 changed files
with
211 additions
and
14 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { alpha, styled } from '@mui/material'; | ||
import Image from 'next/image'; | ||
import React from 'react'; | ||
|
||
const Glass = styled('div')(({ theme }) => ({ | ||
width: '100%', | ||
height: '100%', | ||
position: 'absolute', | ||
top: 0, | ||
left: 0, | ||
backgroundColor: alpha(theme.Colors.bhasma, 0.25), | ||
zIndex: 1, | ||
boxShadow: 'inset ' + theme.shadows[20], | ||
})); | ||
|
||
const StyledImage = styled(Image)(({ theme }) => ({ | ||
width: '100%', | ||
height: '100%', | ||
objectFit: 'cover', | ||
zIndex: 0, | ||
filter: 'blur(10px)', | ||
transform: 'scale(1.05)', | ||
})); | ||
|
||
|
||
export interface BackgroundImageProps { | ||
src?: string; | ||
alt?: string; | ||
}; | ||
|
||
const BackgroundImage: React.FC<BackgroundImageProps> = ({ | ||
src, | ||
alt | ||
}) => { | ||
return ( | ||
<React.Fragment> | ||
<Glass /> | ||
<StyledImage | ||
src={src || ''} | ||
alt={alt || ''} | ||
layout="fill" | ||
objectFit="cover" | ||
quality={100} | ||
/> | ||
</React.Fragment> | ||
) | ||
} | ||
|
||
export default BackgroundImage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import React from 'react'; | ||
import { Box, BoxProps, styled } from '@mui/material'; | ||
import ContainedButton from '@components/Button/ContainedButton'; | ||
import BodyText from '@components/Texts/BodyText'; | ||
import TitleText from '@components/Texts/TitleText'; | ||
import Link from 'next/link'; | ||
|
||
const Headline = styled(BodyText)(({ theme }) => ({ | ||
paddingLeft: theme.spacing(0.5), | ||
paddingTop: theme.spacing(4), | ||
paddingBottom: theme.spacing(1), | ||
fontWeight: theme.FontWeights.fontWeightBlack, | ||
color: theme.Colors.white, | ||
})); | ||
|
||
const Title = styled(TitleText)(({ theme }) => ({ | ||
fontWeight: theme.FontWeights.fontWeightUltra, | ||
color: theme.Colors.white, | ||
padding: theme.Spaces.lg + ' 0', | ||
})); | ||
|
||
type Button = { | ||
buttonText?: string; | ||
link?: string; | ||
onClick?: () => void; | ||
}; | ||
|
||
export interface AdsContentProps extends BoxProps { | ||
headline?: string; | ||
slogan?: string; | ||
button?: Button; | ||
}; | ||
|
||
const AdsContent: React.FC<AdsContentProps> = ({ | ||
headline, | ||
slogan, | ||
button, | ||
...props | ||
}) => { | ||
return ( | ||
<Box {...props}> | ||
<Headline> | ||
{headline} | ||
</Headline> | ||
<Title dangerouslySetInnerHTML={{ __html: slogan || '' }} /> | ||
{ | ||
button && ( | ||
button.link ? ( | ||
<ContainedButton | ||
flipped | ||
color="secondary" | ||
aria-label={button.buttonText} | ||
vocab={button.buttonText} | ||
sx={{ my: 3 }} | ||
component={Link} | ||
href={button.link} | ||
> | ||
{button.buttonText} | ||
</ContainedButton> | ||
) : ( | ||
<ContainedButton | ||
flipped | ||
color="secondary" | ||
aria-label={button.buttonText} | ||
vocab={button.buttonText} | ||
sx={{ my: 3 }} | ||
onClick={button.onClick} | ||
> | ||
{button.buttonText} | ||
</ContainedButton> | ||
) | ||
) | ||
} | ||
</Box> | ||
) | ||
} | ||
|
||
export default styled(AdsContent)(({ theme }) => ({ | ||
maxWidth: theme.breakpoints.values.xl, | ||
width: '100%', | ||
height: '100%', | ||
padding: '0 ' + theme.Spaces.md, | ||
|
||
position: 'absolute', | ||
zIndex: 2, | ||
|
||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'start', | ||
|
||
'@media (max-width: 1400px)': { | ||
alignItems: 'center', | ||
|
||
'& > *': { | ||
textAlign: 'center', | ||
}, | ||
}, | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import { styled } from '@mui/material'; | ||
import BackgroundImage, { BackgroundImageProps } from './BackgroundImage'; | ||
import Content, { AdsContentProps } from './Content'; | ||
|
||
interface ParakeetProps extends React.HTMLAttributes<HTMLDivElement> { | ||
image?: BackgroundImageProps; | ||
advertisement?: AdsContentProps; | ||
}; | ||
|
||
const Parakeet: React.FC<ParakeetProps> = ({ | ||
children, | ||
image, | ||
advertisement, | ||
...props | ||
}) => { | ||
return ( | ||
<div {...props}> | ||
<BackgroundImage | ||
src={image?.src} | ||
alt={image?.alt} | ||
/> | ||
<Content | ||
headline={advertisement?.headline} | ||
slogan={advertisement?.slogan} | ||
button={advertisement?.button} | ||
/> | ||
</div> | ||
) | ||
}; | ||
|
||
export default styled(Parakeet)(({ theme }) => ({ | ||
width: '100%', | ||
height: '25rem', | ||
position: 'relative', | ||
overflow: 'hidden', | ||
|
||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters