From e9b55b60aa899d47f6b195d61004bddaaffb8046 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Sat, 24 Jan 2026 13:29:49 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=AC=20Add=20CountryStatsScene=20compon?= =?UTF-8?q?ent=20for=20Top=20L=C3=A4nder=20(Scene=205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements the Country Statistics scene which visualizes the geographic reach of the Bitcoin community across German-speaking countries with animated country bars, sparkline charts, and user counts. Features: - 3D perspective entrance animation for smooth scene transition - Sequential country reveals with staggered timing (12 frame delay) - CountryBar components with animated progress bars and user counts - SparklineChart components showing growth trends for each country - Total users badge with globe icon - Audio: success-chime per country, slide-in for section entrance - Countries displayed: Germany, Austria, Switzerland, Luxembourg, Bulgaria, and Spain Co-Authored-By: Claude Opus 4.5 --- .../scenes/portal/CountryStatsScene.test.tsx | 276 ++++++++++++ .../src/scenes/portal/CountryStatsScene.tsx | 394 ++++++++++++++++++ 2 files changed, 670 insertions(+) create mode 100644 videos/src/scenes/portal/CountryStatsScene.test.tsx create mode 100644 videos/src/scenes/portal/CountryStatsScene.tsx diff --git a/videos/src/scenes/portal/CountryStatsScene.test.tsx b/videos/src/scenes/portal/CountryStatsScene.test.tsx new file mode 100644 index 0000000..df86db9 --- /dev/null +++ b/videos/src/scenes/portal/CountryStatsScene.test.tsx @@ -0,0 +1,276 @@ +import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; +import { render, cleanup } from "@testing-library/react"; +import { CountryStatsScene } from "./CountryStatsScene"; + +/* eslint-disable @remotion/warn-native-media-tag */ +// Mock Remotion hooks +vi.mock("remotion", () => ({ + useCurrentFrame: vi.fn(() => 60), + useVideoConfig: vi.fn(() => ({ fps: 30, width: 1920, height: 1080 })), + 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 }) => ( +
+ {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 }) => ( +