Repository URL to install this package:
|
Version:
3.0.4 ▾
|
import { styled } from 'styleh-components'
import { Image, ImageElement } from 'atoms/Image'
import { VideoPlayer } from 'atoms/Video'
const StyledVideoPlayer = styled.withComponent(VideoPlayer)`
width: 100%;
height: auto;
object-fit: fill;
`
const StyledImage = styled.withComponent(Image)`
height: auto;
${ImageElement} {
display: flex;
}
`
const StyledOverlay = styled.div`
position: absolute;
left: 0;
width: 100%;
height: 50%;
background: linear-gradient(
${props =>
props.position === 'top'
? `0deg, transparent, ${props.backgroundColor} 80%`
: `0deg, ${props.backgroundColor} 30%, transparent`}
);
${props =>
props.position &&
props.position === 'top' &&
styled.css`
bottom: auto;
top: -2px;
`};
${props =>
props.position &&
props.position === 'bottom' &&
styled.css`
bottom: -2px;
top: auto;
`};
`
const StyledBox = styled.div`
position: relative;
`
const StyledWrapper = styled.section.attrs({
'data-qa': 'page-background',
})`
width: 100%;
left: 0;
top: 0;
overflow: hidden;
position: ${props => (props.isPageScroll ? 'absolute' : 'fixed')};
z-index: 0;
`
export {
StyledVideoPlayer,
StyledImage,
StyledOverlay,
StyledBox,
StyledWrapper,
}