@zync/zync-screnplay-player 0.1.187
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/ZyncScreenplayPlayer.js +35 -0
- package/dist/bundle.js +2 -0
- package/dist/bundle.js.LICENSE.txt +54 -0
- package/dist/index.js +4 -0
- package/dist/screenplay/RemotionRenderer/RemotionRenderer.js +281 -0
- package/dist/screenplay/RemotionRenderer/Root.js +22 -0
- package/dist/screenplay/RemotionRenderer/components/LottieAnimationGlobal.js +116 -0
- package/dist/screenplay/RemotionRenderer/components/backgrounds/VirtualBackground.js +26 -0
- package/dist/screenplay/RemotionRenderer/components/backgrounds/VirtualBackgroundUnderlay.js +41 -0
- package/dist/screenplay/RemotionRenderer/components/captions/CaptionSimple.js +12 -0
- package/dist/screenplay/RemotionRenderer/components/effects/BrollFullscreen.js +27 -0
- package/dist/screenplay/RemotionRenderer/components/effects/GlitchText.js +22 -0
- package/dist/screenplay/RemotionRenderer/components/effects/HandoffNametag.js +7 -0
- package/dist/screenplay/RemotionRenderer/components/effects/LottieAnimation.js +64 -0
- package/dist/screenplay/RemotionRenderer/components/effects/Nametag.js +9 -0
- package/dist/screenplay/RemotionRenderer/components/effects/PhraseRainbowEffect.js +34 -0
- package/dist/screenplay/RemotionRenderer/components/effects/Sentence.js +50 -0
- package/dist/screenplay/RemotionRenderer/components/effects/Title.js +12 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/BrollGreenScreen.js +742 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/BrollSplitScreen.js +714 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/BrollStudioBackdrop.js +620 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/DynamicTriangle.js +618 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/Handoff.js +161 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/IntroVideo.js +1330 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/KeyPointOverlayDepth.js +397 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/Keyword.js +539 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/KeywordStudioBackdrop.js +714 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStill.js +381 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStillFullScreen.js +178 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStillGreenScreen.js +568 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStillGreenScreenV2.js +731 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStillStudioBackdrop.js +588 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/SimpleFrame.js +183 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/SimpleFrameBroll.js +181 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/SimpleFrameSentence.js +17 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/SimpleFrameZoomCut.js +13 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/TextWithVideo.js +373 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/quote-bubble-animation.json +1 -0
- package/dist/screenplay/RemotionRenderer/components/utils/BlurOverlay.js +19 -0
- package/dist/screenplay/RemotionRenderer/components/utils/ChromaKeyedVideo.js +59 -0
- package/dist/screenplay/RemotionRenderer/components/utils/FaceCenteredVideo.js +562 -0
- package/dist/screenplay/RemotionRenderer/components/utils/PausableImg.js +124 -0
- package/dist/screenplay/RemotionRenderer/components/utils/README.md +80 -0
- package/dist/screenplay/RemotionRenderer/components/utils/SafeZones.js +69 -0
- package/dist/screenplay/RemotionRenderer/components/utils/StretchText.js +124 -0
- package/dist/screenplay/RemotionRenderer/components/utils/StretchTextDemo.js +66 -0
- package/dist/screenplay/RemotionRenderer/config.js +8 -0
- package/dist/screenplay/RemotionRenderer/development.js +1370 -0
- package/dist/screenplay/RemotionRenderer/helpers/cleanFacemetadata.js +29 -0
- package/dist/screenplay/RemotionRenderer/helpers/convertToSeconds.js +14 -0
- package/dist/screenplay/RemotionRenderer/helpers/faceBasedVideoStyles.js +212 -0
- package/dist/screenplay/RemotionRenderer/helpers/faceCenteredVideoTransforms.js +468 -0
- package/dist/screenplay/RemotionRenderer/helpers/getContrastColor.js +15 -0
- package/dist/screenplay/RemotionRenderer/helpers/getVideoOrientation.js +21 -0
- package/dist/screenplay/RemotionRenderer/helpers/hexToRgb.js +48 -0
- package/dist/screenplay/RemotionRenderer/hooks/useLottieReplaceColor.js +45 -0
- package/dist/screenplay/RemotionRenderer/hooks/useOrientationBased.js +29 -0
- package/dist/screenplay/RemotionRenderer/hooks/useTimeInterpolate.js +54 -0
- package/dist/screenplay/RemotionRenderer/hooks/useVirtualBackground.js +38 -0
- package/dist/screenplay/RemotionRenderer/index.js +3 -0
- package/dist/screenplay/RemotionRenderer/main/lib/Sequence.js +76 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/DefaultLayout.js +72 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/DynamicTriangleLayout.js +54 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/HandoffLayout.js +50 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/IntroVideoLayout.js +33 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/KeywordLayout.js +36 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/LayoutFactory.js +68 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/MotionStillLayout.js +36 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/SimpleFrameLayout.js +43 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/TextWithVideoLayout.js +52 -0
- package/dist/screenplay/RemotionRenderer/main/screenplaySchema.js +92 -0
- package/dist/screenplay/RemotionRenderer/registeredComponents.js +91 -0
- package/dist/screenplay/RemotionRenderer/theme/config.js +8 -0
- package/dist/screenplay/RemotionRenderer/theme/hooks/useTheme.js +24 -0
- package/dist/screenplay/RemotionRenderer/theme/hooks/useThemedComponents.js +101 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/bigbold/BigBoldNameTag.js +147 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/bigbold/BigBoldSentence.js +138 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/bigbold/BigBoldTitle.js +136 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionColor.js +67 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionColorInverse.js +67 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionColorShadow.js +66 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionElegant.js +134 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionEmphasis.js +122 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionPunctuated.js +84 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionWordBoom.js +88 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionWordBubble.js +91 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionWordPopup.js +118 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/DefaultCaption.js +62 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/HandoffNametag/handoffNametagConfig.js +59 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/HandoffNametag.js +173 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Nametag.js +129 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Sentence/AnimatedSentence.js +20 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Sentence/AnimatedSentenceDefault.js +29 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Sentence/SentenceSimple.helpers.js +61 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Sentence.js +86 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Title.js +112 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/default/constants.js +1 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glassmorphism/Nametag.js +134 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glassmorphism/Sentence.js +49 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glassmorphism/Title.js +108 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glassmorphism/animations.js +30 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glassmorphism/config.js +9 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/GlitchNametag.js +252 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/GlitchSentence.js +156 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/GlitchTitle.js +142 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/components/DisplacedText.js +66 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/components/GlitchAnimatedLine.js +38 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/components/SplitSentence.js +80 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/helpers.js +32 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/none/Nametag.js +3 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/none/Title.js +3 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/pushpull/PushPullNametag.js +165 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/pushpull/PushPullSentence.js +94 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/pushpull/PushPullTitle.js +98 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/pushpull/designs/sentence.js +92 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/pushpull/designs/title.js +119 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/Nametag.js +122 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/SportsCaption.js +93 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/SportsSentence.js +76 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/Title.js +90 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/shared.js +62 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/sportsbounce/Nametag.js +145 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/sportsbounce/SportsBounceSentence.js +148 -0
- package/dist/screenplay/RemotionRenderer/theme/themes/sportsbounce/Title.js +160 -0
- package/dist/screenplay/RemotionRenderer/tracks/AudioTrack.js +23 -0
- package/dist/screenplay/RemotionRenderer/tracks/CaptionsVideoTrack.js +23 -0
- package/dist/screenplay/RemotionRenderer/tracks/DynamicVideoComposition.js +31 -0
- package/dist/screenplay/RemotionRenderer/tracks/EffectsVideoTrack.js +23 -0
- package/dist/screenplay/RemotionRenderer/tracks/LayoutVideoTrack.js +141 -0
- package/dist/screenplay/RemotionRenderer/tracks/Soundtrack.js +16 -0
- package/dist/screenplay/RemotionRenderer/tracks/Watermark.js +23 -0
- package/dist/screenplay/RemotionRenderer/tracks/transitions/GlitchOne.js +92 -0
- package/package.json +45 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { AbsoluteFill, Audio, Easing, OffthreadVideo, useVideoConfig } from "remotion";
|
|
8
|
+
import { loadFont } from "@remotion/google-fonts/Poppins";
|
|
9
|
+
import { useOrientationBased } from "../../hooks/useOrientationBased.js";
|
|
10
|
+
import { distributeTextToFit } from "../../theme/themes/default/Sentence/SentenceSimple.helpers.js";
|
|
11
|
+
import { useTheme } from "../../theme/hooks/useTheme.js";
|
|
12
|
+
import { CHROME_PADDING } from "../../config.js";
|
|
13
|
+
import { useTimeInterpolate } from "../../hooks/useTimeInterpolate.js";
|
|
14
|
+
import { variants } from "../../main/lib/layouts/TextWithVideoLayout.js";
|
|
15
|
+
import FaceCenteredVideo from "../utils/FaceCenteredVideo";
|
|
16
|
+
import PausableImg from "../utils/PausableImg";
|
|
17
|
+
import { BlurOverlay } from "../utils/BlurOverlay";
|
|
18
|
+
import { useVirtualBackground } from "../../hooks/useVirtualBackground";
|
|
19
|
+
import { VirtualBackgroundUnderlay } from "../backgrounds/VirtualBackgroundUnderlay";
|
|
20
|
+
var _loadFont = loadFont(),
|
|
21
|
+
fontFamily = _loadFont.fontFamily;
|
|
22
|
+
var adjustTimings = function adjustTimings(timings, adjustment) {
|
|
23
|
+
return timings.map(function (timing) {
|
|
24
|
+
return timing + adjustment;
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
var indexFactor = function indexFactor(index) {
|
|
28
|
+
return index * 0.15;
|
|
29
|
+
};
|
|
30
|
+
var Logo = function Logo(_ref) {
|
|
31
|
+
var logoUrl = _ref.logoUrl,
|
|
32
|
+
top = _ref.top,
|
|
33
|
+
left = _ref.left,
|
|
34
|
+
right = _ref.right;
|
|
35
|
+
return logoUrl ? /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
style: {
|
|
37
|
+
position: "fixed",
|
|
38
|
+
zIndex: 1,
|
|
39
|
+
top: top,
|
|
40
|
+
left: left,
|
|
41
|
+
right: right
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement(PausableImg, {
|
|
44
|
+
style: {
|
|
45
|
+
width: "225px",
|
|
46
|
+
maxHeight: "auto",
|
|
47
|
+
objectFit: "contain"
|
|
48
|
+
},
|
|
49
|
+
delayRenderTimeoutInMilliseconds: 60000,
|
|
50
|
+
src: logoUrl
|
|
51
|
+
})) : null;
|
|
52
|
+
};
|
|
53
|
+
var RevealingLine = function RevealingLine(_ref2) {
|
|
54
|
+
var children = _ref2.children,
|
|
55
|
+
revealBlockColor = _ref2.revealBlockColor,
|
|
56
|
+
_ref2$startRevealAtFr = _ref2.startRevealAtFrame,
|
|
57
|
+
startRevealAtFrame = _ref2$startRevealAtFr === void 0 ? 120 : _ref2$startRevealAtFr,
|
|
58
|
+
_ref2$index = _ref2.index,
|
|
59
|
+
index = _ref2$index === void 0 ? 0 : _ref2$index;
|
|
60
|
+
var inTimings = adjustTimings([startRevealAtFrame, startRevealAtFrame + 0.5], indexFactor(index));
|
|
61
|
+
var opacityTimings = adjustTimings([startRevealAtFrame + 1, startRevealAtFrame + 1.5], indexFactor(index));
|
|
62
|
+
var outTimings = adjustTimings([startRevealAtFrame + 1.5, startRevealAtFrame + 2], indexFactor(index));
|
|
63
|
+
var blockRevealerPositionIn = useTimeInterpolate(inTimings, [-105, 0], {
|
|
64
|
+
easing: Easing.out(Easing.quad),
|
|
65
|
+
extrapolateRight: "clamp",
|
|
66
|
+
extrapolateLeft: "clamp"
|
|
67
|
+
});
|
|
68
|
+
var textOpacity = useTimeInterpolate(opacityTimings, [0, 1], {
|
|
69
|
+
extrapolateRight: "clamp"
|
|
70
|
+
});
|
|
71
|
+
var blockRevealerPositionOut = useTimeInterpolate(outTimings, [0, 105], {
|
|
72
|
+
easing: Easing.out(Easing.quad),
|
|
73
|
+
extrapolateRight: "clamp",
|
|
74
|
+
extrapolateLeft: "clamp"
|
|
75
|
+
});
|
|
76
|
+
var currentRevealerPosition = blockRevealerPositionOut || blockRevealerPositionIn;
|
|
77
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
style: {
|
|
79
|
+
overflow: "hidden",
|
|
80
|
+
position: "relative",
|
|
81
|
+
textAlign: "left"
|
|
82
|
+
}
|
|
83
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
style: {
|
|
85
|
+
opacity: textOpacity,
|
|
86
|
+
willChange: "opacity",
|
|
87
|
+
zIndex: 10
|
|
88
|
+
}
|
|
89
|
+
}, children), /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
style: {
|
|
91
|
+
position: "absolute",
|
|
92
|
+
inset: 0,
|
|
93
|
+
backgroundColor: revealBlockColor,
|
|
94
|
+
transform: "translateX(".concat(currentRevealerPosition, "%)"),
|
|
95
|
+
willChange: "transform"
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
var TextWithVideoLandscape = function TextWithVideoLandscape(_ref3) {
|
|
100
|
+
var startVideoFrom = _ref3.startVideoFrom,
|
|
101
|
+
videoUrl = _ref3.videoUrl,
|
|
102
|
+
logoUrl = _ref3.logoUrl,
|
|
103
|
+
text = _ref3.text,
|
|
104
|
+
children = _ref3.children,
|
|
105
|
+
textColor = _ref3.textColor,
|
|
106
|
+
textBackgroundColor = _ref3.textBackgroundColor,
|
|
107
|
+
accentColor = _ref3.accentColor,
|
|
108
|
+
_ref3$variant = _ref3.variant,
|
|
109
|
+
variant = _ref3$variant === void 0 ? variants.LEFT_TO_RIGHT : _ref3$variant,
|
|
110
|
+
faceMetadata = _ref3.faceMetadata,
|
|
111
|
+
muted = _ref3.muted,
|
|
112
|
+
noBackgroundVideoEffects = _ref3.noBackgroundVideoEffects,
|
|
113
|
+
noBackgroundVideoUrl = _ref3.noBackgroundVideoUrl;
|
|
114
|
+
var _useVideoConfig = useVideoConfig(),
|
|
115
|
+
width = _useVideoConfig.width,
|
|
116
|
+
height = _useVideoConfig.height;
|
|
117
|
+
var _useVirtualBackground = useVirtualBackground(),
|
|
118
|
+
isVirtual = _useVirtualBackground.isVirtual,
|
|
119
|
+
virtualBgUrl = _useVirtualBackground.url;
|
|
120
|
+
var showVirtual = isVirtual && !!noBackgroundVideoUrl;
|
|
121
|
+
var stylesByVariant = _defineProperty(_defineProperty({}, variants.RIGHT_TO_LEFT, {
|
|
122
|
+
flowDirection: "row-reverse",
|
|
123
|
+
logoLeft: CHROME_PADDING * 2,
|
|
124
|
+
logoRight: undefined
|
|
125
|
+
}), variants.LEFT_TO_RIGHT, {
|
|
126
|
+
flowDirection: "row",
|
|
127
|
+
logoLeft: undefined,
|
|
128
|
+
logoRight: CHROME_PADDING * 2
|
|
129
|
+
});
|
|
130
|
+
var _useOrientationBased = useOrientationBased({
|
|
131
|
+
portrait: {
|
|
132
|
+
targetTextWidth: width - 2 * CHROME_PADDING,
|
|
133
|
+
targetVideoWidth: width - 2 * CHROME_PADDING,
|
|
134
|
+
targetVideoHeight: height * 0.6,
|
|
135
|
+
targetTextHeight: height * 0.4,
|
|
136
|
+
logoTop: height * 0.4 + CHROME_PADDING,
|
|
137
|
+
logoLeft: CHROME_PADDING * 2 - 5,
|
|
138
|
+
logoRight: undefined,
|
|
139
|
+
maxFontSize: 80,
|
|
140
|
+
flowDirection: "column"
|
|
141
|
+
},
|
|
142
|
+
landscape: {
|
|
143
|
+
targetTextWidth: width / 2,
|
|
144
|
+
targetVideoWidth: width / 2,
|
|
145
|
+
targetVideoHeight: height,
|
|
146
|
+
targetTextHeight: height,
|
|
147
|
+
logoTop: CHROME_PADDING * 2,
|
|
148
|
+
logoLeft: stylesByVariant[variant].logoLeft,
|
|
149
|
+
logoRight: stylesByVariant[variant].logoRight,
|
|
150
|
+
maxFontSize: 80,
|
|
151
|
+
flowDirection: stylesByVariant[variant].flowDirection
|
|
152
|
+
},
|
|
153
|
+
square: {
|
|
154
|
+
targetTextWidth: width / 2,
|
|
155
|
+
targetVideoWidth: width / 2,
|
|
156
|
+
targetVideoHeight: height,
|
|
157
|
+
targetTextHeight: height,
|
|
158
|
+
logoTop: CHROME_PADDING * 2,
|
|
159
|
+
logoLeft: stylesByVariant[variant].logoLeft,
|
|
160
|
+
logoRight: stylesByVariant[variant].logoRight,
|
|
161
|
+
maxFontSize: 50,
|
|
162
|
+
flowDirection: stylesByVariant[variant].flowDirection
|
|
163
|
+
}
|
|
164
|
+
}),
|
|
165
|
+
targetTextWidth = _useOrientationBased.targetTextWidth,
|
|
166
|
+
targetTextHeight = _useOrientationBased.targetTextHeight,
|
|
167
|
+
targetVideoWidth = _useOrientationBased.targetVideoWidth,
|
|
168
|
+
targetVideoHeight = _useOrientationBased.targetVideoHeight,
|
|
169
|
+
logoTop = _useOrientationBased.logoTop,
|
|
170
|
+
logoLeft = _useOrientationBased.logoLeft,
|
|
171
|
+
logoRight = _useOrientationBased.logoRight,
|
|
172
|
+
maxFontSize = _useOrientationBased.maxFontSize,
|
|
173
|
+
flowDirection = _useOrientationBased.flowDirection,
|
|
174
|
+
orientation = _useOrientationBased.orientation;
|
|
175
|
+
var transitionTimings = [0, 0.5];
|
|
176
|
+
var isPortrait = orientation === "portrait";
|
|
177
|
+
var textWidth = useTimeInterpolate(transitionTimings, [0, targetTextWidth], {
|
|
178
|
+
extrapolateLeft: "clamp",
|
|
179
|
+
extrapolateRight: "clamp"
|
|
180
|
+
});
|
|
181
|
+
var textHeight = useTimeInterpolate(transitionTimings, [0, targetTextHeight], {
|
|
182
|
+
extrapolateLeft: "clamp",
|
|
183
|
+
extrapolateRight: "clamp"
|
|
184
|
+
});
|
|
185
|
+
var videoWidth = useTimeInterpolate(transitionTimings, [width, targetVideoWidth], {
|
|
186
|
+
extrapolateRight: "clamp"
|
|
187
|
+
});
|
|
188
|
+
var videoHeight = useTimeInterpolate(transitionTimings, [height, targetVideoHeight], {
|
|
189
|
+
extrapolateRight: "clamp"
|
|
190
|
+
});
|
|
191
|
+
var _distributeTextToFit = distributeTextToFit(text, targetTextWidth - 100, targetTextHeight - 100, maxFontSize),
|
|
192
|
+
lines = _distributeTextToFit.lines,
|
|
193
|
+
fontSize = _distributeTextToFit.fontSize;
|
|
194
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
195
|
+
style: {
|
|
196
|
+
isolation: "isolate",
|
|
197
|
+
width: width,
|
|
198
|
+
height: height,
|
|
199
|
+
padding: CHROME_PADDING,
|
|
200
|
+
backgroundColor: accentColor
|
|
201
|
+
}
|
|
202
|
+
}, /*#__PURE__*/React.createElement(Logo, {
|
|
203
|
+
logoUrl: logoUrl,
|
|
204
|
+
top: logoTop,
|
|
205
|
+
left: logoLeft,
|
|
206
|
+
right: logoRight
|
|
207
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
208
|
+
style: {
|
|
209
|
+
display: "flex",
|
|
210
|
+
flexDirection: flowDirection,
|
|
211
|
+
width: "100%",
|
|
212
|
+
height: "100%",
|
|
213
|
+
borderRadius: 30,
|
|
214
|
+
overflow: "hidden"
|
|
215
|
+
}
|
|
216
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
217
|
+
style: {
|
|
218
|
+
width: isPortrait ? width - CHROME_PADDING * 2 : textWidth,
|
|
219
|
+
height: isPortrait ? textHeight : height - CHROME_PADDING * 2,
|
|
220
|
+
backgroundColor: textBackgroundColor,
|
|
221
|
+
color: textColor,
|
|
222
|
+
fontFamily: fontFamily,
|
|
223
|
+
fontSize: fontSize,
|
|
224
|
+
display: "flex",
|
|
225
|
+
alignItems: "center",
|
|
226
|
+
justifyContent: "center",
|
|
227
|
+
textAlign: "center",
|
|
228
|
+
zIndex: 1
|
|
229
|
+
}
|
|
230
|
+
}, /*#__PURE__*/React.createElement("div", null, lines.map(function (line, index) {
|
|
231
|
+
return /*#__PURE__*/React.createElement(RevealingLine, {
|
|
232
|
+
startRevealAtFrame: transitionTimings[1],
|
|
233
|
+
revealBlockColor: accentColor,
|
|
234
|
+
index: index,
|
|
235
|
+
key: index
|
|
236
|
+
}, line);
|
|
237
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
238
|
+
style: {
|
|
239
|
+
width: isPortrait ? width - CHROME_PADDING * 2 : videoWidth,
|
|
240
|
+
height: isPortrait ? videoHeight : height - CHROME_PADDING * 2,
|
|
241
|
+
overflow: "hidden",
|
|
242
|
+
position: "relative",
|
|
243
|
+
filter: !showVirtual && noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundDim && noBackgroundVideoUrl ? "brightness(0.7)" : undefined
|
|
244
|
+
}
|
|
245
|
+
}, showVirtual && virtualBgUrl ? /*#__PURE__*/React.createElement(VirtualBackgroundUnderlay, {
|
|
246
|
+
url: virtualBgUrl,
|
|
247
|
+
top: 0,
|
|
248
|
+
left: 0,
|
|
249
|
+
width: "100%",
|
|
250
|
+
height: "100%",
|
|
251
|
+
zIndex: 1
|
|
252
|
+
}) : null, faceMetadata ? /*#__PURE__*/React.createElement(FaceCenteredVideo, {
|
|
253
|
+
startFrom: startVideoFrom,
|
|
254
|
+
src: videoUrl,
|
|
255
|
+
muted: muted,
|
|
256
|
+
faceMetadata: faceMetadata,
|
|
257
|
+
containerWidth: isPortrait ? width - CHROME_PADDING * 2 : videoWidth,
|
|
258
|
+
containerHeight: isPortrait ? videoHeight : height - CHROME_PADDING * 2
|
|
259
|
+
}) : /*#__PURE__*/React.createElement(OffthreadVideo, {
|
|
260
|
+
startFrom: startVideoFrom,
|
|
261
|
+
src: videoUrl,
|
|
262
|
+
muted: muted,
|
|
263
|
+
style: {
|
|
264
|
+
height: "100%",
|
|
265
|
+
objectFit: "cover",
|
|
266
|
+
width: videoWidth
|
|
267
|
+
}
|
|
268
|
+
})), /*#__PURE__*/React.createElement(BlurOverlay, {
|
|
269
|
+
show: !showVirtual && (noBackgroundVideoEffects === null || noBackgroundVideoEffects === void 0 ? void 0 : noBackgroundVideoEffects.backgroundBlur) && noBackgroundVideoUrl,
|
|
270
|
+
width: width,
|
|
271
|
+
height: height,
|
|
272
|
+
zIndex: 0
|
|
273
|
+
}), noBackgroundVideoUrl && (showVirtual || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.facePop || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundDim || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundBlur) && faceMetadata ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
274
|
+
style: {
|
|
275
|
+
padding: CHROME_PADDING,
|
|
276
|
+
isolation: "isolate",
|
|
277
|
+
width: width,
|
|
278
|
+
height: height,
|
|
279
|
+
zIndex: 9
|
|
280
|
+
}
|
|
281
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
282
|
+
style: {
|
|
283
|
+
display: "flex",
|
|
284
|
+
flexDirection: flowDirection,
|
|
285
|
+
width: "100%",
|
|
286
|
+
height: "100%",
|
|
287
|
+
borderRadius: 30,
|
|
288
|
+
overflow: "hidden"
|
|
289
|
+
}
|
|
290
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
291
|
+
style: {
|
|
292
|
+
width: isPortrait ? width - CHROME_PADDING * 2 : textWidth,
|
|
293
|
+
height: isPortrait ? textHeight : height - CHROME_PADDING * 2
|
|
294
|
+
}
|
|
295
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
296
|
+
style: {
|
|
297
|
+
width: isPortrait ? width - CHROME_PADDING * 2 : videoWidth,
|
|
298
|
+
height: isPortrait ? videoHeight : height - CHROME_PADDING * 2,
|
|
299
|
+
overflow: "hidden"
|
|
300
|
+
}
|
|
301
|
+
}, /*#__PURE__*/React.createElement(FaceCenteredVideo, {
|
|
302
|
+
startFrom: startVideoFrom,
|
|
303
|
+
src: noBackgroundVideoUrl,
|
|
304
|
+
muted: true,
|
|
305
|
+
transparent: true,
|
|
306
|
+
faceMetadata: faceMetadata,
|
|
307
|
+
containerWidth: isPortrait ? width - CHROME_PADDING * 2 : videoWidth,
|
|
308
|
+
containerHeight: isPortrait ? videoHeight : height - CHROME_PADDING * 2,
|
|
309
|
+
noBackgroundVideoEffects: noBackgroundVideoEffects
|
|
310
|
+
})))) : null, noBackgroundVideoUrl && (showVirtual || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.facePop || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundDim || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundBlur) && !faceMetadata ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
311
|
+
style: {
|
|
312
|
+
backgroundColor: "transparent",
|
|
313
|
+
padding: CHROME_PADDING,
|
|
314
|
+
isolation: "isolate",
|
|
315
|
+
width: width,
|
|
316
|
+
height: height,
|
|
317
|
+
zIndex: 9
|
|
318
|
+
}
|
|
319
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
320
|
+
style: {
|
|
321
|
+
display: "flex",
|
|
322
|
+
flexDirection: flowDirection,
|
|
323
|
+
width: "100%",
|
|
324
|
+
height: "100%",
|
|
325
|
+
borderRadius: 30,
|
|
326
|
+
overflow: "hidden"
|
|
327
|
+
}
|
|
328
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
329
|
+
style: {
|
|
330
|
+
width: isPortrait ? width - CHROME_PADDING * 2 : textWidth,
|
|
331
|
+
height: isPortrait ? textHeight : height - CHROME_PADDING * 2
|
|
332
|
+
}
|
|
333
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
334
|
+
style: {
|
|
335
|
+
width: isPortrait ? width - CHROME_PADDING * 2 : videoWidth,
|
|
336
|
+
height: isPortrait ? videoHeight : height - CHROME_PADDING * 2,
|
|
337
|
+
overflow: "hidden"
|
|
338
|
+
}
|
|
339
|
+
}, /*#__PURE__*/React.createElement(OffthreadVideo, {
|
|
340
|
+
startFrom: startVideoFrom,
|
|
341
|
+
src: noBackgroundVideoUrl,
|
|
342
|
+
muted: true,
|
|
343
|
+
transparent: true,
|
|
344
|
+
style: {
|
|
345
|
+
height: "100%",
|
|
346
|
+
objectFit: "cover",
|
|
347
|
+
width: videoWidth,
|
|
348
|
+
filter: noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.facePop ? "brightness(1.1) contrast(1.15) saturate(1.05)" : undefined
|
|
349
|
+
}
|
|
350
|
+
})))) : null), /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
351
|
+
style: {
|
|
352
|
+
zIndex: 10
|
|
353
|
+
}
|
|
354
|
+
}, children));
|
|
355
|
+
};
|
|
356
|
+
export var TextWithVideo = function TextWithVideo(props) {
|
|
357
|
+
var _useTheme = useTheme(),
|
|
358
|
+
primaryColor = _useTheme.primaryColor,
|
|
359
|
+
primaryContrast = _useTheme.primaryContrast,
|
|
360
|
+
accentColor = _useTheme.accentColor;
|
|
361
|
+
var _ref4 = props || {},
|
|
362
|
+
_ref4$disableTransiti = _ref4.disableTransitionSounds,
|
|
363
|
+
disableTransitionSounds = _ref4$disableTransiti === void 0 ? false : _ref4$disableTransiti;
|
|
364
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
|
|
365
|
+
src: "https://cdn.zync.ai/assets/static/swoosh.mp3",
|
|
366
|
+
volume: 0.25
|
|
367
|
+
}), /*#__PURE__*/React.createElement(TextWithVideoLandscape, _extends({}, props, {
|
|
368
|
+
textBackgroundColor: primaryContrast,
|
|
369
|
+
textColor: primaryColor,
|
|
370
|
+
accentColor: accentColor,
|
|
371
|
+
variant: props.variant
|
|
372
|
+
})));
|
|
373
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"5.12.1","fr":30,"ip":0,"op":91,"w":800,"h":800,"nm":"Interface_Icon_21","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":2,"ty":4,"nm":"Line","parent":5,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":-0.019,"ix":10},"p":{"a":0,"k":[-0.086,0.017,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[99.972,99.972,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-93,-67],[90,-67]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"k":[{"s":[30],"t":9,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[30],"t":90,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}]},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[1],"y":[0]},"t":9,"s":[0],"e":[100]},{"t":43}],"ix":1},"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":9,"op":91,"st":9,"ct":1,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Line 2","parent":5,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":-0.019,"ix":10},"p":{"a":0,"k":[-0.069,52.003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[99.972,99.972,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-93,-67],[90,-67]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"k":[{"s":[30],"t":12,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[30],"t":90,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}]},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[1],"y":[0]},"t":12,"s":[0],"e":[100]},{"t":46}],"ix":1},"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":12,"op":91,"st":12,"ct":1,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Line 3","parent":5,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":-0.019,"ix":10},"p":{"a":0,"k":[-0.052,104.988,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[99.972,99.972,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-93,-67],[90,-67]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"k":[{"s":[30],"t":15,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[30],"t":90,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}]},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[1],"y":[0]},"t":15,"s":[0],"e":[100]},{"t":49}],"ix":1},"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":15,"op":91,"st":15,"ct":1,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Box","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"k":[{"s":[-67],"t":18,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":24,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[5.578],"t":25,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[8.344],"t":26,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[8.743],"t":27,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[7.485],"t":28,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[5.336],"t":29,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[2.965],"t":30,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.859],"t":31,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.703],"t":32,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-1.627],"t":33,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-1.963],"t":34,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-1.846],"t":35,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-1.445],"t":36,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.925],"t":37,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.414],"t":38,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":39,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.278],"t":40,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.415],"t":41,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.435],"t":42,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.373],"t":43,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.266],"t":44,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.148],"t":45,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.043],"t":46,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.035],"t":47,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.081],"t":48,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.098],"t":49,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.092],"t":50,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.072],"t":51,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.046],"t":52,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.021],"t":53,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":54,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.014],"t":55,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.021],"t":56,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.022],"t":57,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.019],"t":58,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.013],"t":59,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.007],"t":60,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.002],"t":61,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.002],"t":62,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.004],"t":63,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.005],"t":64,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.005],"t":65,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.004],"t":66,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.002],"t":67,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[-0.001],"t":68,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":69,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.001],"t":70,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.001],"t":71,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.001],"t":72,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.001],"t":73,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0.001],"t":74,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":75,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":76,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":77,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":78,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":79,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":80,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":81,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":83,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":84,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":85,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":86,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[0],"t":88,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}]},"p":{"a":0,"k":[300,579,0],"ix":2,"l":2},"a":{"a":0,"k":[-100,179,0],"ix":1,"l":2},"s":{"k":[{"s":[0,0,100],"t":18,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[100,100,100],"t":24,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[108.325,108.325,100],"t":25,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[112.454,112.454,100],"t":26,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[113.049,113.049,100],"t":27,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[111.172,111.172,100],"t":28,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[107.965,107.965,100],"t":29,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[104.426,104.426,100],"t":30,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[101.282,101.282,100],"t":31,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[98.951,98.951,100],"t":32,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[97.571,97.571,100],"t":33,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[97.07,97.07,100],"t":34,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[97.245,97.245,100],"t":35,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[97.843,97.843,100],"t":36,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[98.62,98.62,100],"t":37,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[99.382,99.382,100],"t":38,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[100,100,100],"t":39,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[100.414,100.414,100],"t":40,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[100.62,100.62,100],"t":41,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[100.556,100.556,100],"t":43,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[100.397,100.397,100],"t":44,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[100.22,100.22,100],"t":45,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[100.064,100.064,100],"t":46,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}},{"s":[99.948,99.948,100],"t":47,"i":{"x":[1,1,1],"y":[1,1,1]},"o":{"x":[0,0,0],"y":[0,0,0]}}],"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[161,-133],[-160,-133],[-161,110],[-100,110],[-100,179],[-42,109],[161,109]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"k":[{"s":[30],"t":12,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[30],"t":90,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}]},"lc":1,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":12,"op":91,"st":-29,"ct":1,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Ellipse01","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[620,620],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[1],"y":[0]},"t":3,"s":[0],"e":[100]},{"t":40}],"ix":1},"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":35,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":3,"op":91,"st":3,"ct":1,"bm":0}],"markers":[],"props":{}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AbsoluteFill } from "remotion";
|
|
3
|
+
export var BlurOverlay = function BlurOverlay(_ref) {
|
|
4
|
+
var show = _ref.show,
|
|
5
|
+
width = _ref.width,
|
|
6
|
+
height = _ref.height,
|
|
7
|
+
_ref$zIndex = _ref.zIndex,
|
|
8
|
+
zIndex = _ref$zIndex === void 0 ? 1 : _ref$zIndex;
|
|
9
|
+
if (!show) return null;
|
|
10
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
11
|
+
style: {
|
|
12
|
+
width: width,
|
|
13
|
+
height: height,
|
|
14
|
+
backdropFilter: "blur(10px)",
|
|
15
|
+
isolation: "isolate",
|
|
16
|
+
zIndex: zIndex
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AbsoluteFill, OffthreadVideo, useVideoConfig } from "remotion";
|
|
4
|
+
import { useCallback, useRef } from "react";
|
|
5
|
+
import { CHROME_PADDING } from "../../config.js";
|
|
6
|
+
export var ChromaKeyedVideo = function ChromaKeyedVideo(props) {
|
|
7
|
+
var canvas = useRef(null);
|
|
8
|
+
var _useVideoConfig = useVideoConfig(),
|
|
9
|
+
width = _useVideoConfig.width,
|
|
10
|
+
height = _useVideoConfig.height;
|
|
11
|
+
var onVideoFrame = useCallback(function (frame) {
|
|
12
|
+
if (!canvas.current) return;
|
|
13
|
+
var context = canvas.current.getContext("2d");
|
|
14
|
+
if (!context) return;
|
|
15
|
+
var targetWidth = width;
|
|
16
|
+
var targetHeight = height;
|
|
17
|
+
var sourceWidth = frame.videoWidth || frame.width;
|
|
18
|
+
var sourceHeight = frame.videoHeight || frame.height;
|
|
19
|
+
var scale = Math.max(targetWidth / sourceWidth, targetHeight / sourceHeight);
|
|
20
|
+
var drawWidth = sourceWidth * scale;
|
|
21
|
+
var drawHeight = sourceHeight * scale;
|
|
22
|
+
var offsetX = (targetWidth - drawWidth) / 2;
|
|
23
|
+
var offsetY = (targetHeight - drawHeight) / 2;
|
|
24
|
+
context.clearRect(0, 0, targetWidth, targetHeight);
|
|
25
|
+
context.drawImage(frame, offsetX, offsetY, drawWidth, drawHeight);
|
|
26
|
+
var imageFrame = context.getImageData(0, 0, targetWidth, targetHeight);
|
|
27
|
+
var length = imageFrame.data.length;
|
|
28
|
+
for (var i = 0; i < length; i += 4) {
|
|
29
|
+
var red = imageFrame.data[i];
|
|
30
|
+
var green = imageFrame.data[i + 1];
|
|
31
|
+
var blue = imageFrame.data[i + 2];
|
|
32
|
+
if (green > 160 && red < 150 && blue < 150) {
|
|
33
|
+
imageFrame.data[i + 3] = 0;
|
|
34
|
+
}
|
|
35
|
+
if (green > 100 && red < 100 && blue < 100) {
|
|
36
|
+
imageFrame.data[i + 1] = 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
context.putImageData(imageFrame, 0, 0);
|
|
40
|
+
}, [height, width]);
|
|
41
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, null, /*#__PURE__*/React.createElement(AbsoluteFill, null, /*#__PURE__*/React.createElement(OffthreadVideo, _extends({}, props, {
|
|
42
|
+
onVideoFrame: onVideoFrame
|
|
43
|
+
}))), /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
44
|
+
style: {
|
|
45
|
+
borderRadius: 30,
|
|
46
|
+
overflow: "hidden",
|
|
47
|
+
transform: "translate(-50%, -50%)",
|
|
48
|
+
left: "50%",
|
|
49
|
+
top: "50%",
|
|
50
|
+
width: width - 2 * CHROME_PADDING,
|
|
51
|
+
height: height - 2 * CHROME_PADDING
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement("canvas", {
|
|
54
|
+
id: "canvas",
|
|
55
|
+
ref: canvas,
|
|
56
|
+
width: width,
|
|
57
|
+
height: height
|
|
58
|
+
})));
|
|
59
|
+
};
|