feat: add Ken Burns effect, fix caption visibility and Facebook binary upload

- Add slow zoom/pan (Ken Burns) effect to each image slide, cycling through
  8 deterministic presets per image index for natural variety
- CapCut-style captions: semi-transparent pill background + yellow glow on
  active word; background/text now only visible while voice is speaking
- Fix Facebook error 6000: pass Node.js Buffer directly instead of unsafe
  ArrayBuffer pool-slice conversion which could corrupt the upload payload
- Fix TypeScript error: replace u-flag emoji regex with BMP surrogate pairs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Sonnet 4.6 committed 2026-03-25 17:01:52 +01:00
1 parent 487a8ee352
commit 5d7ab93bf8
3 files changed
+8 -24

No files matched your search

+5 -19
View File
@@ -165,27 +165,13 @@ export const ImageComposition = ({
? wordTimings.findIndex(w => frame >= w.startFrame && frame < w.endFrame)
: -1;
// Determine which group is currently active
const currentGroupIdx = activeWordIdx >= 0 ? Math.floor(activeWordIdx / WORDS_PER_GROUP) : -1;
// Only show caption when a word is actively being spoken
const renderCaption = frame < endingStart && activeWordIdx >= 0;
// Determine the last group that was visible (for holding display between words)
const lastActiveWordIdx = wordTimings
? [...wordTimings].reverse().findIndex(w => frame >= w.startFrame)
: -1;
const resolvedLastIdx = lastActiveWordIdx >= 0 && wordTimings
? wordTimings.length - 1 - lastActiveWordIdx
: -1;
const displayGroupIdx = activeWordIdx >= 0
? currentGroupIdx
: resolvedLastIdx >= 0
? Math.floor(resolvedLastIdx / WORDS_PER_GROUP)
: -1;
const renderCaption = frame < endingStart && wordTimings && wordTimings.length > 0 && displayGroupIdx >= 0;
const groupStart = displayGroupIdx * WORDS_PER_GROUP;
const groupIdx = activeWordIdx >= 0 ? Math.floor(activeWordIdx / WORDS_PER_GROUP) : 0;
const groupStart = groupIdx * WORDS_PER_GROUP;
const groupWords = wordTimings ? wordTimings.slice(groupStart, groupStart + WORDS_PER_GROUP) : [];
const activeIdxInGroup = activeWordIdx >= 0 ? activeWordIdx - groupStart : -1;
const activeIdxInGroup = activeWordIdx - groupStart;
// First frame of the current group (for fade-in)
const groupFirstFrame = groupWords.length > 0 ? groupWords[0].startFrame : 0;