Repository URL to install this package:
|
Version:
2.1.14 ▾
|
import { styled } from 'styleh-components'
import { Image, ImageElement } from '@skava/ui/dist/components/atoms/Image'
import { VideoPlayer } from '@skava/ui/dist/components/atoms/Video'
const StyledVideoPlayer = styled(VideoPlayer) `
width: 100%;
height: auto;
object-fit: fill;
`
const PlaceholderImage = styled(Image) `
display: flex;
align-items: center;
justify-content: center;
${ImageElement} {
width: auto;
}
`
const BackgroundImage = styled.div `
${props =>
props.src &&
styled.css `
background: url(${props.src}) no-repeat;
`}
width: 100%;
height: 100%;
`
const StyledOverlay = styled.div `
position: absolute;
left: 0;
width: 100%;
height: 75%;
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;
height: 100%;
background-color: ${props => (props.isEmpty ? '#ccc' : 'transparent')};
`
const StyledWrapper = styled.section.attrs({
'data-qa': 'page-background',
}) `
width: 100%;
height: 100%;
left: 0;
top: 0;
overflow: hidden;
position: ${props => (props.isPageScroll ? 'absolute' : 'fixed')};
z-index: 0;
`
export {
StyledVideoPlayer,
BackgroundImage,
StyledOverlay,
StyledBox,
StyledWrapper,
PlaceholderImage,
}