diff --git a/renderer/README.md b/renderer/README.md index 8d6ba5f..ad3ae36 100644 --- a/renderer/README.md +++ b/renderer/README.md @@ -68,11 +68,18 @@ only draws it. `POST /api/gachabeta` takes the same body and returns the same response as `/api/gacha`, rendering an 8-second beta style instead: a cosmic, astrology -themed night sky in toon shading (flat colour bands, no outlines) seen through -a perspective action camera. The camera dollies toward a hero cloud, a comet -lights its rim from behind and bursts through it, the camera chases the comet -as its flare builds, and after the burst the label appears with a rank -(`S`, `SS`, `SSS` for rarity 3, 4, 5). +themed night sky with toon-shaded clouds and stars, without outlines, seen +through a perspective action camera: + +1. The sky fades in around a main cloud. A comet approaches from behind, + lights the cloud's rim, then punches through it with scattered puffs and an impact ring. +2. The camera follows the flying star as its light and lens flare intensify, + ending in a starburst and white flash. +3. The food label appears inside an astrology ring with rank `SSS`. + +The caller randomly chooses the food and sends it as `label` (for example, +`"Bún bò"`). The beta reveal always shows `SSS`; `rarity` still chooses the +comet's blue, purple, or gold palette. `/api/gacha` keeps its existing ranks. Response is a silent H.264 `video/mp4` (Telegram plays it as an animation) with `X-Gacha-Rarity` and `X-Render-Duration-Ms` headers. Both routes share the diff --git a/renderer/plans/journals/2026-10-01-rewrite-gacha-beta-wish-animation.md b/renderer/plans/journals/2026-10-01-rewrite-gacha-beta-wish-animation.md new file mode 100644 index 0000000..71c32cc --- /dev/null +++ b/renderer/plans/journals/2026-10-01-rewrite-gacha-beta-wish-animation.md @@ -0,0 +1,23 @@ +--- +title: Rewrite gacha beta wish animation +date: 2026-10-01 +summary: "Clarified the comet approach, cloud piercing, and cosmic SSS food reveal." +--- + +# Rewrite gacha beta wish animation + +## Changes + +Updated the existing eight-second beta composition with a fading night sky, a visible comet approach behind the main cloud, radial cloud dispersal and an impact ring, a perspective-spinning Remotion toon star, and an astrology-ring result reveal. The beta rank is always SSS, as requested; rarity still controls the light palette. Kept the existing caller-selected label contract, so the caller supplies its randomly chosen food. Updated the owning README section. + +## Validation + +Focused choreography tests passed. Lint, JavaScript type checking, and all 92 tests passed. Render smoke and API smoke passed, including the real beta MP4 response. Inspected rendered frames of the approach, cloud impact, flight, explosion, and final Vietnamese label with SSS. Reviewed the diff inline against the requested phases and API compatibility; no remaining findings. + +The bare session environment initially could not launch Chromium because libnspr4 and other runtime libraries were absent. Downloaded and unpacked runtime dependencies under /tmp without system installation. Still-frame inspection then revealed missing text because this environment had no installed fonts. Added temporary Noto and DejaVu fonts through FONTCONFIG_FILE and regenerated the smoke fixtures successfully. Docker already installs Noto fonts and Chromium runtime dependencies. + +## Result + +The local sample is fixtures/gachabeta-5-star.mp4 (ignored by Git). No commits or publication performed. Render processes exited cleanly. AgentWiki publish skipped. + +> Historical work record — not durable authority. Prefer docs/specs/ADRs for current decisions. diff --git a/renderer/src/remotion/GachaBetaComposition.jsx b/renderer/src/remotion/GachaBetaComposition.jsx index e6fefed..4ae1ab2 100644 --- a/renderer/src/remotion/GachaBetaComposition.jsx +++ b/renderer/src/remotion/GachaBetaComposition.jsx @@ -1,4 +1,5 @@ import {useMemo} from 'react'; +import {Star} from '@remotion/shapes'; import {AbsoluteFill, Easing, interpolate, useCurrentFrame, useVideoConfig} from 'remotion'; import { gachaBetaTimeline, @@ -18,9 +19,9 @@ const baseFont = const clamp = /** @type {const} */ ({extrapolateLeft: 'clamp', extrapolateRight: 'clamp'}); -/** Toon shading: flat colour bands with hard edges and no outline. */ -const skyBands = - 'linear-gradient(180deg, #0a0c2c 0% 28%, #15185a 28% 52%, #262a80 52% 72%, #3a44a6 72% 88%, #5664c4 88%)'; +/** A luminous night sky behind flat, outline-free cloud shading. */ +const skyBackground = + 'radial-gradient(ellipse at 50% 105%, #7886ce 0%, #353f83 32%, #171b49 65%, #090e29 100%)'; const cloudShade = 'radial-gradient(circle at 38% 32%, #f6f4ff 0% 44%, #cdd1f6 44% 70%, #959cdb 70%)'; const heroShade = 'radial-gradient(circle at 38% 30%, #ffffff 0% 46%, #d8dcfb 46% 72%, #a0a8e4 72%)'; @@ -91,11 +92,26 @@ const withAlpha = (hex, alpha) => { * @param {{size: number, fill: string, shade: string}} props */ const ToonStar = ({size, fill, shade}) => ( - +