@clipkit/patterns 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +84 -0
- package/dist/anchor-default.d.ts +4 -0
- package/dist/anchor-default.d.ts.map +1 -0
- package/dist/anchor-default.js +34 -0
- package/dist/anchor-default.js.map +1 -0
- package/dist/bar-chart-row.d.ts +43 -0
- package/dist/bar-chart-row.d.ts.map +1 -0
- package/dist/bar-chart-row.js +143 -0
- package/dist/bar-chart-row.js.map +1 -0
- package/dist/beat-sync.d.ts +101 -0
- package/dist/beat-sync.d.ts.map +1 -0
- package/dist/beat-sync.js +145 -0
- package/dist/beat-sync.js.map +1 -0
- package/dist/camera-orbit.d.ts +22 -0
- package/dist/camera-orbit.d.ts.map +1 -0
- package/dist/camera-orbit.js +32 -0
- package/dist/camera-orbit.js.map +1 -0
- package/dist/cta-outro.d.ts +18 -0
- package/dist/cta-outro.d.ts.map +1 -0
- package/dist/cta-outro.js +44 -0
- package/dist/cta-outro.js.map +1 -0
- package/dist/data-scenes.d.ts +66 -0
- package/dist/data-scenes.d.ts.map +1 -0
- package/dist/data-scenes.js +188 -0
- package/dist/data-scenes.js.map +1 -0
- package/dist/flow-line.d.ts +27 -0
- package/dist/flow-line.d.ts.map +1 -0
- package/dist/flow-line.js +53 -0
- package/dist/flow-line.js.map +1 -0
- package/dist/glass-panel.d.ts +24 -0
- package/dist/glass-panel.d.ts.map +1 -0
- package/dist/glass-panel.js +32 -0
- package/dist/glass-panel.js.map +1 -0
- package/dist/header-bar.d.ts +36 -0
- package/dist/header-bar.d.ts.map +1 -0
- package/dist/header-bar.js +108 -0
- package/dist/header-bar.js.map +1 -0
- package/dist/hero-reveal.d.ts +17 -0
- package/dist/hero-reveal.d.ts.map +1 -0
- package/dist/hero-reveal.js +47 -0
- package/dist/hero-reveal.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/intro-card.d.ts +23 -0
- package/dist/intro-card.d.ts.map +1 -0
- package/dist/intro-card.js +123 -0
- package/dist/intro-card.js.map +1 -0
- package/dist/kinetic-headline.d.ts +18 -0
- package/dist/kinetic-headline.d.ts.map +1 -0
- package/dist/kinetic-headline.js +39 -0
- package/dist/kinetic-headline.js.map +1 -0
- package/dist/layers.d.ts +13 -0
- package/dist/layers.d.ts.map +1 -0
- package/dist/layers.js +19 -0
- package/dist/layers.js.map +1 -0
- package/dist/liquid-morph.d.ts +62 -0
- package/dist/liquid-morph.d.ts.map +1 -0
- package/dist/liquid-morph.js +113 -0
- package/dist/liquid-morph.js.map +1 -0
- package/dist/lit-surface.d.ts +38 -0
- package/dist/lit-surface.d.ts.map +1 -0
- package/dist/lit-surface.js +63 -0
- package/dist/lit-surface.js.map +1 -0
- package/dist/lower-third.d.ts +26 -0
- package/dist/lower-third.d.ts.map +1 -0
- package/dist/lower-third.js +101 -0
- package/dist/lower-third.js.map +1 -0
- package/dist/morph-shape.d.ts +42 -0
- package/dist/morph-shape.d.ts.map +1 -0
- package/dist/morph-shape.js +57 -0
- package/dist/morph-shape.js.map +1 -0
- package/dist/pie-card.d.ts +35 -0
- package/dist/pie-card.d.ts.map +1 -0
- package/dist/pie-card.js +168 -0
- package/dist/pie-card.js.map +1 -0
- package/dist/promo.d.ts +38 -0
- package/dist/promo.d.ts.map +1 -0
- package/dist/promo.js +61 -0
- package/dist/promo.js.map +1 -0
- package/dist/ranked-list.d.ts +38 -0
- package/dist/ranked-list.d.ts.map +1 -0
- package/dist/ranked-list.js +130 -0
- package/dist/ranked-list.js.map +1 -0
- package/dist/stat-block.d.ts +26 -0
- package/dist/stat-block.d.ts.map +1 -0
- package/dist/stat-block.js +92 -0
- package/dist/stat-block.js.map +1 -0
- package/dist/theme.d.ts +36 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +75 -0
- package/dist/theme.js.map +1 -0
- package/dist/tilted-showcase.d.ts +29 -0
- package/dist/tilted-showcase.d.ts.map +1 -0
- package/dist/tilted-showcase.js +106 -0
- package/dist/tilted-showcase.js.map +1 -0
- package/dist/trend-pill.d.ts +33 -0
- package/dist/trend-pill.d.ts.map +1 -0
- package/dist/trend-pill.js +83 -0
- package/dist/trend-pill.js.map +1 -0
- package/dist/zoom-rig.d.ts +27 -0
- package/dist/zoom-rig.d.ts.map +1 -0
- package/dist/zoom-rig.js +46 -0
- package/dist/zoom-rig.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// flowLine — a "conveyor" bar: a rounded strip with a diagonal stripe texture
|
|
2
|
+
// scrolling along it (the barber-pole illusion). Scroll the texture LEFT and,
|
|
3
|
+
// especially once you zoom into the bar, it reads as the bar itself travelling
|
|
4
|
+
// RIGHT — the classic motion-graphics fake. Built as a clipped group so the
|
|
5
|
+
// stripes only show inside the strip, with the stripes positioned by a looping
|
|
6
|
+
// `mod(...)` expression (pure function of time, seamless wrap).
|
|
7
|
+
//
|
|
8
|
+
// Returns ONE clipped `group` (move / scale / time-remap it as a unit — e.g. drop
|
|
9
|
+
// it inside a `zoomRig` and push in to reveal the flow). Children are in the
|
|
10
|
+
// group's LOCAL space (origin at the strip's top-left), per the runtime's
|
|
11
|
+
// clipped-group model.
|
|
12
|
+
const e = (expr) => ({ expr });
|
|
13
|
+
export function flowLine(props) {
|
|
14
|
+
const { id, x, y, length, thickness, baseColor, stripeColor, speed = 220, angle = 22, stripeWidth = 30, time, duration, track, } = props;
|
|
15
|
+
const radius = props.radius ?? thickness / 2;
|
|
16
|
+
const period = stripeWidth * 2; // stripe + equal gap
|
|
17
|
+
const span = length + period * 2; // wrap distance (covers the slant overhang)
|
|
18
|
+
// tall enough that the slanted stripe still covers the strip top-to-bottom
|
|
19
|
+
const stripeH = thickness + Math.tan((Math.abs(angle) * Math.PI) / 180) * thickness + thickness;
|
|
20
|
+
const count = Math.ceil(span / period) + 1;
|
|
21
|
+
const children = [
|
|
22
|
+
{ id: `${id}-base`, type: 'shape', shape: 'rectangle', x: length / 2, y: thickness / 2, width: length, height: thickness, fill_color: baseColor },
|
|
23
|
+
];
|
|
24
|
+
for (let k = 0; k < count; k++) {
|
|
25
|
+
children.push({
|
|
26
|
+
id: `${id}-st-${k}`,
|
|
27
|
+
type: 'shape',
|
|
28
|
+
shape: 'rectangle',
|
|
29
|
+
// local x loops over [−period, span−period); seamless because span is a whole number of periods + cover
|
|
30
|
+
x: e(`mod(${k * period} - t*${speed}, ${span}) - ${period}`),
|
|
31
|
+
y: thickness / 2,
|
|
32
|
+
width: stripeWidth,
|
|
33
|
+
height: stripeH,
|
|
34
|
+
rotation: angle,
|
|
35
|
+
fill_color: stripeColor,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
id,
|
|
40
|
+
type: 'group',
|
|
41
|
+
track,
|
|
42
|
+
time,
|
|
43
|
+
duration,
|
|
44
|
+
clip: true,
|
|
45
|
+
x,
|
|
46
|
+
y,
|
|
47
|
+
width: length,
|
|
48
|
+
height: thickness,
|
|
49
|
+
border_radius: radius,
|
|
50
|
+
elements: children,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=flow-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-line.js","sourceRoot":"","sources":["../src/flow-line.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,+EAA+E;AAC/E,gEAAgE;AAChE,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAC7E,0EAA0E;AAC1E,uBAAuB;AAIvB,MAAM,CAAC,GAAG,CAAC,IAAY,EAAoB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AA2BzD,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EACJ,EAAE,EAAE,CAAC,EAAE,CAA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AC,GAAG,MAAM,QAAQ,KAAK,KAAK,IAAI,OAAO,MAAM,EAAE,CAAC;YAC5D,CAAC,EAAE,SAAS,GAAG,CAAC;YAChB,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,WAAW;SACb,CAAC,CAAC;IAChB,CAAC;IAED,OAAO;QACL,EAAE;QACF,IAAI,EAAE,OAAO;QACb,KAAK;QACL,IAAI;QACJ,QAAQ;QACR,IAAI,EAAE,IAAI;QACV,CAAC;QACD,CAAC;QACD,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,QAAQ;KACR,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Element } from '@clipkit/protocol';
|
|
2
|
+
import { type ColorName, type ThemeName } from './theme.js';
|
|
3
|
+
export interface GlassPanelProps {
|
|
4
|
+
id: string;
|
|
5
|
+
/** Center in canvas px. */
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
/** Corner radius. Default = pill (height/2). */
|
|
11
|
+
radius?: number;
|
|
12
|
+
/** Centered label text. */
|
|
13
|
+
label?: string;
|
|
14
|
+
labelSize?: number;
|
|
15
|
+
color: ColorName;
|
|
16
|
+
theme?: ThemeName;
|
|
17
|
+
/** Frost amount (0 = clear glass). Default 8. */
|
|
18
|
+
blur?: number;
|
|
19
|
+
time: number;
|
|
20
|
+
duration: number;
|
|
21
|
+
layer: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function glassPanel(props: GlassPanelProps): Element;
|
|
24
|
+
//# sourceMappingURL=glass-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glass-panel.d.ts","sourceRoot":"","sources":["../src/glass-panel.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CA0B1D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// glassPanel — a refractive glass card / pill (optionally labelled). Reads
|
|
2
|
+
// whatever is drawn beneath it as its backdrop, so place it over content.
|
|
3
|
+
//
|
|
4
|
+
// COMPONENT pattern: returns ONE plain `group`.
|
|
5
|
+
import { assignLayers } from './layers.js';
|
|
6
|
+
import { getFonts, getPalette } from './theme.js';
|
|
7
|
+
export function glassPanel(props) {
|
|
8
|
+
const { id, x, y, width: W, height: H, label, color, time, duration, layer } = props;
|
|
9
|
+
const theme = props.theme ?? 'cinematic';
|
|
10
|
+
const palette = getPalette(theme, color);
|
|
11
|
+
const fonts = getFonts(theme);
|
|
12
|
+
const radius = props.radius ?? H / 2;
|
|
13
|
+
const children = [
|
|
14
|
+
{
|
|
15
|
+
id: `${id}-glass`, type: 'shape', shape: 'rectangle', x: W / 2, y: H / 2, x_anchor: '50%', y_anchor: '50%', width: W, height: H,
|
|
16
|
+
border_radius: radius, fill_color: '#ffffff',
|
|
17
|
+
effects: [{ type: 'glass', blur_radius: props.blur ?? 8, refraction: 14, edge_highlight: 1, tint: palette.accent }],
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
if (label) {
|
|
21
|
+
children.push({
|
|
22
|
+
id: `${id}-label`, type: 'text', text: label, x: W / 2, y: H / 2, x_anchor: '50%', y_anchor: '50%',
|
|
23
|
+
font_family: fonts.sans, font_size: props.labelSize ?? 22, font_weight: '700', fill_color: palette.text,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
id, type: 'group', layer, time, duration, x, y, x_anchor: '50%', y_anchor: '50%', width: W, height: H,
|
|
28
|
+
animations: [{ type: 'scale-in', duration: 0.5, easing: 'ease-out-back' }, { type: 'fade-in', duration: 0.4 }, { type: 'fade-out', time: 'end', duration: 0.4 }],
|
|
29
|
+
elements: assignLayers(children),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=glass-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glass-panel.js","sourceRoot":"","sources":["../src/glass-panel.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,EAAE;AACF,gDAAgD;AAGhD,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAkC,MAAM,YAAY,CAAC;AAuBlF,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACrF,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,I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,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;QACrG,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChK,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Element, PathGradient, PathDef } from '@clipkit/protocol';
|
|
2
|
+
import { type ColorName, type ThemeName } from './theme.js';
|
|
3
|
+
export interface HeaderBarProps {
|
|
4
|
+
/** Used as the id prefix for every produced element. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Scene title shown in the header center-left. */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Optional right-aligned date range string. */
|
|
9
|
+
dateRange?: string;
|
|
10
|
+
/** Body fill color slot (drives the lower 80% of the canvas). */
|
|
11
|
+
bodyColor: ColorName;
|
|
12
|
+
theme?: ThemeName;
|
|
13
|
+
/** Composition width + height. */
|
|
14
|
+
canvasWidth: number;
|
|
15
|
+
canvasHeight: number;
|
|
16
|
+
/**
|
|
17
|
+
* Optional logo definition. If supplied, the pattern emits an SVG
|
|
18
|
+
* element on the left of the header.
|
|
19
|
+
*/
|
|
20
|
+
logo?: {
|
|
21
|
+
viewBox: [number, number, number, number];
|
|
22
|
+
paths: PathDef[];
|
|
23
|
+
gradients?: PathGradient[];
|
|
24
|
+
/** Logo width in canvas px. Default 220. */
|
|
25
|
+
width?: number;
|
|
26
|
+
};
|
|
27
|
+
time: number;
|
|
28
|
+
duration: number;
|
|
29
|
+
/**
|
|
30
|
+
* Starting layer index. The pattern uses layerBase..layerBase+4 (body,
|
|
31
|
+
* header bg, logo, title, date).
|
|
32
|
+
*/
|
|
33
|
+
layerBase: number;
|
|
34
|
+
}
|
|
35
|
+
export declare function headerBar(props: HeaderBarProps): Element[];
|
|
36
|
+
//# sourceMappingURL=header-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-bar.d.ts","sourceRoot":"","sources":["../src/header-bar.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElF,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE;QACL,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,KAAK,EAAE,OAAO,EAAE,CAAC;QACjB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;QAC3B,4CAA4C;QAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,EAAE,CA4G1D"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// HeaderBar — the scene framing used in dashboard-style videos: a
|
|
2
|
+
// colored body fill, a white header strip with a left-aligned logo, a
|
|
3
|
+
// centered title, and a right-aligned date range.
|
|
4
|
+
//
|
|
5
|
+
// The pattern emits the body fill + header background + title + date.
|
|
6
|
+
// The logo is BYO — pass an SVG definition (viewBox + paths + optional
|
|
7
|
+
// gradients) and the pattern lays it out on the left of the header.
|
|
8
|
+
import { getFonts, getPalette } from './theme.js';
|
|
9
|
+
export function headerBar(props) {
|
|
10
|
+
const { id, title, dateRange, bodyColor, canvasWidth: W, canvasHeight: H, logo, time, duration, layerBase, } = props;
|
|
11
|
+
const theme = props.theme ?? 'mux';
|
|
12
|
+
const palette = getPalette(theme, bodyColor);
|
|
13
|
+
const grayPalette = getPalette(theme, 'gray');
|
|
14
|
+
const fonts = getFonts(theme);
|
|
15
|
+
const HEADER_H = 216; // 20 % of a 1080-tall canvas; tweak if scaling
|
|
16
|
+
const out = [];
|
|
17
|
+
// Colored body fill (below the header).
|
|
18
|
+
out.push({
|
|
19
|
+
id: `${id}-body`,
|
|
20
|
+
type: 'shape',
|
|
21
|
+
layer: layerBase,
|
|
22
|
+
time,
|
|
23
|
+
duration,
|
|
24
|
+
shape: 'rectangle',
|
|
25
|
+
x: W / 2,
|
|
26
|
+
y: HEADER_H + (H - HEADER_H) / 2,
|
|
27
|
+
x_anchor: '50%',
|
|
28
|
+
y_anchor: '50%',
|
|
29
|
+
width: W,
|
|
30
|
+
height: H - HEADER_H,
|
|
31
|
+
fill_color: palette.bg,
|
|
32
|
+
});
|
|
33
|
+
// White header background.
|
|
34
|
+
out.push({
|
|
35
|
+
id: `${id}-header-bg`,
|
|
36
|
+
type: 'shape',
|
|
37
|
+
layer: layerBase + 1,
|
|
38
|
+
time,
|
|
39
|
+
duration,
|
|
40
|
+
shape: 'rectangle',
|
|
41
|
+
x: W / 2,
|
|
42
|
+
y: HEADER_H / 2,
|
|
43
|
+
x_anchor: '50%',
|
|
44
|
+
y_anchor: '50%',
|
|
45
|
+
width: W,
|
|
46
|
+
height: HEADER_H,
|
|
47
|
+
fill_color: '#ffffff',
|
|
48
|
+
});
|
|
49
|
+
// Logo on the left of the header.
|
|
50
|
+
if (logo) {
|
|
51
|
+
const logoW = logo.width ?? 220;
|
|
52
|
+
const logoAspect = logo.viewBox[3] / logo.viewBox[2];
|
|
53
|
+
out.push({
|
|
54
|
+
id: `${id}-logo`,
|
|
55
|
+
type: 'shape',
|
|
56
|
+
layer: layerBase + 2,
|
|
57
|
+
time,
|
|
58
|
+
duration,
|
|
59
|
+
x: 80,
|
|
60
|
+
y: HEADER_H / 2,
|
|
61
|
+
x_anchor: 0,
|
|
62
|
+
y_anchor: 0.5,
|
|
63
|
+
width: logoW,
|
|
64
|
+
height: logoW * logoAspect,
|
|
65
|
+
view_box: logo.viewBox,
|
|
66
|
+
paths: logo.paths,
|
|
67
|
+
...(logo.gradients ? { gradients: logo.gradients } : {}),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// Scene title — left-aligned, sits right of the logo.
|
|
71
|
+
out.push({
|
|
72
|
+
id: `${id}-title`,
|
|
73
|
+
type: 'text',
|
|
74
|
+
layer: layerBase + 3,
|
|
75
|
+
time,
|
|
76
|
+
duration,
|
|
77
|
+
text: title,
|
|
78
|
+
x: 380,
|
|
79
|
+
y: HEADER_H / 2,
|
|
80
|
+
x_anchor: 0,
|
|
81
|
+
font_family: fonts.sans,
|
|
82
|
+
font_size: 36,
|
|
83
|
+
font_weight: '400',
|
|
84
|
+
fill_color: '#383838',
|
|
85
|
+
animations: [{ type: 'fade-in', duration: 1.0 }],
|
|
86
|
+
});
|
|
87
|
+
// Date range — right-aligned.
|
|
88
|
+
if (dateRange) {
|
|
89
|
+
out.push({
|
|
90
|
+
id: `${id}-date`,
|
|
91
|
+
type: 'text',
|
|
92
|
+
layer: layerBase + 4,
|
|
93
|
+
time,
|
|
94
|
+
duration,
|
|
95
|
+
text: dateRange,
|
|
96
|
+
x: W - 80,
|
|
97
|
+
y: HEADER_H / 2,
|
|
98
|
+
x_anchor: 1,
|
|
99
|
+
font_family: fonts.sans,
|
|
100
|
+
font_size: 28,
|
|
101
|
+
font_weight: '400',
|
|
102
|
+
fill_color: grayPalette.accent,
|
|
103
|
+
animations: [{ type: 'fade-in', duration: 1.0 }],
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=header-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-bar.js","sourceRoot":"","sources":["../src/header-bar.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,sEAAsE;AACtE,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,uEAAuE;AACvE,oEAAoE;AAGpE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAkC,MAAM,YAAY,CAAC;AAmClF,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EACJ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAChE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,GAChC,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9B,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,+CAA+C;IACrE,MAAM,GAAG,GAAc,EAAE,CAAC;IAE1B,wCAAwC;IACxC,GAAG,CAAC,IAAI,CAAC;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M;YAC9B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;SACjD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Element } from '@clipkit/protocol';
|
|
2
|
+
import { type ColorName, type ThemeName } from './theme.js';
|
|
3
|
+
export interface HeroRevealProps {
|
|
4
|
+
id: string;
|
|
5
|
+
/** The wordmark — set in the theme's display (serif) face. */
|
|
6
|
+
wordmark: string;
|
|
7
|
+
tagline?: string;
|
|
8
|
+
color: ColorName;
|
|
9
|
+
theme?: ThemeName;
|
|
10
|
+
canvasWidth: number;
|
|
11
|
+
canvasHeight: number;
|
|
12
|
+
time: number;
|
|
13
|
+
duration: number;
|
|
14
|
+
layer: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function heroReveal(props: HeroRevealProps): Element;
|
|
17
|
+
//# sourceMappingURL=hero-reveal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero-reveal.d.ts","sourceRoot":"","sources":["../src/hero-reveal.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAwC1D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// heroReveal — a cinematic logo reveal: a soft accent glow, a refractive
|
|
2
|
+
// glass orb, and a serif wordmark with a tagline. The premium opener.
|
|
3
|
+
//
|
|
4
|
+
// COMPONENT pattern: returns ONE plain `group` (children draw in order so
|
|
5
|
+
// the glass orb refracts the glow beneath it; the wordmark sits on top).
|
|
6
|
+
import { assignLayers } from './layers.js';
|
|
7
|
+
import { getFonts, getPalette } from './theme.js';
|
|
8
|
+
export function heroReveal(props) {
|
|
9
|
+
const { id, wordmark, tagline, color, canvasWidth: W, canvasHeight: H, time, duration, layer } = props;
|
|
10
|
+
const theme = props.theme ?? 'cinematic';
|
|
11
|
+
const palette = getPalette(theme, color);
|
|
12
|
+
const fonts = getFonts(theme);
|
|
13
|
+
const cx = W / 2, cy = H / 2;
|
|
14
|
+
const children = [
|
|
15
|
+
// accent glow forming behind the orb
|
|
16
|
+
{
|
|
17
|
+
id: `${id}-glow`, type: 'shape', shape: 'ellipse', x: cx, y: cy, x_anchor: '50%', y_anchor: '50%', width: 600, height: 600, opacity: 0.5,
|
|
18
|
+
gradient: { type: 'radial', cx: 0.5, cy: 0.5, radius: 0.5, stops: [{ offset: 0, color: palette.accent }, { offset: 1, color: palette.bg }] },
|
|
19
|
+
animations: [{ type: 'scale-in', duration: 1.6, easing: 'ease-out' }],
|
|
20
|
+
},
|
|
21
|
+
// refractive glass orb (reads the glow as backdrop)
|
|
22
|
+
{
|
|
23
|
+
id: `${id}-orb`, type: 'shape', shape: 'ellipse', x: cx, y: cy, x_anchor: '50%', y_anchor: '50%', width: 300, height: 300, fill_color: '#ffffff',
|
|
24
|
+
time: 0.3, animations: [{ type: 'fade-in', duration: 0.6 }],
|
|
25
|
+
effects: [{ type: 'glass', mode: 'dome', edge_width: 130, refraction: 22, dispersion: 5 }],
|
|
26
|
+
},
|
|
27
|
+
// serif wordmark
|
|
28
|
+
{
|
|
29
|
+
id: `${id}-wordmark`, type: 'text', text: wordmark, x: cx, y: cy - 4, x_anchor: '50%', y_anchor: '50%', time: 0.55,
|
|
30
|
+
font_family: fonts.display, font_size: 96, font_weight: '700', letter_spacing: 8, fill_color: palette.text,
|
|
31
|
+
animations: [{ type: 'scale-in', duration: 1.0, easing: 'ease-out' }, { type: 'fade-in', duration: 0.6 }],
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
if (tagline) {
|
|
35
|
+
children.push({
|
|
36
|
+
id: `${id}-tagline`, type: 'text', text: tagline, x: cx, y: cy + 86, x_anchor: '50%', y_anchor: '50%', time: 1.1,
|
|
37
|
+
font_family: fonts.sans, font_size: 26, letter_spacing: 2, fill_color: palette.textMuted,
|
|
38
|
+
animations: [{ type: 'fade-in', duration: 0.6 }],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
id, type: 'group', layer, time, duration, x: 0, y: 0, width: W, height: H,
|
|
43
|
+
animations: [{ type: 'fade-out', time: 'end', duration: 0.5 }],
|
|
44
|
+
elements: assignLayers(children),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=hero-reveal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero-reveal.js","sourceRoot":"","sources":["../src/hero-reveal.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,sEAAsE;AACtE,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AAGzE,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAkC,MAAM,YAAY,CAAC;AAgBlF,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EA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,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,SAAS;YACxF,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;SACjD,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;QACzE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;QAC9D,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { headerBar, type HeaderBarProps } from './header-bar.js';
|
|
2
|
+
export { statBlock, type StatBlockProps } from './stat-block.js';
|
|
3
|
+
export { barChartRow, type BarChartRowProps } from './bar-chart-row.js';
|
|
4
|
+
export { rankedList, type RankedListItem, type RankedListProps } from './ranked-list.js';
|
|
5
|
+
export { pieCard, type PieCardProps } from './pie-card.js';
|
|
6
|
+
export { statsScene, barsScene, rankingScene, pieScene, type StatsSceneProps, type BarsSceneProps, type RankingSceneProps, type PieSceneProps, type StatItem, type BarItem, type PieItem, } from './data-scenes.js';
|
|
7
|
+
export { liquidMorph, type LiquidMorphProps, type MorphShape } from './liquid-morph.js';
|
|
8
|
+
export { introCard, type IntroCardProps } from './intro-card.js';
|
|
9
|
+
export { lowerThird, type LowerThirdProps } from './lower-third.js';
|
|
10
|
+
export { tiltedShowcase, type TiltedShowcaseProps } from './tilted-showcase.js';
|
|
11
|
+
export { cameraOrbit, type CameraOrbitProps } from './camera-orbit.js';
|
|
12
|
+
export { litSurface, type LitSurfaceProps } from './lit-surface.js';
|
|
13
|
+
export { heroReveal, type HeroRevealProps } from './hero-reveal.js';
|
|
14
|
+
export { glassPanel, type GlassPanelProps } from './glass-panel.js';
|
|
15
|
+
export { ctaOutro, type CtaOutroProps } from './cta-outro.js';
|
|
16
|
+
export { kineticHeadline, type KineticHeadlineProps } from './kinetic-headline.js';
|
|
17
|
+
export { promo, type PromoOptions, type Scene, type SceneCtx } from './promo.js';
|
|
18
|
+
export { trendPill, trendPct, type TrendPillProps } from './trend-pill.js';
|
|
19
|
+
export { pulseToTempo, accentOnBeats, snapToBeat, revealOnBeat, slideOnBeat, type PulseToTempoOptions, type AccentOnBeatsOptions, type RevealOnBeatOptions, type SlideOnBeatOptions, } from './beat-sync.js';
|
|
20
|
+
export { THEMES, getPalette, getFonts, type ThemeName, type ColorName, type ColorPalette, type Theme, } from './theme.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAI3D,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,OAAO,GACb,MAAM,kBAAkB,CAAC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/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @clipkit/patterns — authoring-time pattern library.
|
|
2
|
+
//
|
|
3
|
+
// Patterns are TypeScript functions that take params + a theme and emit
|
|
4
|
+
// arrays of primitive Clipkit Source elements. They are NOT a runtime
|
|
5
|
+
// concept: the resulting Source JSON references only the primitives
|
|
6
|
+
// declared in @clipkit/protocol. The runtime never sees a "pattern".
|
|
7
|
+
//
|
|
8
|
+
// Model mirrors shadcn/ui — copy the pattern source if you need a custom
|
|
9
|
+
// look, don't pile on parameters.
|
|
10
|
+
export { headerBar } from './header-bar.js';
|
|
11
|
+
export { statBlock } from './stat-block.js';
|
|
12
|
+
export { barChartRow } from './bar-chart-row.js';
|
|
13
|
+
export { rankedList } from './ranked-list.js';
|
|
14
|
+
export { pieCard } from './pie-card.js';
|
|
15
|
+
// Data-viz SCENES — full-frame compositions (headerBar + data patterns) that
|
|
16
|
+
// promo() can sequence, so "make me a stats / chart / top-10 video" works.
|
|
17
|
+
export { statsScene, barsScene, rankingScene, pieScene, } from './data-scenes.js';
|
|
18
|
+
// liquidMorph — shape → travelling path → shape, with liquid blob in-betweens
|
|
19
|
+
// (the Transition Tour morph, generalized).
|
|
20
|
+
export { liquidMorph } from './liquid-morph.js';
|
|
21
|
+
// Component patterns — each returns ONE `group` element (move / animate /
|
|
22
|
+
// time-remap the whole unit) that expands to plain primitives. This is
|
|
23
|
+
// the protocol's "pre-comp" answer: reuse lives in authoring functions,
|
|
24
|
+
// not in a schema element.
|
|
25
|
+
export { introCard } from './intro-card.js';
|
|
26
|
+
export { lowerThird } from './lower-third.js';
|
|
27
|
+
export { tiltedShowcase } from './tilted-showcase.js';
|
|
28
|
+
export { cameraOrbit } from './camera-orbit.js';
|
|
29
|
+
export { litSurface } from './lit-surface.js';
|
|
30
|
+
// Cinematic patterns (dark theme) + the Source-level composer.
|
|
31
|
+
export { heroReveal } from './hero-reveal.js';
|
|
32
|
+
export { glassPanel } from './glass-panel.js';
|
|
33
|
+
export { ctaOutro } from './cta-outro.js';
|
|
34
|
+
export { kineticHeadline } from './kinetic-headline.js';
|
|
35
|
+
export { promo } from './promo.js';
|
|
36
|
+
// Internal helper, exported so callers can use it directly when they
|
|
37
|
+
// don't want a full StatBlock / BarChartRow.
|
|
38
|
+
export { trendPill, trendPct } from './trend-pill.js';
|
|
39
|
+
// Beat-sync — map a @clipkit/music-analysis BeatMap onto motion.
|
|
40
|
+
export { pulseToTempo, accentOnBeats, snapToBeat, revealOnBeat, slideOnBeat, } from './beat-sync.js';
|
|
41
|
+
// Theme primitives.
|
|
42
|
+
export { THEMES, getPalette, getFonts, } from './theme.js';
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,oEAAoE;AACpE,qEAAqE;AACrE,EAAE;AACF,yEAAyE;AACzE,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAuB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAuB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAyB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,UAAU,EAA6C,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,OAAO,EAAqB,MAAM,eAAe,CAAC;AAE3D,6EAA6E;AAC7E,2EAA2E;AAC3E,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,GAQT,MAAM,kBAAkB,CAAC;AAE1B,8EAA8E;AAC9E,4CAA4C;AAC5C,OAAO,EAAE,WAAW,EAA0C,MAAM,mBAAmB,CAAC;AAExF,0EAA0E;AAC1E,uEAAuE;AACvE,wEAAwE;AACxE,2BAA2B;AAC3B,OAAO,EAAE,SAAS,EAAuB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAA4B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AAEpE,+DAA+D;AAC/D,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAsB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAA6B,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,KAAK,EAAgD,MAAM,YAAY,CAAC;AAEjF,qEAAqE;AACrE,6CAA6C;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAuB,MAAM,iBAAiB,CAAC;AAE3E,iEAAiE;AACjE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,GAKZ,MAAM,gBAAgB,CAAC;AAExB,oBAAoB;AACpB,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,GAKT,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Element } from '@clipkit/protocol';
|
|
2
|
+
import { type ColorName, type ThemeName } from './theme.js';
|
|
3
|
+
export interface IntroCardProps {
|
|
4
|
+
/** Used as the id prefix for every produced element. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Big headline, the card's one job. */
|
|
7
|
+
headline: string;
|
|
8
|
+
/** Small all-caps line above the headline (e.g. a brand or series name). */
|
|
9
|
+
kicker?: string;
|
|
10
|
+
/** Supporting line under the headline. */
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
/** Accent color slot — drives the backdrop tint and the rule. */
|
|
13
|
+
color: ColorName;
|
|
14
|
+
theme?: ThemeName;
|
|
15
|
+
/** Composition width + height — the card fills the frame. */
|
|
16
|
+
canvasWidth: number;
|
|
17
|
+
canvasHeight: number;
|
|
18
|
+
time: number;
|
|
19
|
+
duration: number;
|
|
20
|
+
layer: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function introCard(props: IntroCardProps): Element;
|
|
23
|
+
//# sourceMappingURL=intro-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intro-card.d.ts","sourceRoot":"","sources":["../src/intro-card.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElF,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAwHxD"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// IntroCard — a full-frame opening title: themed backdrop, an accent
|
|
2
|
+
// rule, a big headline, and an optional kicker + subtitle, with
|
|
3
|
+
// entrance/exit animation built in.
|
|
4
|
+
//
|
|
5
|
+
// This is a COMPONENT pattern: it returns a single `group` element so
|
|
6
|
+
// the whole card moves, fades, or time-remaps as one unit — and it
|
|
7
|
+
// expands to nothing but plain primitives. Reuse lives here in the
|
|
8
|
+
// authoring function, not in the schema (there is no nested-composition
|
|
9
|
+
// element; nested timing is `time_remap` on a plain group, §5.8.3).
|
|
10
|
+
import { assignLayers } from './layers.js';
|
|
11
|
+
import { getFonts, getPalette } from './theme.js';
|
|
12
|
+
export function introCard(props) {
|
|
13
|
+
const { id, headline, kicker, subtitle, color, canvasWidth: W, canvasHeight: H, time, duration, layer, } = props;
|
|
14
|
+
const theme = props.theme ?? 'mux';
|
|
15
|
+
const palette = getPalette(theme, color);
|
|
16
|
+
const fonts = getFonts(theme);
|
|
17
|
+
const cy = H / 2;
|
|
18
|
+
const children = [];
|
|
19
|
+
// Full-frame backdrop tint.
|
|
20
|
+
children.push({
|
|
21
|
+
id: `${id}-bg`,
|
|
22
|
+
type: 'shape',
|
|
23
|
+
shape: 'rectangle',
|
|
24
|
+
x: 0,
|
|
25
|
+
y: 0,
|
|
26
|
+
width: W,
|
|
27
|
+
height: H,
|
|
28
|
+
fill_color: palette.bg,
|
|
29
|
+
});
|
|
30
|
+
if (kicker) {
|
|
31
|
+
children.push({
|
|
32
|
+
id: `${id}-kicker`,
|
|
33
|
+
type: 'text',
|
|
34
|
+
time: 0.15,
|
|
35
|
+
text: kicker.toUpperCase(),
|
|
36
|
+
x: W / 2,
|
|
37
|
+
y: cy - 130,
|
|
38
|
+
x_anchor: '50%',
|
|
39
|
+
y_anchor: '50%',
|
|
40
|
+
font_family: fonts.mono,
|
|
41
|
+
font_size: 30,
|
|
42
|
+
letter_spacing: 6,
|
|
43
|
+
fill_color: palette.accentDark,
|
|
44
|
+
animations: [{ type: 'fade-in', duration: 0.5 }],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
children.push({
|
|
48
|
+
id: `${id}-headline`,
|
|
49
|
+
type: 'text',
|
|
50
|
+
time: 0.25,
|
|
51
|
+
text: headline,
|
|
52
|
+
x: W / 2,
|
|
53
|
+
y: cy - 30,
|
|
54
|
+
x_anchor: '50%',
|
|
55
|
+
y_anchor: '50%',
|
|
56
|
+
font_family: fonts.sans,
|
|
57
|
+
font_size: 96,
|
|
58
|
+
font_weight: '700',
|
|
59
|
+
fill_color: palette.text,
|
|
60
|
+
animations: [{ type: 'fade-in', duration: 0.6 }],
|
|
61
|
+
// Gentle 40px rise (the slide-up-in preset's fixed 200px is too much
|
|
62
|
+
// for a headline already in frame).
|
|
63
|
+
keyframe_animations: [{
|
|
64
|
+
property: 'y',
|
|
65
|
+
keyframes: [
|
|
66
|
+
{ time: 0, value: cy - 30 + 40 },
|
|
67
|
+
{ time: 0.6, value: cy - 30, easing: 'ease-out' },
|
|
68
|
+
],
|
|
69
|
+
}],
|
|
70
|
+
});
|
|
71
|
+
// Accent rule under the headline, drawn with a scale-from-center wipe.
|
|
72
|
+
children.push({
|
|
73
|
+
id: `${id}-rule`,
|
|
74
|
+
type: 'shape',
|
|
75
|
+
time: 0.55,
|
|
76
|
+
shape: 'rectangle',
|
|
77
|
+
x: W / 2,
|
|
78
|
+
y: cy + 50,
|
|
79
|
+
x_anchor: '50%',
|
|
80
|
+
y_anchor: '50%',
|
|
81
|
+
width: 220,
|
|
82
|
+
height: 8,
|
|
83
|
+
border_radius: 4,
|
|
84
|
+
fill_color: palette.accent,
|
|
85
|
+
keyframe_animations: [{
|
|
86
|
+
property: 'x_scale',
|
|
87
|
+
keyframes: [
|
|
88
|
+
{ time: 0, value: 0 },
|
|
89
|
+
{ time: 0.45, value: 1, easing: 'ease-out' },
|
|
90
|
+
],
|
|
91
|
+
}],
|
|
92
|
+
});
|
|
93
|
+
if (subtitle) {
|
|
94
|
+
children.push({
|
|
95
|
+
id: `${id}-subtitle`,
|
|
96
|
+
type: 'text',
|
|
97
|
+
time: 0.7,
|
|
98
|
+
text: subtitle,
|
|
99
|
+
x: W / 2,
|
|
100
|
+
y: cy + 120,
|
|
101
|
+
x_anchor: '50%',
|
|
102
|
+
y_anchor: '50%',
|
|
103
|
+
font_family: fonts.sans,
|
|
104
|
+
font_size: 38,
|
|
105
|
+
fill_color: palette.textMuted,
|
|
106
|
+
animations: [{ type: 'fade-in', duration: 0.6 }],
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
id,
|
|
111
|
+
type: 'group',
|
|
112
|
+
layer,
|
|
113
|
+
time,
|
|
114
|
+
duration,
|
|
115
|
+
x: 0,
|
|
116
|
+
y: 0,
|
|
117
|
+
width: W,
|
|
118
|
+
height: H,
|
|
119
|
+
animations: [{ type: 'fade-out', time: 'end', duration: 0.5 }],
|
|
120
|
+
elements: assignLayers(children),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=intro-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intro-card.js","sourceRoot":"","sources":["../src/intro-card.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,gEAAgE;AAChE,oCAAoC;AACpC,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,mEAAmE;AACnE,wEAAwE;AACxE,oEAAoE;AAGpE,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAkC,MAAM,YAAY,CAAC;AAsBlF,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EACJ,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EACrC,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,GACvD,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9B,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjB,MAAM,QAAQ,GAAuB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AAG,GAAG;YACX,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,KAAK,CAAC,IAAI;YACvB,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,OAAO,CAAC,SAAS;YAC7B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;SACjD,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,EAAE;QACF,IAAI,EAAE,OAAO;QACb,KAAK;QACL,IAAI;QACJ,QAAQ;QACR,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;QAC9D,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Element } from '@clipkit/protocol';
|
|
2
|
+
import { type ColorName, type ThemeName } from './theme.js';
|
|
3
|
+
export interface KineticHeadlineProps {
|
|
4
|
+
id: string;
|
|
5
|
+
text: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
color: ColorName;
|
|
8
|
+
theme?: ThemeName;
|
|
9
|
+
canvasWidth: number;
|
|
10
|
+
canvasHeight: number;
|
|
11
|
+
/** Stagger between letters, seconds. Default 0.05. */
|
|
12
|
+
stagger?: number;
|
|
13
|
+
time: number;
|
|
14
|
+
duration: number;
|
|
15
|
+
layer: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function kineticHeadline(props: KineticHeadlineProps): Element;
|
|
18
|
+
//# sourceMappingURL=kinetic-headline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kinetic-headline.d.ts","sourceRoot":"","sources":["../src/kinetic-headline.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElF,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAgCpE"}
|