({ textPair, t }: CaptionProps)
| 155 | type CaptionProps = { textPair: Tuple<string | undefined>; t: number }; |
| 156 | |
| 157 | function Title({ textPair, t }: CaptionProps) { |
| 158 | if (!textPair.any()) { |
| 159 | return null; |
| 160 | } |
| 161 | |
| 162 | const [prev, next] = textPair.spread(); |
| 163 | const text = t < 0.5 ? prev : next; |
| 164 | const textStyle = prev !== next ? fadeOutIn()(t) : undefined; |
| 165 | const backgroundStyle = |
| 166 | prev && next ? undefined : !prev ? halfFadeIn()(t) : halfFadeOut()(t); |
| 167 | |
| 168 | return ( |
| 169 | <Styled.Title className="cs-title" style={backgroundStyle}> |
| 170 | <span style={textStyle}>{text}</span> |
| 171 | </Styled.Title> |
| 172 | ); |
| 173 | } |
| 174 | |
| 175 | function Subtitle({ textPair, t }: CaptionProps) { |
| 176 | if (!textPair.any()) { |
nothing calls this directly
no test coverage detected