QuoteCard
A passage on a paper card with its source, and a marker over the phrases that matter.
tsx
import { Background, Composition, QuoteCard, Track } from "@cutcraft/kit";
// QuoteCard: a passage with its source, and a marker that sweeps across the phrases that matter.
export default function Video() {
return (
<Composition fps={30} width={1920} height={1080} theme={{ extends: "paper" }}>
<Track id="back" layout="free">
<Background id="bg" start={0} duration={3} variant="dots" />
</Track>
<Track id="over" layout="free">
<QuoteCard
id="quote"
start={0.2}
duration={2.8}
width={1100}
size={44}
source="A barista's handbook, on freshness"
text="Roasted coffee is at its best between four and fourteen days after roasting. Once ground, it loses most of its aroma within fifteen minutes."
highlights={[
{ text: "four and fourteen days", offset: 0.6 },
{ text: "within fifteen minutes", offset: 1.3 },
]}
/>
</Track>
</Composition>
);
}Props
Besides the timing props (start, anchor, at, offset, duration):
| param | type | default | description |
|---|---|---|---|
id | string | The component's id; each of its parts' ids starts with it. | |
x | number | 0 | The card's centre, in pixels from the frame's centre. |
y | number | 0 | The card's centre, in pixels below the frame's centre. |
width | number (> 0) | 860 | The card's width in pixels; the passage wraps inside it. |
source | string | Where the words come from, in small type above them. | |
text | string | The passage; its line breaks are kept. | |
size | number (> 0) | 40 | Letter height in pixels; the padding and corners scale with it. |
fill | string | "#ffffff" | The paper's colour. |
color | string | "#16161a" | The words' colour. |
accent | string | "$accent" | The marker's colour, for highlights that do not name their own. |
highlights | { text, color, at, offset }[] | [] | The phrases to mark, each at its own cue; each must appear in text as written. |