@vosjs/studio-core 0.6.0 → 0.7.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/dist/index.d.ts +9 -0
- package/dist/index.js +31 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -922,6 +922,15 @@ interface EndCard {
|
|
|
922
922
|
headline?: string;
|
|
923
923
|
sub?: string;
|
|
924
924
|
wordmark?: string;
|
|
925
|
+
/**
|
|
926
|
+
* The brand's MARK as an image (a take-dir path or a URL the render page
|
|
927
|
+
* can load), with its aspect (width over height), drawn above the
|
|
928
|
+
* wordmark; a wide mark (a stylised wordmark asset) stands alone.
|
|
929
|
+
*/
|
|
930
|
+
mark?: {
|
|
931
|
+
key: string;
|
|
932
|
+
aspect: number;
|
|
933
|
+
};
|
|
925
934
|
/**
|
|
926
935
|
* The words' colour (any CSS colour). The house presets are white for
|
|
927
936
|
* footage; over a light plate the brand's ink is what reads. Absent =
|
package/dist/index.js
CHANGED
|
@@ -2859,8 +2859,37 @@ function expandEndCard(doc, outputDuration) {
|
|
|
2859
2859
|
clips.push(text("endcard-title", card.headline.trim(), "title", 0.44, 0.35));
|
|
2860
2860
|
if (card.sub?.trim())
|
|
2861
2861
|
clips.push(text("endcard-sub", card.sub.trim(), "caption", 0.57, 0.5));
|
|
2862
|
-
|
|
2863
|
-
|
|
2862
|
+
const mark = card.mark;
|
|
2863
|
+
const wide = !!mark && mark.aspect > 2.2;
|
|
2864
|
+
if (mark && mark.key) {
|
|
2865
|
+
const size = resolveExportSize(doc);
|
|
2866
|
+
const designW = 1080 * size.width / Math.max(1, size.height);
|
|
2867
|
+
const hPx = wide ? 44 : 30;
|
|
2868
|
+
const clip = {
|
|
2869
|
+
id: "endcard-markimg",
|
|
2870
|
+
kind: "image",
|
|
2871
|
+
key: mark.key,
|
|
2872
|
+
width: Math.min(0.9, hPx * Math.max(0.2, mark.aspect) / designW),
|
|
2873
|
+
radius: 0,
|
|
2874
|
+
shadow: "none",
|
|
2875
|
+
start: endStart + 0.65,
|
|
2876
|
+
duration: Math.max(0.3, seconds - 0.65),
|
|
2877
|
+
transform: { x: 0.5, y: wide ? 0.88 : 0.835, scale: 1, rotation: 0 },
|
|
2878
|
+
enter: "rise",
|
|
2879
|
+
exit: "none"
|
|
2880
|
+
};
|
|
2881
|
+
clips.push(clip);
|
|
2882
|
+
}
|
|
2883
|
+
if (card.wordmark?.trim() && !wide)
|
|
2884
|
+
clips.push(
|
|
2885
|
+
text(
|
|
2886
|
+
"endcard-mark",
|
|
2887
|
+
card.wordmark.trim(),
|
|
2888
|
+
"label",
|
|
2889
|
+
mark && mark.key ? 0.895 : 0.88,
|
|
2890
|
+
0.65
|
|
2891
|
+
)
|
|
2892
|
+
);
|
|
2864
2893
|
const overlays = [...doc.overlays ?? [], ...clips];
|
|
2865
2894
|
return { doc: { ...doc, segments, overlays }, endStart, seconds };
|
|
2866
2895
|
}
|