@zync/zync-screnplay-player 0.1.218 → 0.1.220
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 +69 -12
- package/dist/bundle.js +1 -1
- package/dist/screenplay/RemotionRenderer/components/LottieAnimationGlobal.js +21 -21
- package/dist/screenplay/RemotionRenderer/components/layouts/HookVideo.js +820 -0
- package/dist/screenplay/RemotionRenderer/components/utils/FaceCenteredVideo.js +50 -50
- package/dist/screenplay/RemotionRenderer/components/utils/PausableImg.js +4 -4
- package/dist/screenplay/RemotionRenderer/components/utils/README.md +80 -80
- package/dist/screenplay/RemotionRenderer/components/utils/StretchTextDemo.js +3 -3
- package/dist/screenplay/RemotionRenderer/development.js +6 -19
- package/dist/screenplay/RemotionRenderer/helpers/convertToSeconds.js +8 -8
- package/dist/screenplay/RemotionRenderer/helpers/faceBasedVideoStyles.js +4 -4
- package/dist/screenplay/RemotionRenderer/helpers/faceCenteredVideoTransforms.js +46 -46
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/HookVideoLayout.js +42 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/LayoutFactory.js +5 -0
- package/dist/screenplay/RemotionRenderer/main/screenplaySchema.js +51 -51
- package/dist/screenplay/RemotionRenderer/registeredComponents.js +4 -2
- package/dist/screenplay/RemotionRenderer/tracks/DynamicVideoComposition.js +47 -61
- package/dist/screenplay/RemotionRenderer/tracks/LayoutVideoTrack.js +20 -20
- package/package.json +47 -47
|
@@ -0,0 +1,820 @@
|
|
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
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); }
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { AbsoluteFill, Audio, Img, OffthreadVideo, Sequence, interpolate, spring, staticFile, useCurrentFrame, useVideoConfig } from "remotion";
|
|
9
|
+
import { loadFont as loadHeadlineFont } from "@remotion/google-fonts/Oswald";
|
|
10
|
+
import { CHROME_PADDING } from "../../config.js";
|
|
11
|
+
import { useOrientationBased } from "../../hooks/useOrientationBased.js";
|
|
12
|
+
import { distributeTextToFit } from "../../theme/themes/default/Sentence/SentenceSimple.helpers.js";
|
|
13
|
+
import { useTheme } from "../../theme/hooks/useTheme.js";
|
|
14
|
+
import FaceCenteredVideo from "../utils/FaceCenteredVideo";
|
|
15
|
+
import PausableImg from "../utils/PausableImg";
|
|
16
|
+
import { useVirtualBackground } from "../../hooks/useVirtualBackground";
|
|
17
|
+
import { VirtualBackgroundUnderlay } from "../backgrounds/VirtualBackgroundUnderlay";
|
|
18
|
+
var _loadHeadlineFont = loadHeadlineFont(),
|
|
19
|
+
headlineFontFamily = _loadHeadlineFont.fontFamily;
|
|
20
|
+
var HOOK_STYLE_PRESETS = {
|
|
21
|
+
punch_zoom: "punch_zoom",
|
|
22
|
+
mono_shock: "mono_shock",
|
|
23
|
+
glitch_verdict: "glitch_verdict",
|
|
24
|
+
border_alarm: "border_alarm",
|
|
25
|
+
split_reveal: "split_reveal"
|
|
26
|
+
};
|
|
27
|
+
var normalizeWordForMatch = function normalizeWordForMatch(word) {
|
|
28
|
+
return word.toLowerCase().replace(/^[^a-z0-9]+|[^a-z0-9]+$/gi, "");
|
|
29
|
+
};
|
|
30
|
+
var getAccentWordIndices = function getAccentWordIndices(text, accentText) {
|
|
31
|
+
if (!accentText) {
|
|
32
|
+
return new Set();
|
|
33
|
+
}
|
|
34
|
+
var sourceWords = text.split(/\s+/).filter(Boolean);
|
|
35
|
+
var accentWords = accentText.split(/\s+/).filter(Boolean);
|
|
36
|
+
if (!sourceWords.length || !accentWords.length) {
|
|
37
|
+
return new Set();
|
|
38
|
+
}
|
|
39
|
+
var normalizedSourceWords = sourceWords.map(normalizeWordForMatch);
|
|
40
|
+
var normalizedAccentWords = accentWords.map(normalizeWordForMatch);
|
|
41
|
+
var _loop = function _loop(start) {
|
|
42
|
+
var matches = true;
|
|
43
|
+
for (var i = 0; i < normalizedAccentWords.length; i += 1) {
|
|
44
|
+
if (normalizedSourceWords[start + i] !== normalizedAccentWords[i]) {
|
|
45
|
+
matches = false;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (matches) {
|
|
50
|
+
return {
|
|
51
|
+
v: new Set(Array.from({
|
|
52
|
+
length: normalizedAccentWords.length
|
|
53
|
+
}, function (_, index) {
|
|
54
|
+
return start + index;
|
|
55
|
+
}))
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
_ret;
|
|
60
|
+
for (var start = 0; start <= normalizedSourceWords.length - normalizedAccentWords.length; start += 1) {
|
|
61
|
+
_ret = _loop(start);
|
|
62
|
+
if (_ret) return _ret.v;
|
|
63
|
+
}
|
|
64
|
+
return new Set();
|
|
65
|
+
};
|
|
66
|
+
var buildLineWordEntries = function buildLineWordEntries(lines) {
|
|
67
|
+
var globalIndex = 0;
|
|
68
|
+
return lines.map(function (line) {
|
|
69
|
+
return line.split(/\s+/).filter(Boolean).map(function (word) {
|
|
70
|
+
return {
|
|
71
|
+
text: word,
|
|
72
|
+
globalIndex: globalIndex++
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
var getWordStartFrame = function getWordStartFrame(globalIndex, totalWords, typingFrames) {
|
|
78
|
+
if (totalWords <= 1) {
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
return globalIndex / Math.max(totalWords - 1, 1) * Math.max(typingFrames - 1, 0);
|
|
82
|
+
};
|
|
83
|
+
var buildLineRuns = function buildLineRuns(lineWords, accentWordIndices) {
|
|
84
|
+
var runs = [];
|
|
85
|
+
var accentGroup = null;
|
|
86
|
+
lineWords.forEach(function (word) {
|
|
87
|
+
var isAccent = accentWordIndices.has(word.globalIndex);
|
|
88
|
+
if (isAccent) {
|
|
89
|
+
if (!accentGroup) {
|
|
90
|
+
accentGroup = {
|
|
91
|
+
type: "accent_group",
|
|
92
|
+
words: []
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
accentGroup.words.push(word);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (accentGroup) {
|
|
99
|
+
runs.push(accentGroup);
|
|
100
|
+
accentGroup = null;
|
|
101
|
+
}
|
|
102
|
+
runs.push({
|
|
103
|
+
type: "word",
|
|
104
|
+
word: word
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
if (accentGroup) {
|
|
108
|
+
runs.push(accentGroup);
|
|
109
|
+
}
|
|
110
|
+
return runs;
|
|
111
|
+
};
|
|
112
|
+
var getHookTiming = function getHookTiming(_ref) {
|
|
113
|
+
var durationInFrames = _ref.durationInFrames,
|
|
114
|
+
hookDurationSeconds = _ref.hookDurationSeconds,
|
|
115
|
+
fps = _ref.fps;
|
|
116
|
+
var requestedHookFrames = Math.max(1, Math.round((hookDurationSeconds !== null && hookDurationSeconds !== void 0 ? hookDurationSeconds : 1.6) * fps));
|
|
117
|
+
if (durationInFrames < 30) {
|
|
118
|
+
return {
|
|
119
|
+
requestedHookFrames: requestedHookFrames,
|
|
120
|
+
effectiveHookFrames: durationInFrames,
|
|
121
|
+
settleFrames: 0,
|
|
122
|
+
shortSegment: true
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
var effectiveHookFrames = Math.min(requestedHookFrames, Math.max(12, durationInFrames - 18));
|
|
126
|
+
return {
|
|
127
|
+
requestedHookFrames: requestedHookFrames,
|
|
128
|
+
effectiveHookFrames: effectiveHookFrames,
|
|
129
|
+
settleFrames: Math.min(18, Math.max(0, durationInFrames - effectiveHookFrames)),
|
|
130
|
+
shortSegment: false
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
var getVideoTreatment = function getVideoTreatment(_ref2) {
|
|
134
|
+
var frame = _ref2.frame,
|
|
135
|
+
style = _ref2.style,
|
|
136
|
+
hookFrames = _ref2.hookFrames,
|
|
137
|
+
settleFrames = _ref2.settleFrames,
|
|
138
|
+
durationInFrames = _ref2.durationInFrames,
|
|
139
|
+
baseZoom = _ref2.baseZoom;
|
|
140
|
+
var settleStartFrame = hookFrames;
|
|
141
|
+
var introEndScale = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, baseZoom * 1.06), HOOK_STYLE_PRESETS.mono_shock, baseZoom * 1.03), HOOK_STYLE_PRESETS.glitch_verdict, baseZoom * 1.02), HOOK_STYLE_PRESETS.border_alarm, baseZoom * 1.04), HOOK_STYLE_PRESETS.split_reveal, baseZoom * 1.05)[style];
|
|
142
|
+
var peakScale = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, baseZoom * 1.22), HOOK_STYLE_PRESETS.mono_shock, baseZoom * 1.12), HOOK_STYLE_PRESETS.glitch_verdict, baseZoom * 1.14), HOOK_STYLE_PRESETS.border_alarm, baseZoom * 1.1), HOOK_STYLE_PRESETS.split_reveal, baseZoom * 1.16)[style];
|
|
143
|
+
var startX = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, 0), HOOK_STYLE_PRESETS.mono_shock, -18), HOOK_STYLE_PRESETS.glitch_verdict, 10), HOOK_STYLE_PRESETS.border_alarm, 0), HOOK_STYLE_PRESETS.split_reveal, 34)[style];
|
|
144
|
+
var endX = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, 0), HOOK_STYLE_PRESETS.mono_shock, 0), HOOK_STYLE_PRESETS.glitch_verdict, 0), HOOK_STYLE_PRESETS.border_alarm, 0), HOOK_STYLE_PRESETS.split_reveal, 0)[style];
|
|
145
|
+
var translateYPeak = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, -8), HOOK_STYLE_PRESETS.mono_shock, 0), HOOK_STYLE_PRESETS.glitch_verdict, -4), HOOK_STYLE_PRESETS.border_alarm, 0), HOOK_STYLE_PRESETS.split_reveal, 0)[style];
|
|
146
|
+
var scaleDuringHook = interpolate(frame, [0, hookFrames], [peakScale, introEndScale], {
|
|
147
|
+
extrapolateLeft: "clamp",
|
|
148
|
+
extrapolateRight: "clamp"
|
|
149
|
+
});
|
|
150
|
+
var translateXDuringHook = interpolate(frame, [0, hookFrames], [startX, endX], {
|
|
151
|
+
extrapolateLeft: "clamp",
|
|
152
|
+
extrapolateRight: "clamp"
|
|
153
|
+
});
|
|
154
|
+
var translateYDuringHook = interpolate(frame, [0, hookFrames], [translateYPeak, 0], {
|
|
155
|
+
extrapolateLeft: "clamp",
|
|
156
|
+
extrapolateRight: "clamp"
|
|
157
|
+
});
|
|
158
|
+
var settleEndFrame = Math.min(durationInFrames, settleStartFrame + settleFrames);
|
|
159
|
+
var scale = settleFrames ? interpolate(frame, [settleStartFrame, settleEndFrame], [introEndScale, baseZoom], {
|
|
160
|
+
extrapolateLeft: "clamp",
|
|
161
|
+
extrapolateRight: "clamp"
|
|
162
|
+
}) : scaleDuringHook;
|
|
163
|
+
var translateX = settleFrames ? interpolate(frame, [settleStartFrame, settleEndFrame], [translateXDuringHook, 0], {
|
|
164
|
+
extrapolateLeft: "clamp",
|
|
165
|
+
extrapolateRight: "clamp"
|
|
166
|
+
}) : translateXDuringHook;
|
|
167
|
+
var translateY = settleFrames ? interpolate(frame, [settleStartFrame, settleEndFrame], [translateYDuringHook, 0], {
|
|
168
|
+
extrapolateLeft: "clamp",
|
|
169
|
+
extrapolateRight: "clamp"
|
|
170
|
+
}) : translateYDuringHook;
|
|
171
|
+
var grayscale = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, 0.05), HOOK_STYLE_PRESETS.mono_shock, interpolate(frame, [0, hookFrames], [1, 0.15], {
|
|
172
|
+
extrapolateLeft: "clamp",
|
|
173
|
+
extrapolateRight: "clamp"
|
|
174
|
+
})), HOOK_STYLE_PRESETS.glitch_verdict, interpolate(frame, [0, hookFrames], [0.45, 0.1], {
|
|
175
|
+
extrapolateLeft: "clamp",
|
|
176
|
+
extrapolateRight: "clamp"
|
|
177
|
+
})), HOOK_STYLE_PRESETS.border_alarm, 0), HOOK_STYLE_PRESETS.split_reveal, 0)[style];
|
|
178
|
+
var saturate = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, 1.45), HOOK_STYLE_PRESETS.mono_shock, 0.85), HOOK_STYLE_PRESETS.glitch_verdict, 1.35), HOOK_STYLE_PRESETS.border_alarm, 1.2), HOOK_STYLE_PRESETS.split_reveal, 1.12)[style];
|
|
179
|
+
var contrast = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, 1.15), HOOK_STYLE_PRESETS.mono_shock, 1.35), HOOK_STYLE_PRESETS.glitch_verdict, 1.3), HOOK_STYLE_PRESETS.border_alarm, 1.16), HOOK_STYLE_PRESETS.split_reveal, 1.12)[style];
|
|
180
|
+
var brightness = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, 0.98), HOOK_STYLE_PRESETS.mono_shock, 0.92), HOOK_STYLE_PRESETS.glitch_verdict, 0.9), HOOK_STYLE_PRESETS.border_alarm, 0.95), HOOK_STYLE_PRESETS.split_reveal, 0.98)[style];
|
|
181
|
+
return {
|
|
182
|
+
transform: "translate3d(".concat(translateX, "px, ").concat(translateY, "px, 0) scale(").concat(scale, ")"),
|
|
183
|
+
filter: "grayscale(".concat(grayscale, ") contrast(").concat(contrast, ") brightness(").concat(brightness, ") saturate(").concat(saturate, ")")
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
var HookHeadline = function HookHeadline(_ref3) {
|
|
187
|
+
var hookText = _ref3.hookText,
|
|
188
|
+
hookAccentText = _ref3.hookAccentText,
|
|
189
|
+
maxWidth = _ref3.maxWidth,
|
|
190
|
+
maxHeight = _ref3.maxHeight,
|
|
191
|
+
maxFontSize = _ref3.maxFontSize,
|
|
192
|
+
align = _ref3.align,
|
|
193
|
+
accentColor = _ref3.accentColor,
|
|
194
|
+
accentContrast = _ref3.accentContrast,
|
|
195
|
+
primaryContrast = _ref3.primaryContrast,
|
|
196
|
+
style = _ref3.style,
|
|
197
|
+
frame = _ref3.frame,
|
|
198
|
+
fps = _ref3.fps,
|
|
199
|
+
hookFrames = _ref3.hookFrames;
|
|
200
|
+
var _distributeTextToFit = distributeTextToFit(hookText, maxWidth, maxHeight, maxFontSize),
|
|
201
|
+
lines = _distributeTextToFit.lines,
|
|
202
|
+
fontSize = _distributeTextToFit.fontSize;
|
|
203
|
+
var lineWordEntries = buildLineWordEntries(lines);
|
|
204
|
+
var totalWords = lineWordEntries.reduce(function (count, lineWords) {
|
|
205
|
+
return count + lineWords.length;
|
|
206
|
+
}, 0);
|
|
207
|
+
var accentWordIndices = getAccentWordIndices(hookText, hookAccentText);
|
|
208
|
+
var reveal = spring({
|
|
209
|
+
frame: frame - 2,
|
|
210
|
+
fps: fps,
|
|
211
|
+
config: {
|
|
212
|
+
damping: 14,
|
|
213
|
+
stiffness: 160,
|
|
214
|
+
mass: 0.7
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
var outroOpacity = interpolate(frame, [Math.max(hookFrames - 8, 0), hookFrames], [1, 0], {
|
|
218
|
+
extrapolateLeft: "clamp",
|
|
219
|
+
extrapolateRight: "clamp"
|
|
220
|
+
});
|
|
221
|
+
var glitchOffset = style === HOOK_STYLE_PRESETS.glitch_verdict ? (frame % 2 === 0 ? 1 : -1) * 4 : 0;
|
|
222
|
+
var headlineColor = style === HOOK_STYLE_PRESETS.mono_shock ? "rgba(255, 255, 255, 0.98)" : primaryContrast || "#ffffff";
|
|
223
|
+
var headlineTextShadow = style === HOOK_STYLE_PRESETS.glitch_verdict ? "3px 0 rgba(255, 40, 95, 0.9), -3px 0 rgba(0, 240, 255, 0.9), 0 10px 40px rgba(0, 0, 0, 0.55)" : style === HOOK_STYLE_PRESETS.mono_shock ? "0 3px 0 rgba(0, 0, 0, 0.48), 0 14px 36px rgba(0, 0, 0, 0.62)" : "0 12px 36px rgba(0, 0, 0, 0.45)";
|
|
224
|
+
var containerStyle = style === HOOK_STYLE_PRESETS.mono_shock ? {
|
|
225
|
+
display: "inline-flex",
|
|
226
|
+
flexDirection: "column",
|
|
227
|
+
padding: "24px 30px 20px",
|
|
228
|
+
borderRadius: 28,
|
|
229
|
+
background: "linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.56) 58%, rgba(0, 0, 0, 0.14) 100%)",
|
|
230
|
+
backdropFilter: "blur(6px)",
|
|
231
|
+
boxShadow: "0 22px 48px rgba(0, 0, 0, 0.35)"
|
|
232
|
+
} : undefined;
|
|
233
|
+
var typingFrames = totalWords ? Math.max(10, Math.min(Math.round(hookFrames * 0.45), totalWords * 4)) : 0;
|
|
234
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
235
|
+
style: {
|
|
236
|
+
opacity: reveal * outroOpacity,
|
|
237
|
+
transform: "translate3d(".concat(glitchOffset, "px, ").concat((1 - reveal) * 24, "px, 0) scale(").concat(0.94 + reveal * 0.06, ")"),
|
|
238
|
+
willChange: "transform, opacity",
|
|
239
|
+
maxWidth: maxWidth
|
|
240
|
+
}
|
|
241
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
242
|
+
style: _objectSpread(_objectSpread({}, containerStyle), {}, {
|
|
243
|
+
display: "flex",
|
|
244
|
+
flexDirection: "column",
|
|
245
|
+
alignItems: align === "center" ? "center" : "flex-start",
|
|
246
|
+
textAlign: align,
|
|
247
|
+
gap: fontSize * 0.12,
|
|
248
|
+
fontFamily: headlineFontFamily,
|
|
249
|
+
fontSize: fontSize,
|
|
250
|
+
lineHeight: 0.96,
|
|
251
|
+
letterSpacing: "-0.03em",
|
|
252
|
+
fontWeight: 700,
|
|
253
|
+
textTransform: "uppercase",
|
|
254
|
+
color: headlineColor,
|
|
255
|
+
textShadow: headlineTextShadow
|
|
256
|
+
})
|
|
257
|
+
}, lineWordEntries.map(function (lineWords, lineIndex) {
|
|
258
|
+
var lineRuns = buildLineRuns(lineWords, accentWordIndices);
|
|
259
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
260
|
+
key: "".concat(lines[lineIndex], "-").concat(lineIndex),
|
|
261
|
+
style: {
|
|
262
|
+
display: "flex",
|
|
263
|
+
justifyContent: align === "center" ? "center" : "flex-start",
|
|
264
|
+
alignItems: "flex-start",
|
|
265
|
+
flexWrap: "nowrap",
|
|
266
|
+
minHeight: fontSize * 1.02
|
|
267
|
+
}
|
|
268
|
+
}, lineRuns.map(function (run, runIndex) {
|
|
269
|
+
if (run.type === "accent_group") {
|
|
270
|
+
var firstWordStartFrame = getWordStartFrame(run.words[0].globalIndex, totalWords, typingFrames);
|
|
271
|
+
var firstWordReveal = spring({
|
|
272
|
+
frame: frame - firstWordStartFrame + 2,
|
|
273
|
+
fps: fps,
|
|
274
|
+
config: {
|
|
275
|
+
damping: 20,
|
|
276
|
+
stiffness: 260,
|
|
277
|
+
mass: 0.55
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
var accentGroupOpacity = Math.max(0, Math.min(1, firstWordReveal));
|
|
281
|
+
var accentGroupVisible = frame + 2 >= firstWordStartFrame;
|
|
282
|
+
var visibleWords = run.words.filter(function (word) {
|
|
283
|
+
var wordStartFrame = getWordStartFrame(word.globalIndex, totalWords, typingFrames);
|
|
284
|
+
return frame + 2 >= wordStartFrame;
|
|
285
|
+
});
|
|
286
|
+
if (!visibleWords.length) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
290
|
+
key: "accent-group-".concat(run.words[0].globalIndex),
|
|
291
|
+
style: {
|
|
292
|
+
display: "inline-flex",
|
|
293
|
+
alignItems: "center",
|
|
294
|
+
opacity: accentGroupVisible ? accentGroupOpacity : 0,
|
|
295
|
+
transform: "translateY(".concat(accentGroupVisible ? (1 - accentGroupOpacity) * 10 : 10, "px) scale(").concat(accentGroupVisible ? 0.985 + accentGroupOpacity * 0.015 : 0.985, ")"),
|
|
296
|
+
filter: "blur(".concat(accentGroupVisible ? (1 - accentGroupOpacity) * 5 : 5, "px)"),
|
|
297
|
+
backgroundColor: accentColor,
|
|
298
|
+
color: accentContrast || "#000000",
|
|
299
|
+
padding: "0.08em 0.16em 0.12em",
|
|
300
|
+
marginRight: runIndex === lineRuns.length - 1 ? 0 : "0.12em",
|
|
301
|
+
borderRadius: "0.12em",
|
|
302
|
+
boxShadow: "0 0.2em 1em rgba(0, 0, 0, 0.22)",
|
|
303
|
+
textShadow: "none",
|
|
304
|
+
willChange: "transform, opacity, filter"
|
|
305
|
+
}
|
|
306
|
+
}, visibleWords.map(function (word, visibleWordIndex) {
|
|
307
|
+
var wordStartFrame = getWordStartFrame(word.globalIndex, totalWords, typingFrames);
|
|
308
|
+
var wordReveal = spring({
|
|
309
|
+
frame: frame - wordStartFrame + 2,
|
|
310
|
+
fps: fps,
|
|
311
|
+
config: {
|
|
312
|
+
damping: 20,
|
|
313
|
+
stiffness: 260,
|
|
314
|
+
mass: 0.55
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
var wordRevealProgress = Math.max(0, Math.min(1, wordReveal));
|
|
318
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
319
|
+
key: "".concat(word.text, "-").concat(word.globalIndex),
|
|
320
|
+
style: {
|
|
321
|
+
display: "inline-block",
|
|
322
|
+
opacity: wordRevealProgress,
|
|
323
|
+
transform: "translateY(".concat((1 - wordRevealProgress) * 8, "px)"),
|
|
324
|
+
filter: "blur(".concat((1 - wordRevealProgress) * 3, "px)"),
|
|
325
|
+
marginRight: visibleWordIndex === visibleWords.length - 1 ? 0 : "0.1em",
|
|
326
|
+
willChange: "transform, opacity, filter"
|
|
327
|
+
}
|
|
328
|
+
}, word.text);
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
var word = run.word;
|
|
332
|
+
var wordStartFrame = getWordStartFrame(word.globalIndex, totalWords, typingFrames);
|
|
333
|
+
var wordReveal = spring({
|
|
334
|
+
frame: frame - wordStartFrame + 2,
|
|
335
|
+
fps: fps,
|
|
336
|
+
config: {
|
|
337
|
+
damping: 20,
|
|
338
|
+
stiffness: 260,
|
|
339
|
+
mass: 0.55
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
var wordRevealProgress = Math.max(0, Math.min(1, wordReveal));
|
|
343
|
+
var wordVisible = frame + 2 >= wordStartFrame;
|
|
344
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
345
|
+
key: "".concat(word.text, "-").concat(word.globalIndex),
|
|
346
|
+
style: {
|
|
347
|
+
display: "inline-block",
|
|
348
|
+
opacity: wordVisible ? wordRevealProgress : 0,
|
|
349
|
+
transform: "translateY(".concat(wordVisible ? (1 - wordRevealProgress) * 10 : 10, "px) scale(").concat(wordVisible ? 0.985 + wordRevealProgress * 0.015 : 0.985, ")"),
|
|
350
|
+
filter: "blur(".concat(wordVisible ? (1 - wordRevealProgress) * 6 : 6, "px)"),
|
|
351
|
+
color: headlineColor,
|
|
352
|
+
textShadow: headlineTextShadow,
|
|
353
|
+
marginRight: runIndex === lineRuns.length - 1 ? 0 : "0.12em",
|
|
354
|
+
willChange: "transform, opacity, filter"
|
|
355
|
+
}
|
|
356
|
+
}, word.text);
|
|
357
|
+
}));
|
|
358
|
+
})));
|
|
359
|
+
};
|
|
360
|
+
var HookVideoLayer = function HookVideoLayer(_ref4) {
|
|
361
|
+
var videoUrl = _ref4.videoUrl,
|
|
362
|
+
startVideoFrom = _ref4.startVideoFrom,
|
|
363
|
+
muted = _ref4.muted,
|
|
364
|
+
faceMetadata = _ref4.faceMetadata,
|
|
365
|
+
sourceVideoOrientation = _ref4.sourceVideoOrientation,
|
|
366
|
+
plateRadius = _ref4.plateRadius,
|
|
367
|
+
renderWidth = _ref4.renderWidth,
|
|
368
|
+
renderHeight = _ref4.renderHeight,
|
|
369
|
+
transform = _ref4.transform,
|
|
370
|
+
filter = _ref4.filter;
|
|
371
|
+
if (faceMetadata) {
|
|
372
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
373
|
+
style: {
|
|
374
|
+
width: "100%",
|
|
375
|
+
height: "100%",
|
|
376
|
+
overflow: "hidden",
|
|
377
|
+
borderRadius: plateRadius,
|
|
378
|
+
transform: transform,
|
|
379
|
+
filter: filter
|
|
380
|
+
}
|
|
381
|
+
}, /*#__PURE__*/React.createElement(FaceCenteredVideo, {
|
|
382
|
+
src: videoUrl,
|
|
383
|
+
startFrom: startVideoFrom,
|
|
384
|
+
containerWidth: renderWidth,
|
|
385
|
+
containerHeight: renderHeight,
|
|
386
|
+
faceMetadata: faceMetadata,
|
|
387
|
+
useAveragePosition: true,
|
|
388
|
+
centerHorizontally: false,
|
|
389
|
+
muted: muted
|
|
390
|
+
}));
|
|
391
|
+
}
|
|
392
|
+
return /*#__PURE__*/React.createElement(OffthreadVideo, {
|
|
393
|
+
pauseWhenBuffering: true,
|
|
394
|
+
startFrom: startVideoFrom,
|
|
395
|
+
src: videoUrl,
|
|
396
|
+
muted: muted,
|
|
397
|
+
style: {
|
|
398
|
+
width: "100%",
|
|
399
|
+
height: "100%",
|
|
400
|
+
objectFit: "cover",
|
|
401
|
+
borderRadius: plateRadius,
|
|
402
|
+
objectPosition: sourceVideoOrientation === "portrait" ? "50% 28%" : "center center",
|
|
403
|
+
transform: transform,
|
|
404
|
+
filter: filter
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
export var HookVideo = function HookVideo(_ref5) {
|
|
409
|
+
var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
|
|
410
|
+
var videoUrl = _ref5.videoUrl,
|
|
411
|
+
startVideoFrom = _ref5.startVideoFrom,
|
|
412
|
+
durationInFrames = _ref5.durationInFrames,
|
|
413
|
+
muted = _ref5.muted,
|
|
414
|
+
frameColor = _ref5.frameColor,
|
|
415
|
+
logoUrl = _ref5.logoUrl,
|
|
416
|
+
videoZoom = _ref5.videoZoom,
|
|
417
|
+
sourceVideoOrientation = _ref5.sourceVideoOrientation,
|
|
418
|
+
children = _ref5.children,
|
|
419
|
+
faceMetadata = _ref5.faceMetadata,
|
|
420
|
+
noBackgroundVideoEffects = _ref5.noBackgroundVideoEffects,
|
|
421
|
+
noBackgroundVideoUrl = _ref5.noBackgroundVideoUrl,
|
|
422
|
+
_ref5$disableTransiti = _ref5.disableTransitionSounds,
|
|
423
|
+
disableTransitionSounds = _ref5$disableTransiti === void 0 ? false : _ref5$disableTransiti,
|
|
424
|
+
_ref5$useSquareInLand = _ref5.useSquareInLandscape,
|
|
425
|
+
useSquareInLandscape = _ref5$useSquareInLand === void 0 ? false : _ref5$useSquareInLand,
|
|
426
|
+
hookText = _ref5.hookText,
|
|
427
|
+
_ref5$hookStyle = _ref5.hookStyle,
|
|
428
|
+
hookStyle = _ref5$hookStyle === void 0 ? HOOK_STYLE_PRESETS.punch_zoom : _ref5$hookStyle,
|
|
429
|
+
_ref5$hookDurationSec = _ref5.hookDurationSeconds,
|
|
430
|
+
hookDurationSeconds = _ref5$hookDurationSec === void 0 ? 1.6 : _ref5$hookDurationSec,
|
|
431
|
+
hookAccentText = _ref5.hookAccentText,
|
|
432
|
+
_ref5$disableHookSoun = _ref5.disableHookSounds,
|
|
433
|
+
disableHookSounds = _ref5$disableHookSoun === void 0 ? false : _ref5$disableHookSoun;
|
|
434
|
+
var frame = useCurrentFrame();
|
|
435
|
+
var _useVideoConfig = useVideoConfig(),
|
|
436
|
+
outputWidth = _useVideoConfig.width,
|
|
437
|
+
outputHeight = _useVideoConfig.height,
|
|
438
|
+
fps = _useVideoConfig.fps,
|
|
439
|
+
_useVideoConfig$props = _useVideoConfig.props,
|
|
440
|
+
compositionProps = _useVideoConfig$props === void 0 ? {} : _useVideoConfig$props;
|
|
441
|
+
var outputOrientation = (compositionProps === null || compositionProps === void 0 ? void 0 : (_compositionProps$out = compositionProps.output) === null || _compositionProps$out === void 0 ? void 0 : _compositionProps$out.orientation) || (typeof window !== "undefined" ? (_window = window) === null || _window === void 0 ? void 0 : (_window$screenplayPro = _window.screenplayProps) === null || _window$screenplayPro === void 0 ? void 0 : (_window$screenplayPro2 = _window$screenplayPro.output) === null || _window$screenplayPro2 === void 0 ? void 0 : _window$screenplayPro2.orientation : undefined);
|
|
442
|
+
var shouldUseSquareInLandscape = Boolean(useSquareInLandscape) && outputOrientation === "landscape";
|
|
443
|
+
var activeOrientation = (shouldUseSquareInLandscape ? "square" : outputOrientation) || (outputWidth === outputHeight ? "square" : outputWidth > outputHeight ? "landscape" : "portrait");
|
|
444
|
+
var squareSize = 1080;
|
|
445
|
+
var width = shouldUseSquareInLandscape ? squareSize : outputWidth;
|
|
446
|
+
var height = shouldUseSquareInLandscape ? squareSize : outputHeight;
|
|
447
|
+
var renderOffsetX = shouldUseSquareInLandscape ? (outputWidth - squareSize) / 2 : 0;
|
|
448
|
+
var orientationOverride = shouldUseSquareInLandscape ? "square" : undefined;
|
|
449
|
+
var _useVirtualBackground = useVirtualBackground(),
|
|
450
|
+
isVirtual = _useVirtualBackground.isVirtual,
|
|
451
|
+
virtualBgUrl = _useVirtualBackground.url;
|
|
452
|
+
var showVirtual = isVirtual && !!noBackgroundVideoUrl;
|
|
453
|
+
var _useTheme = useTheme(),
|
|
454
|
+
accentColor = _useTheme.accentColor,
|
|
455
|
+
accentContrast = _useTheme.accentContrast,
|
|
456
|
+
primaryColor = _useTheme.primaryColor,
|
|
457
|
+
primaryContrast = _useTheme.primaryContrast;
|
|
458
|
+
var style = Object.values(HOOK_STYLE_PRESETS).includes(hookStyle) ? hookStyle : HOOK_STYLE_PRESETS.punch_zoom;
|
|
459
|
+
var baseZoom = videoZoom || 1;
|
|
460
|
+
var _getHookTiming = getHookTiming({
|
|
461
|
+
durationInFrames: durationInFrames,
|
|
462
|
+
hookDurationSeconds: hookDurationSeconds,
|
|
463
|
+
fps: fps
|
|
464
|
+
}),
|
|
465
|
+
effectiveHookFrames = _getHookTiming.effectiveHookFrames,
|
|
466
|
+
settleFrames = _getHookTiming.settleFrames,
|
|
467
|
+
shortSegment = _getHookTiming.shortSegment;
|
|
468
|
+
var preset = useOrientationBased({
|
|
469
|
+
landscape: {
|
|
470
|
+
textBoxWidth: style === HOOK_STYLE_PRESETS.split_reveal ? width * 0.38 : style === HOOK_STYLE_PRESETS.mono_shock ? width * 0.46 : width * 0.58,
|
|
471
|
+
textBoxHeight: style === HOOK_STYLE_PRESETS.split_reveal ? height * 0.62 : style === HOOK_STYLE_PRESETS.mono_shock ? height * 0.38 : height * 0.54,
|
|
472
|
+
maxFontSize: style === HOOK_STYLE_PRESETS.glitch_verdict ? 138 : 148,
|
|
473
|
+
top: style === HOOK_STYLE_PRESETS.split_reveal ? height * 0.18 : style === HOOK_STYLE_PRESETS.mono_shock ? height * 0.17 : height * 0.19,
|
|
474
|
+
left: style === HOOK_STYLE_PRESETS.split_reveal ? CHROME_PADDING * 2.2 : style === HOOK_STYLE_PRESETS.mono_shock || style === HOOK_STYLE_PRESETS.glitch_verdict ? CHROME_PADDING * 2.1 : width * 0.21,
|
|
475
|
+
align: style === HOOK_STYLE_PRESETS.punch_zoom || style === HOOK_STYLE_PRESETS.border_alarm ? "center" : "left"
|
|
476
|
+
},
|
|
477
|
+
portrait: {
|
|
478
|
+
textBoxWidth: style === HOOK_STYLE_PRESETS.split_reveal ? width * 0.78 : style === HOOK_STYLE_PRESETS.mono_shock ? width * 0.76 : width * 0.84,
|
|
479
|
+
textBoxHeight: style === HOOK_STYLE_PRESETS.mono_shock ? height * 0.28 : height * 0.36,
|
|
480
|
+
maxFontSize: style === HOOK_STYLE_PRESETS.glitch_verdict ? 118 : 126,
|
|
481
|
+
top: style === HOOK_STYLE_PRESETS.mono_shock ? height * 0.15 : style === HOOK_STYLE_PRESETS.split_reveal ? height * 0.18 : height * 0.16,
|
|
482
|
+
left: style === HOOK_STYLE_PRESETS.punch_zoom || style === HOOK_STYLE_PRESETS.border_alarm ? width * 0.08 : CHROME_PADDING * 1.8,
|
|
483
|
+
align: style === HOOK_STYLE_PRESETS.punch_zoom || style === HOOK_STYLE_PRESETS.border_alarm ? "center" : "left"
|
|
484
|
+
},
|
|
485
|
+
square: {
|
|
486
|
+
textBoxWidth: style === HOOK_STYLE_PRESETS.split_reveal ? width * 0.46 : style === HOOK_STYLE_PRESETS.mono_shock ? width * 0.52 : width * 0.72,
|
|
487
|
+
textBoxHeight: style === HOOK_STYLE_PRESETS.split_reveal ? height * 0.62 : style === HOOK_STYLE_PRESETS.mono_shock ? height * 0.32 : height * 0.42,
|
|
488
|
+
maxFontSize: 116,
|
|
489
|
+
top: style === HOOK_STYLE_PRESETS.mono_shock ? height * 0.15 : style === HOOK_STYLE_PRESETS.split_reveal ? height * 0.16 : height * 0.18,
|
|
490
|
+
left: style === HOOK_STYLE_PRESETS.punch_zoom || style === HOOK_STYLE_PRESETS.border_alarm ? width * 0.14 : CHROME_PADDING * 1.8,
|
|
491
|
+
align: style === HOOK_STYLE_PRESETS.punch_zoom || style === HOOK_STYLE_PRESETS.border_alarm ? "center" : "left"
|
|
492
|
+
}
|
|
493
|
+
}, orientationOverride);
|
|
494
|
+
var monoOverlayHoldFrames = style === HOOK_STYLE_PRESETS.mono_shock ? Math.round(fps * 0.55) : 0;
|
|
495
|
+
var overlayFadeFrames = style === HOOK_STYLE_PRESETS.mono_shock ? 12 : 6;
|
|
496
|
+
var overlayEndFrame = shortSegment ? durationInFrames : Math.min(durationInFrames, effectiveHookFrames + monoOverlayHoldFrames);
|
|
497
|
+
var hookOverlayOpacity = shortSegment ? 1 : interpolate(frame, [Math.max(overlayEndFrame - overlayFadeFrames, 0), overlayEndFrame], [1, 0], {
|
|
498
|
+
extrapolateLeft: "clamp",
|
|
499
|
+
extrapolateRight: "clamp"
|
|
500
|
+
});
|
|
501
|
+
var childrenOpacity = shortSegment ? 0 : interpolate(frame, [overlayEndFrame, overlayEndFrame + Math.max(6, settleFrames)], [0, 1], {
|
|
502
|
+
extrapolateLeft: "clamp",
|
|
503
|
+
extrapolateRight: "clamp"
|
|
504
|
+
});
|
|
505
|
+
var logoOpacity = shortSegment ? 0 : style === HOOK_STYLE_PRESETS.mono_shock ? interpolate(frame, [overlayEndFrame, overlayEndFrame + Math.max(8, settleFrames + 4)], [0, 1], {
|
|
506
|
+
extrapolateLeft: "clamp",
|
|
507
|
+
extrapolateRight: "clamp"
|
|
508
|
+
}) : Math.max(childrenOpacity, 0.35);
|
|
509
|
+
var flashOpacity = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, interpolate(frame, [0, 2, 6], [0.48, 0.12, 0], {
|
|
510
|
+
extrapolateLeft: "clamp",
|
|
511
|
+
extrapolateRight: "clamp"
|
|
512
|
+
})), HOOK_STYLE_PRESETS.mono_shock, interpolate(frame, [0, 4], [0.22, 0], {
|
|
513
|
+
extrapolateLeft: "clamp",
|
|
514
|
+
extrapolateRight: "clamp"
|
|
515
|
+
})), HOOK_STYLE_PRESETS.glitch_verdict, interpolate(frame, [0, 1, 5], [0.4, 0.18, 0], {
|
|
516
|
+
extrapolateLeft: "clamp",
|
|
517
|
+
extrapolateRight: "clamp"
|
|
518
|
+
})), HOOK_STYLE_PRESETS.border_alarm, 0), HOOK_STYLE_PRESETS.split_reveal, 0)[style];
|
|
519
|
+
var letterboxHeight = style === HOOK_STYLE_PRESETS.mono_shock ? interpolate(frame, [0, effectiveHookFrames, overlayEndFrame], [0, height * 0.11, height * 0.11], {
|
|
520
|
+
extrapolateLeft: "clamp",
|
|
521
|
+
extrapolateRight: "clamp"
|
|
522
|
+
}) * hookOverlayOpacity : 0;
|
|
523
|
+
var borderWidth = style === HOOK_STYLE_PRESETS.border_alarm ? interpolate(frame, [0, effectiveHookFrames], [24, 0], {
|
|
524
|
+
extrapolateLeft: "clamp",
|
|
525
|
+
extrapolateRight: "clamp"
|
|
526
|
+
}) : 0;
|
|
527
|
+
var splitPlateTranslate = style === HOOK_STYLE_PRESETS.split_reveal ? interpolate(frame, [0, effectiveHookFrames], [0, -width * 0.6], {
|
|
528
|
+
extrapolateLeft: "clamp",
|
|
529
|
+
extrapolateRight: "clamp"
|
|
530
|
+
}) : 0;
|
|
531
|
+
var glitchOpacity = style === HOOK_STYLE_PRESETS.glitch_verdict ? interpolate(frame, [0, effectiveHookFrames], [0.34, 0], {
|
|
532
|
+
extrapolateLeft: "clamp",
|
|
533
|
+
extrapolateRight: "clamp"
|
|
534
|
+
}) : 0;
|
|
535
|
+
var _getVideoTreatment = getVideoTreatment({
|
|
536
|
+
frame: frame,
|
|
537
|
+
style: style,
|
|
538
|
+
hookFrames: effectiveHookFrames,
|
|
539
|
+
settleFrames: settleFrames,
|
|
540
|
+
durationInFrames: durationInFrames,
|
|
541
|
+
baseZoom: baseZoom
|
|
542
|
+
}),
|
|
543
|
+
videoTransform = _getVideoTreatment.transform,
|
|
544
|
+
videoFilter = _getVideoTreatment.filter;
|
|
545
|
+
var usesOuterFrame = Boolean(frameColor) && style !== HOOK_STYLE_PRESETS.mono_shock;
|
|
546
|
+
var plateRadius = style === HOOK_STYLE_PRESETS.mono_shock ? 0 : frameColor ? 30 : 0;
|
|
547
|
+
var outerPadding = usesOuterFrame ? CHROME_PADDING : 0;
|
|
548
|
+
var contentWidth = width - outerPadding * 2;
|
|
549
|
+
var contentHeight = height - outerPadding * 2;
|
|
550
|
+
var playHookSounds = !disableTransitionSounds && !disableHookSounds;
|
|
551
|
+
var monoShockInset = style === HOOK_STYLE_PRESETS.mono_shock && activeOrientation === "landscape" ? letterboxHeight : 0;
|
|
552
|
+
var monoShockRadius = style === HOOK_STYLE_PRESETS.mono_shock ? 0 : plateRadius;
|
|
553
|
+
var monoShockStageStyle = style === HOOK_STYLE_PRESETS.mono_shock ? {
|
|
554
|
+
position: "absolute",
|
|
555
|
+
inset: 0,
|
|
556
|
+
top: monoShockInset,
|
|
557
|
+
bottom: monoShockInset,
|
|
558
|
+
overflow: "hidden",
|
|
559
|
+
borderRadius: monoShockRadius
|
|
560
|
+
} : {
|
|
561
|
+
position: "absolute",
|
|
562
|
+
inset: 0,
|
|
563
|
+
overflow: "hidden",
|
|
564
|
+
borderRadius: plateRadius
|
|
565
|
+
};
|
|
566
|
+
var hookTint = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HOOK_STYLE_PRESETS.punch_zoom, "linear-gradient(135deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.06) 38%, ".concat(accentColor, "33 100%)")), HOOK_STYLE_PRESETS.mono_shock, "linear-gradient(100deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.54) 36%, rgba(14, 14, 18, 0.24) 72%, rgba(14, 14, 18, 0.4) 100%)"), HOOK_STYLE_PRESETS.glitch_verdict, "linear-gradient(140deg, rgba(5, 5, 5, 0.72), rgba(30, 30, 30, 0.24) 55%, rgba(255, 32, 112, 0.22) 100%)"), HOOK_STYLE_PRESETS.border_alarm, "radial-gradient(circle at center, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.55) 85%)"), HOOK_STYLE_PRESETS.split_reveal, "transparent")[style];
|
|
567
|
+
var content = /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
568
|
+
style: {
|
|
569
|
+
width: width,
|
|
570
|
+
height: height,
|
|
571
|
+
left: renderOffsetX,
|
|
572
|
+
top: 0
|
|
573
|
+
}
|
|
574
|
+
}, /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
575
|
+
style: {
|
|
576
|
+
backgroundColor: style === HOOK_STYLE_PRESETS.mono_shock ? primaryColor || "#5a4a86" : frameColor || "transparent",
|
|
577
|
+
padding: outerPadding,
|
|
578
|
+
isolation: "isolate"
|
|
579
|
+
}
|
|
580
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
581
|
+
style: {
|
|
582
|
+
position: "relative",
|
|
583
|
+
width: "100%",
|
|
584
|
+
height: "100%",
|
|
585
|
+
overflow: "hidden",
|
|
586
|
+
borderRadius: plateRadius,
|
|
587
|
+
backgroundColor: style === HOOK_STYLE_PRESETS.mono_shock ? primaryColor || "#5a4a86" : "#050505"
|
|
588
|
+
}
|
|
589
|
+
}, showVirtual && virtualBgUrl ? /*#__PURE__*/React.createElement(VirtualBackgroundUnderlay, {
|
|
590
|
+
url: virtualBgUrl,
|
|
591
|
+
top: 0,
|
|
592
|
+
left: 0,
|
|
593
|
+
width: contentWidth,
|
|
594
|
+
height: contentHeight,
|
|
595
|
+
borderRadius: plateRadius,
|
|
596
|
+
zIndex: 0
|
|
597
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
598
|
+
style: monoShockStageStyle
|
|
599
|
+
}, /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
600
|
+
style: {
|
|
601
|
+
filter: !showVirtual && noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundDim && noBackgroundVideoUrl ? "brightness(0.78)" : undefined
|
|
602
|
+
}
|
|
603
|
+
}, /*#__PURE__*/React.createElement(HookVideoLayer, {
|
|
604
|
+
videoUrl: videoUrl,
|
|
605
|
+
startVideoFrom: startVideoFrom,
|
|
606
|
+
muted: muted,
|
|
607
|
+
faceMetadata: faceMetadata,
|
|
608
|
+
sourceVideoOrientation: sourceVideoOrientation,
|
|
609
|
+
plateRadius: monoShockRadius,
|
|
610
|
+
renderWidth: contentWidth,
|
|
611
|
+
renderHeight: contentHeight,
|
|
612
|
+
transform: videoTransform,
|
|
613
|
+
filter: videoFilter
|
|
614
|
+
})), noBackgroundVideoUrl && (showVirtual || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.facePop || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundDim || noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundBlur) ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
615
|
+
style: {
|
|
616
|
+
zIndex: 4,
|
|
617
|
+
overflow: "hidden",
|
|
618
|
+
borderRadius: monoShockRadius,
|
|
619
|
+
filter: noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.facePop ? "brightness(1.08) contrast(1.14) saturate(1.04)" : undefined
|
|
620
|
+
}
|
|
621
|
+
}, faceMetadata ? /*#__PURE__*/React.createElement("div", {
|
|
622
|
+
style: {
|
|
623
|
+
width: "100%",
|
|
624
|
+
height: "100%",
|
|
625
|
+
transform: videoTransform
|
|
626
|
+
}
|
|
627
|
+
}, /*#__PURE__*/React.createElement(FaceCenteredVideo, {
|
|
628
|
+
src: noBackgroundVideoUrl,
|
|
629
|
+
startFrom: startVideoFrom,
|
|
630
|
+
containerWidth: contentWidth,
|
|
631
|
+
containerHeight: contentHeight,
|
|
632
|
+
faceMetadata: faceMetadata,
|
|
633
|
+
useAveragePosition: true,
|
|
634
|
+
centerHorizontally: false,
|
|
635
|
+
muted: true,
|
|
636
|
+
transparent: true,
|
|
637
|
+
noBackgroundVideoEffects: noBackgroundVideoEffects
|
|
638
|
+
})) : /*#__PURE__*/React.createElement(OffthreadVideo, {
|
|
639
|
+
pauseWhenBuffering: true,
|
|
640
|
+
startFrom: startVideoFrom,
|
|
641
|
+
src: noBackgroundVideoUrl,
|
|
642
|
+
muted: true,
|
|
643
|
+
transparent: true,
|
|
644
|
+
style: {
|
|
645
|
+
width: "100%",
|
|
646
|
+
height: "100%",
|
|
647
|
+
objectFit: "cover",
|
|
648
|
+
borderRadius: monoShockRadius,
|
|
649
|
+
transform: videoTransform
|
|
650
|
+
}
|
|
651
|
+
})) : null, !showVirtual && noBackgroundVideoEffects !== null && noBackgroundVideoEffects !== void 0 && noBackgroundVideoEffects.backgroundBlur && noBackgroundVideoUrl ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
652
|
+
style: {
|
|
653
|
+
zIndex: 3,
|
|
654
|
+
backdropFilter: "blur(10px)"
|
|
655
|
+
}
|
|
656
|
+
}) : null), style === HOOK_STYLE_PRESETS.split_reveal ? /*#__PURE__*/React.createElement("div", {
|
|
657
|
+
style: {
|
|
658
|
+
position: "absolute",
|
|
659
|
+
inset: 0,
|
|
660
|
+
zIndex: 14,
|
|
661
|
+
opacity: hookOverlayOpacity,
|
|
662
|
+
pointerEvents: "none"
|
|
663
|
+
}
|
|
664
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
665
|
+
style: {
|
|
666
|
+
position: "absolute",
|
|
667
|
+
top: 0,
|
|
668
|
+
bottom: 0,
|
|
669
|
+
left: 0,
|
|
670
|
+
width: width * 0.58,
|
|
671
|
+
transform: "translateX(".concat(splitPlateTranslate, "px)"),
|
|
672
|
+
background: "linear-gradient(135deg, ".concat(accentColor, "f0, ").concat(primaryColor, "f0 68%, rgba(0, 0, 0, 0.2))"),
|
|
673
|
+
clipPath: "polygon(0 0, 82% 0, 100% 100%, 0 100%)"
|
|
674
|
+
}
|
|
675
|
+
})) : null, hookTint !== "transparent" ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
676
|
+
style: {
|
|
677
|
+
zIndex: 11,
|
|
678
|
+
opacity: hookOverlayOpacity,
|
|
679
|
+
background: hookTint,
|
|
680
|
+
pointerEvents: "none"
|
|
681
|
+
}
|
|
682
|
+
}) : null, style === HOOK_STYLE_PRESETS.border_alarm ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
683
|
+
style: {
|
|
684
|
+
zIndex: 15,
|
|
685
|
+
opacity: hookOverlayOpacity,
|
|
686
|
+
pointerEvents: "none"
|
|
687
|
+
}
|
|
688
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
689
|
+
style: {
|
|
690
|
+
position: "absolute",
|
|
691
|
+
inset: Math.max(borderWidth / 2, 0),
|
|
692
|
+
border: "".concat(Math.max(borderWidth, 0), "px solid ").concat(accentColor),
|
|
693
|
+
borderRadius: Math.max(plateRadius, 18),
|
|
694
|
+
boxShadow: "0 0 0 1px rgba(255,255,255,0.25), 0 0 42px ".concat(accentColor, "66")
|
|
695
|
+
}
|
|
696
|
+
})) : null, style === HOOK_STYLE_PRESETS.mono_shock && letterboxHeight > 0 ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
697
|
+
style: {
|
|
698
|
+
zIndex: 15,
|
|
699
|
+
opacity: hookOverlayOpacity,
|
|
700
|
+
pointerEvents: "none"
|
|
701
|
+
}
|
|
702
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
703
|
+
style: {
|
|
704
|
+
position: "absolute",
|
|
705
|
+
top: monoShockInset,
|
|
706
|
+
left: 0,
|
|
707
|
+
right: 0,
|
|
708
|
+
height: 2,
|
|
709
|
+
backgroundColor: "rgba(0, 0, 0, 0.38)",
|
|
710
|
+
boxShadow: "0 1px 0 rgba(255, 255, 255, 0.18)"
|
|
711
|
+
}
|
|
712
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
713
|
+
style: {
|
|
714
|
+
position: "absolute",
|
|
715
|
+
bottom: monoShockInset,
|
|
716
|
+
left: 0,
|
|
717
|
+
right: 0,
|
|
718
|
+
height: 2,
|
|
719
|
+
backgroundColor: "rgba(0, 0, 0, 0.38)",
|
|
720
|
+
boxShadow: "0 -1px 0 rgba(255, 255, 255, 0.18)"
|
|
721
|
+
}
|
|
722
|
+
})) : null, style === HOOK_STYLE_PRESETS.glitch_verdict ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
723
|
+
style: {
|
|
724
|
+
zIndex: 17,
|
|
725
|
+
opacity: glitchOpacity * hookOverlayOpacity,
|
|
726
|
+
mixBlendMode: "screen",
|
|
727
|
+
pointerEvents: "none"
|
|
728
|
+
}
|
|
729
|
+
}, /*#__PURE__*/React.createElement(Img, {
|
|
730
|
+
src: staticFile("glitch1.png"),
|
|
731
|
+
style: {
|
|
732
|
+
position: "absolute",
|
|
733
|
+
inset: 0,
|
|
734
|
+
width: "100%",
|
|
735
|
+
height: "100%",
|
|
736
|
+
objectFit: "cover",
|
|
737
|
+
opacity: frame % 3 === 0 ? 0.5 : 0.2
|
|
738
|
+
}
|
|
739
|
+
}), /*#__PURE__*/React.createElement(Img, {
|
|
740
|
+
src: staticFile("glitch2.png"),
|
|
741
|
+
style: {
|
|
742
|
+
position: "absolute",
|
|
743
|
+
inset: 0,
|
|
744
|
+
width: "100%",
|
|
745
|
+
height: "100%",
|
|
746
|
+
objectFit: "cover",
|
|
747
|
+
opacity: frame % 2 === 0 ? 0.35 : 0.12
|
|
748
|
+
}
|
|
749
|
+
})) : null, flashOpacity > 0 ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
750
|
+
style: {
|
|
751
|
+
zIndex: 18,
|
|
752
|
+
opacity: flashOpacity,
|
|
753
|
+
background: style === HOOK_STYLE_PRESETS.glitch_verdict ? "linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,0,85,0.16))" : "rgba(255, 255, 255, 0.92)",
|
|
754
|
+
mixBlendMode: "screen",
|
|
755
|
+
pointerEvents: "none"
|
|
756
|
+
}
|
|
757
|
+
}) : null, /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
758
|
+
style: {
|
|
759
|
+
zIndex: 20,
|
|
760
|
+
opacity: hookOverlayOpacity,
|
|
761
|
+
pointerEvents: "none"
|
|
762
|
+
}
|
|
763
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
764
|
+
style: {
|
|
765
|
+
position: "absolute",
|
|
766
|
+
top: preset.top,
|
|
767
|
+
left: preset.left,
|
|
768
|
+
width: preset.textBoxWidth,
|
|
769
|
+
maxWidth: preset.textBoxWidth
|
|
770
|
+
}
|
|
771
|
+
}, /*#__PURE__*/React.createElement(HookHeadline, {
|
|
772
|
+
hookText: hookText,
|
|
773
|
+
hookAccentText: hookAccentText,
|
|
774
|
+
maxWidth: preset.textBoxWidth,
|
|
775
|
+
maxHeight: preset.textBoxHeight,
|
|
776
|
+
maxFontSize: preset.maxFontSize,
|
|
777
|
+
align: preset.align,
|
|
778
|
+
accentColor: accentColor,
|
|
779
|
+
accentContrast: accentContrast,
|
|
780
|
+
primaryContrast: primaryContrast,
|
|
781
|
+
style: style,
|
|
782
|
+
frame: frame,
|
|
783
|
+
fps: fps,
|
|
784
|
+
hookFrames: effectiveHookFrames
|
|
785
|
+
}))), /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
786
|
+
style: {
|
|
787
|
+
zIndex: 28,
|
|
788
|
+
opacity: 1
|
|
789
|
+
}
|
|
790
|
+
}, children), logoUrl ? /*#__PURE__*/React.createElement("div", {
|
|
791
|
+
style: {
|
|
792
|
+
position: "absolute",
|
|
793
|
+
zIndex: 29,
|
|
794
|
+
top: CHROME_PADDING * 0.9,
|
|
795
|
+
right: CHROME_PADDING * 0.9,
|
|
796
|
+
opacity: logoOpacity
|
|
797
|
+
}
|
|
798
|
+
}, /*#__PURE__*/React.createElement(PausableImg, {
|
|
799
|
+
src: logoUrl,
|
|
800
|
+
delayRenderTimeoutInMilliseconds: 60000,
|
|
801
|
+
style: {
|
|
802
|
+
width: width < 1200 ? 160 : 210,
|
|
803
|
+
objectFit: "contain"
|
|
804
|
+
}
|
|
805
|
+
})) : null)), playHookSounds ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Audio, {
|
|
806
|
+
src: staticFile("swoosh.mp3"),
|
|
807
|
+
volume: 0.28
|
|
808
|
+
}), !shortSegment ? /*#__PURE__*/React.createElement(Sequence, {
|
|
809
|
+
from: effectiveHookFrames
|
|
810
|
+
}, /*#__PURE__*/React.createElement(Audio, {
|
|
811
|
+
src: staticFile("ding-short.mp3"),
|
|
812
|
+
volume: function volume(localFrame) {
|
|
813
|
+
return interpolate(localFrame, [0, 2, 10], [0, 0.28, 0], {
|
|
814
|
+
extrapolateLeft: "clamp",
|
|
815
|
+
extrapolateRight: "clamp"
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
})) : null) : null);
|
|
819
|
+
return content;
|
|
820
|
+
};
|