|
@@ -9,9 +9,9 @@ type MainProps = {
|
|
|
main: boolean
|
|
|
}
|
|
|
|
|
|
-type ContainerProps = {
|
|
|
+type ClickableProps = {
|
|
|
clickable: boolean
|
|
|
-} & MainProps
|
|
|
+}
|
|
|
|
|
|
type ScalesWithCoverProps = {
|
|
|
scalingFactor: number
|
|
@@ -26,21 +26,44 @@ const fadeIn = keyframes`
|
|
|
}
|
|
|
`
|
|
|
|
|
|
+export const fadeInAnimation = css`
|
|
|
+ animation: ${fadeIn} 0.5s ease-in;
|
|
|
+`
|
|
|
+
|
|
|
export const CoverWrapper = styled.div`
|
|
|
max-width: 650px;
|
|
|
width: 100%;
|
|
|
`
|
|
|
-
|
|
|
-export const CoverContainer = styled.div`
|
|
|
+const clickableAnimation = (clickable: boolean) =>
|
|
|
+ clickable
|
|
|
+ ? css`
|
|
|
+ transform: translate(-${spacing.xs}, -${spacing.xs});
|
|
|
+ box-shadow: ${spacing.xs} ${spacing.xs} 0 ${colors.blue['500']};
|
|
|
+
|
|
|
+ ${CoverHoverOverlay} {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ ${CoverIcon} {
|
|
|
+ transform: translateY(0);
|
|
|
+ }
|
|
|
+ ${ProgressOverlay} {
|
|
|
+ bottom: ${HOVER_BORDER_SIZE};
|
|
|
+ }
|
|
|
+ `
|
|
|
+ : null
|
|
|
+export const CoverContainer = styled.div<ClickableProps>`
|
|
|
position: relative;
|
|
|
width: 100%;
|
|
|
height: 0;
|
|
|
padding-top: 56.25%;
|
|
|
-
|
|
|
transition-property: box-shadow, transform;
|
|
|
transition-duration: 0.4s;
|
|
|
transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
|
- animation: ${fadeIn} 0.5s ease-in;
|
|
|
+ ${fadeInAnimation};
|
|
|
+ cursor: ${(props) => (props.clickable ? 'pointer' : 'auto')};
|
|
|
+ :hover {
|
|
|
+ ${(props) => clickableAnimation(props.clickable)}
|
|
|
+ }
|
|
|
`
|
|
|
|
|
|
const mainContainerCss = css`
|
|
@@ -49,37 +72,13 @@ const mainContainerCss = css`
|
|
|
}
|
|
|
`
|
|
|
|
|
|
-export const Container = styled.article<ContainerProps>`
|
|
|
+export const Container = styled.article<MainProps>`
|
|
|
width: 100%;
|
|
|
color: ${colors.gray[300]};
|
|
|
- cursor: ${({ clickable }) => (clickable ? 'pointer' : 'auto')};
|
|
|
|
|
|
display: inline-flex;
|
|
|
flex-direction: column;
|
|
|
${({ main }) => main && mainContainerCss}
|
|
|
-
|
|
|
- ${({ clickable }) =>
|
|
|
- clickable &&
|
|
|
- `
|
|
|
- &:hover {
|
|
|
- ${CoverContainer} {
|
|
|
- transform: translate(-${spacing.xs}, -${spacing.xs});
|
|
|
- box-shadow: ${spacing.xs} ${spacing.xs} 0 ${colors.blue['500']};
|
|
|
- }
|
|
|
-
|
|
|
- ${CoverHoverOverlay} {
|
|
|
- opacity: 1;
|
|
|
- }
|
|
|
-
|
|
|
- ${CoverIcon} {
|
|
|
- transform: translateY(0);
|
|
|
- }
|
|
|
-
|
|
|
- ${ProgressOverlay} {
|
|
|
- bottom: ${HOVER_BORDER_SIZE};
|
|
|
- }
|
|
|
- }
|
|
|
- `};
|
|
|
`
|
|
|
|
|
|
const mainInfoContainerCss = css`
|