From 364fb201b89e82d2645b095fc327c017c516d774 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Sat, 24 Jan 2026 13:57:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=B1=20Add=20PortalPresentationMobile?= =?UTF-8?q?=20composition=20for=20mobile=20(1080x1920)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create PortalPresentationMobile.tsx for portrait mobile resolution - Register PortalPresentationMobile composition in Root.tsx - Add comprehensive tests for the mobile composition - Reuse existing portal scenes which adapt via useVideoConfig() - Mobile version has same scene structure and timing as desktop Co-Authored-By: Claude Opus 4.5 --- videos/src/PortalPresentationMobile.test.tsx | 398 +++++++++++++++++++ videos/src/PortalPresentationMobile.tsx | 238 +++++++++++ videos/src/Root.tsx | 9 + 3 files changed, 645 insertions(+) create mode 100644 videos/src/PortalPresentationMobile.test.tsx create mode 100644 videos/src/PortalPresentationMobile.tsx diff --git a/videos/src/PortalPresentationMobile.test.tsx b/videos/src/PortalPresentationMobile.test.tsx new file mode 100644 index 0000000..bdfbf60 --- /dev/null +++ b/videos/src/PortalPresentationMobile.test.tsx @@ -0,0 +1,398 @@ +import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; +import { render, cleanup } from "@testing-library/react"; +import { PortalPresentationMobile } from "./PortalPresentationMobile"; + +/* eslint-disable @remotion/warn-native-media-tag */ +// Mock Remotion hooks +vi.mock("remotion", () => ({ + useCurrentFrame: vi.fn(() => 60), + useVideoConfig: vi.fn(() => ({ + fps: 30, + width: 1080, + height: 1920, + durationInFrames: 2700, + })), + interpolate: vi.fn((value, inputRange, outputRange, options) => { + const [inMin, inMax] = inputRange; + const [outMin, outMax] = outputRange; + let progress = (value - inMin) / (inMax - inMin); + if (options?.extrapolateLeft === "clamp") { + progress = Math.max(0, progress); + } + if (options?.extrapolateRight === "clamp") { + progress = Math.min(1, progress); + } + return outMin + progress * (outMax - outMin); + }), + spring: vi.fn(() => 1), + AbsoluteFill: vi.fn(({ children, className, style }) => ( +
+ {children} +
+ )), + Img: vi.fn(({ src, className, style }) => ( + + )), + staticFile: vi.fn((path: string) => `/static/${path}`), + Sequence: vi.fn(({ children, from, durationInFrames, premountFor }) => ( +
+ {children} +
+ )), + Easing: { + out: vi.fn((fn) => fn), + cubic: vi.fn((t: number) => t), + }, +})); + +// Mock @remotion/media +vi.mock("@remotion/media", () => ({ + Audio: vi.fn(({ src, volume, loop }) => ( +