MCPcopy Create free account
hub / github.com/pomber/code-surfer / Title

Function Title

packs/standalone/src/frame.tsx:157–173  ·  view source on GitHub ↗
({ textPair, t }: CaptionProps)

Source from the content-addressed store, hash-verified

155type CaptionProps = { textPair: Tuple<string | undefined>; t: number };
156
157function 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
175function Subtitle({ textPair, t }: CaptionProps) {
176 if (!textPair.any()) {

Callers

nothing calls this directly

Calls 5

fadeOutInFunction · 0.90
halfFadeInFunction · 0.90
halfFadeOutFunction · 0.90
anyMethod · 0.80
spreadMethod · 0.80

Tested by

no test coverage detected