|
@@ -1,48 +1,18 @@
|
|
|
import { css } from '@emotion/react'
|
|
|
import styled from '@emotion/styled'
|
|
|
-import { fluidRange } from 'polished'
|
|
|
|
|
|
import { Button, IconButton, SkeletonLoader, Text } from '@/shared/components'
|
|
|
-import { breakpoints, colors, media, sizes } from '@/shared/theme'
|
|
|
+import { colors, media, sizes, typography } from '@/shared/theme'
|
|
|
|
|
|
+import { TOP_NAVBAR_HEIGHT } from '..'
|
|
|
import { ChannelLink } from '../ChannelLink'
|
|
|
|
|
|
-const CONTENT_OVERLAP_MAP = {
|
|
|
- SMALL: 25,
|
|
|
- MEDIUM: 150,
|
|
|
- LARGE: 200,
|
|
|
- XLARGE: 400,
|
|
|
- XXLARGE: 600,
|
|
|
-}
|
|
|
-const GRADIENT_OVERLAP = 50
|
|
|
-const GRADIENT_HEIGHT = 250
|
|
|
-const INFO_BOTTOM_MARGIN = 100
|
|
|
-const BUTTONS_HEIGHT_PX = '54px'
|
|
|
+const BUTTONS_HEIGHT = 48
|
|
|
|
|
|
export const Container = styled.section`
|
|
|
position: relative;
|
|
|
-
|
|
|
- /* because of the fixed aspect ratio, as the viewport width grows, the media will occupy more height as well
|
|
|
- so that the media doesn't take too big of a portion of the space, we let the content overlap the media via a negative margin */
|
|
|
- ${media.small} {
|
|
|
- margin-bottom: -${CONTENT_OVERLAP_MAP.SMALL}px;
|
|
|
- }
|
|
|
-
|
|
|
- ${media.medium} {
|
|
|
- margin-bottom: -${CONTENT_OVERLAP_MAP.MEDIUM}px;
|
|
|
- }
|
|
|
-
|
|
|
- ${media.large} {
|
|
|
- margin-bottom: -${CONTENT_OVERLAP_MAP.LARGE}px;
|
|
|
- }
|
|
|
-
|
|
|
- ${media.xlarge} {
|
|
|
- margin-bottom: -${CONTENT_OVERLAP_MAP.XLARGE}px;
|
|
|
- }
|
|
|
-
|
|
|
- ${media.xxlarge} {
|
|
|
- margin-bottom: -${CONTENT_OVERLAP_MAP.XXLARGE}px;
|
|
|
- }
|
|
|
+ max-height: calc(100vh - ${TOP_NAVBAR_HEIGHT}px);
|
|
|
+ margin-bottom: -${sizes(6)}px;
|
|
|
`
|
|
|
|
|
|
export const MediaWrapper = styled.div`
|
|
@@ -53,8 +23,18 @@ export const MediaWrapper = styled.div`
|
|
|
export const Media = styled.div`
|
|
|
width: 100%;
|
|
|
height: 0;
|
|
|
- padding-top: 56.25%;
|
|
|
+
|
|
|
+ /* 2:1 ratio */
|
|
|
+ padding-top: 50%;
|
|
|
position: relative;
|
|
|
+
|
|
|
+ ${media.smalldium} {
|
|
|
+ margin-bottom: ${sizes(8)}px;
|
|
|
+ }
|
|
|
+
|
|
|
+ ${media.medium} {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
`
|
|
|
|
|
|
const absoluteMediaCss = css`
|
|
@@ -69,95 +49,36 @@ export const PlayerContainer = styled.div`
|
|
|
${absoluteMediaCss};
|
|
|
`
|
|
|
|
|
|
-export const HorizontalGradientOverlay = styled.div`
|
|
|
+export const GradientOverlay = styled.div`
|
|
|
${absoluteMediaCss};
|
|
|
|
|
|
- display: none;
|
|
|
- background: linear-gradient(90deg, rgba(0, 0, 0, 0.8) 11.76%, rgba(0, 0, 0, 0) 100%);
|
|
|
-
|
|
|
- ${media.small} {
|
|
|
- display: block;
|
|
|
- }
|
|
|
-`
|
|
|
-
|
|
|
-export const VerticalGradientOverlay = styled.div`
|
|
|
- ${absoluteMediaCss};
|
|
|
-
|
|
|
- /* as the content overlaps the media more and more as the viewport width grows, we need to hide some part of the media with a gradient
|
|
|
- this helps with keeping a consistent background behind a page content - we don't want the media to peek out in the content spacing */
|
|
|
- background: linear-gradient(0deg, black 0%, rgba(0, 0, 0, 0) ${GRADIENT_HEIGHT / 2}px);
|
|
|
- ${media.small} {
|
|
|
- background: linear-gradient(
|
|
|
- 0deg,
|
|
|
- black 0%,
|
|
|
- black ${CONTENT_OVERLAP_MAP.SMALL - GRADIENT_OVERLAP}px,
|
|
|
- rgba(0, 0, 0, 0) ${CONTENT_OVERLAP_MAP.SMALL - GRADIENT_OVERLAP + GRADIENT_HEIGHT}px
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- ${media.medium} {
|
|
|
- background: linear-gradient(
|
|
|
- 0deg,
|
|
|
- black 0%,
|
|
|
- black ${CONTENT_OVERLAP_MAP.MEDIUM - GRADIENT_OVERLAP}px,
|
|
|
- rgba(0, 0, 0, 0) ${CONTENT_OVERLAP_MAP.MEDIUM - GRADIENT_OVERLAP + GRADIENT_HEIGHT}px
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- ${media.large} {
|
|
|
- background: linear-gradient(
|
|
|
- 0deg,
|
|
|
- black 0%,
|
|
|
- black ${CONTENT_OVERLAP_MAP.LARGE - GRADIENT_OVERLAP}px,
|
|
|
- rgba(0, 0, 0, 0) ${CONTENT_OVERLAP_MAP.LARGE - GRADIENT_OVERLAP + GRADIENT_HEIGHT}px
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- ${media.xlarge} {
|
|
|
- background: linear-gradient(
|
|
|
- 0deg,
|
|
|
- black 0%,
|
|
|
- black ${CONTENT_OVERLAP_MAP.XLARGE - GRADIENT_OVERLAP}px,
|
|
|
- rgba(0, 0, 0, 0) ${CONTENT_OVERLAP_MAP.XLARGE - GRADIENT_OVERLAP + GRADIENT_HEIGHT}px
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- ${media.xxlarge} {
|
|
|
- background: linear-gradient(
|
|
|
- 0deg,
|
|
|
- black 0%,
|
|
|
- black ${CONTENT_OVERLAP_MAP.XXLARGE - GRADIENT_OVERLAP}px,
|
|
|
- rgba(0, 0, 0, 0) ${CONTENT_OVERLAP_MAP.XXLARGE - GRADIENT_OVERLAP + GRADIENT_HEIGHT}px
|
|
|
- );
|
|
|
- }
|
|
|
+ background: linear-gradient(180deg, transparent 50%, ${colors.black} 93.23%, ${colors.black} 100%),
|
|
|
+ radial-gradient(50.66% 101.32% at 50% 50%, transparent 0%, ${colors.transparentBlack[54]} 100%),
|
|
|
+ ${colors.transparentBlack[54]};
|
|
|
`
|
|
|
|
|
|
export const InfoContainer = styled.div<{ isLoading: boolean }>`
|
|
|
position: relative;
|
|
|
- margin-top: -${sizes(8)};
|
|
|
- padding-bottom: ${sizes(12)};
|
|
|
+ padding-bottom: ${sizes(16)};
|
|
|
+ width: 100%;
|
|
|
|
|
|
${media.small} {
|
|
|
+ margin-bottom: 64px;
|
|
|
+ padding-bottom: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ ${media.smalldium} {
|
|
|
position: absolute;
|
|
|
margin: 0;
|
|
|
- padding-bottom: 0;
|
|
|
- bottom: ${CONTENT_OVERLAP_MAP.SMALL + INFO_BOTTOM_MARGIN / 4}px;
|
|
|
+ bottom: 64px;
|
|
|
}
|
|
|
|
|
|
${media.medium} {
|
|
|
- bottom: ${CONTENT_OVERLAP_MAP.MEDIUM + INFO_BOTTOM_MARGIN / 2}px;
|
|
|
+ bottom: 96px;
|
|
|
}
|
|
|
|
|
|
${media.large} {
|
|
|
- bottom: ${CONTENT_OVERLAP_MAP.LARGE + INFO_BOTTOM_MARGIN}px;
|
|
|
- }
|
|
|
-
|
|
|
- ${media.xlarge} {
|
|
|
- bottom: ${CONTENT_OVERLAP_MAP.XLARGE + INFO_BOTTOM_MARGIN}px;
|
|
|
- }
|
|
|
-
|
|
|
- ${media.xxlarge} {
|
|
|
- bottom: ${CONTENT_OVERLAP_MAP.XXLARGE + INFO_BOTTOM_MARGIN}px;
|
|
|
+ bottom: 128px;
|
|
|
}
|
|
|
`
|
|
|
|
|
@@ -170,31 +91,20 @@ export const TitleContainer = styled.div`
|
|
|
text-decoration: none;
|
|
|
}
|
|
|
|
|
|
- margin-bottom: ${sizes(8)};
|
|
|
-
|
|
|
- ${media.medium} {
|
|
|
- margin-bottom: ${sizes(10)};
|
|
|
- }
|
|
|
-
|
|
|
- span {
|
|
|
- display: block;
|
|
|
- max-width: 40ch;
|
|
|
- ${fluidRange({ prop: 'fontSize', fromSize: '14px', toSize: '22px' }, breakpoints.base, breakpoints.xlarge)};
|
|
|
- ${fluidRange({ prop: 'lineHeight', fromSize: '20px', toSize: '26px' }, breakpoints.base, breakpoints.xlarge)};
|
|
|
+ margin-bottom: ${sizes(4)};
|
|
|
|
|
|
- color: ${colors.white};
|
|
|
+ ${media.small} {
|
|
|
+ margin-bottom: ${sizes(8)};
|
|
|
}
|
|
|
`
|
|
|
|
|
|
export const Title = styled(Text)`
|
|
|
- ${fluidRange({ prop: 'fontSize', fromSize: '40px', toSize: '72px' }, breakpoints.base, breakpoints.xlarge)};
|
|
|
- ${fluidRange({ prop: 'lineHeight', fromSize: '48px', toSize: '68px' }, breakpoints.base, breakpoints.xlarge)};
|
|
|
-
|
|
|
- display: inline-block;
|
|
|
- margin-bottom: ${sizes(4)};
|
|
|
+ font-size: ${typography.sizes.h3};
|
|
|
+ line-height: ${typography.lineHeights.h3};
|
|
|
|
|
|
- ${media.medium} {
|
|
|
- margin-bottom: ${sizes(5)};
|
|
|
+ ${media.large} {
|
|
|
+ font-size: ${typography.sizes.h2};
|
|
|
+ line-height: ${typography.lineHeights.h2};
|
|
|
}
|
|
|
`
|
|
|
|
|
@@ -206,21 +116,18 @@ export const TitleSkeletonLoader = styled(SkeletonLoader)`
|
|
|
}
|
|
|
`
|
|
|
|
|
|
-export const ControlsContainer = styled.div`
|
|
|
- min-height: ${BUTTONS_HEIGHT_PX};
|
|
|
-`
|
|
|
-
|
|
|
export const ButtonsContainer = styled.div`
|
|
|
display: flex;
|
|
|
`
|
|
|
|
|
|
+export const ButtonsSpaceKeeper = styled.div`
|
|
|
+ min-height: ${BUTTONS_HEIGHT}px;
|
|
|
+`
|
|
|
+
|
|
|
export const PlayButton = styled(Button)`
|
|
|
- width: 140px;
|
|
|
- height: ${BUTTONS_HEIGHT_PX};
|
|
|
+ width: 90px;
|
|
|
`
|
|
|
|
|
|
export const SoundButton = styled(IconButton)`
|
|
|
margin-left: ${sizes(4)};
|
|
|
- height: ${BUTTONS_HEIGHT_PX};
|
|
|
- width: ${BUTTONS_HEIGHT_PX};
|
|
|
`
|