Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

chore(shell): drop the Mid-Autumn egg and the Chinese dark mascot

vastsa1a21868fb6ea
diff --git a/apps/desktop/src/assets/home-mascot-dark-zh.gif b/apps/desktop/src/assets/home-mascot-dark-zh.gif
deleted file mode 100644
index e3b180a78..000000000
Binary files a/apps/desktop/src/assets/home-mascot-dark-zh.gif and /dev/null differ
diff --git a/apps/desktop/src/assets/home-mascot-still-dark-zh.png b/apps/desktop/src/assets/home-mascot-still-dark-zh.png
deleted file mode 100644
index 93943b825..000000000
Binary files a/apps/desktop/src/assets/home-mascot-still-dark-zh.png and /dev/null differ
diff --git a/apps/desktop/src/assets/mid-autumn-cake.webp b/apps/desktop/src/assets/mid-autumn-cake.webp
deleted file mode 100644
index 88872f2a5..000000000
Binary files a/apps/desktop/src/assets/mid-autumn-cake.webp and /dev/null differ
diff --git a/apps/desktop/src/assets/mid-autumn-moon.webp b/apps/desktop/src/assets/mid-autumn-moon.webp
deleted file mode 100644
index e0b8399b7..000000000
Binary files a/apps/desktop/src/assets/mid-autumn-moon.webp and /dev/null differ
diff --git a/apps/desktop/src/components/HomeMascotLogo.tsx b/apps/desktop/src/components/HomeMascotLogo.tsx
index 9e2dbee77..c2cec851b 100644
--- a/apps/desktop/src/components/HomeMascotLogo.tsx
+++ b/apps/desktop/src/components/HomeMascotLogo.tsx
@@ -1,8 +1,6 @@
import mascotMotionDarkUrl from "../assets/home-mascot-dark.gif";
-import mascotMotionDarkZhUrl from "../assets/home-mascot-dark-zh.gif";
import mascotMotionLightUrl from "../assets/home-mascot-light.gif";
import mascotStillDarkUrl from "../assets/home-mascot-still-dark.png";
-import mascotStillDarkZhUrl from "../assets/home-mascot-still-dark-zh.png";
import mascotStillLightUrl from "../assets/home-mascot-still-light.png";
export function HomeMascotLogo() {
@@ -20,14 +18,6 @@ export function HomeMascotLogo() {
height={100}
draggable={false}
/>
- <img
- className="home-mascot-motion home-mascot-dark home-mascot-dark-zh"
- src={mascotMotionDarkZhUrl}
- alt=""
- width={100}
- height={100}
- draggable={false}
- />
<img
className="home-mascot-motion home-mascot-light"
src={mascotMotionLightUrl}
@@ -44,14 +34,6 @@ export function HomeMascotLogo() {
height={100}
draggable={false}
/>
- <img
- className="home-mascot-still home-mascot-dark home-mascot-dark-zh"
- src={mascotStillDarkZhUrl}
- alt=""
- width={100}
- height={100}
- draggable={false}
- />
<img
className="home-mascot-still home-mascot-light"
src={mascotStillLightUrl}
diff --git a/apps/desktop/src/features/app/AppShell.tsx b/apps/desktop/src/features/app/AppShell.tsx
index 9b86f7af6..20ec725df 100644
--- a/apps/desktop/src/features/app/AppShell.tsx
+++ b/apps/desktop/src/features/app/AppShell.tsx
@@ -19,7 +19,6 @@ import { WorkPanel } from "../../components/workpanel/WorkPanel";
import { useCopyTex } from "../../hooks/use-copy-tex";
import { api } from "../../lib/api";
import { PortalVisibilityProvider } from "../../lib/portal-visibility";
-import { MidAutumnEggHost } from "../mid-autumn-egg/MidAutumnEggHost";
import { CollapsedTitlebarActions, RoutePending } from "./chrome";
import { useAppShellRuntime } from "./useAppShellRuntime";
@@ -305,7 +304,6 @@ export function AppShell() {
) : null}
<SearchDialog open={searchOpen} onClose={() => setSearchOpen(false)} />
<ToastHost />
- <MidAutumnEggHost ready={ready} showSplash={showSplash} />
<ExtensionPromptHost />
{page === "settings" ? <UpdateBanner /> : null}
</>
diff --git a/apps/desktop/src/features/mid-autumn-egg/MidAutumnEggHost.tsx b/apps/desktop/src/features/mid-autumn-egg/MidAutumnEggHost.tsx
deleted file mode 100644
index aebd28faf..000000000
--- a/apps/desktop/src/features/mid-autumn-egg/MidAutumnEggHost.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { useEffect, type ReactElement } from "react";
-import {
- hasSeenMidAutumnEgg,
- markMidAutumnEggSeen,
-} from "../../lib/mid-autumn-egg-preferences";
-import { useMidAutumnEggStore } from "../../stores/mid-autumn-egg-store";
-import { MidAutumnEggOverlay } from "./MidAutumnEggOverlay";
-
-/**
- * Launch gate for the Mid-Autumn easter egg.
- *
- * The egg must never compete with the existing boot surface: it only opens once
- * the shell is ready AND the startup splash has finished, and only once per
- * profile. The seen flag is written before the overlay opens, so a crash during
- * playback cannot replay it on every later launch. Later launches, remounts and
- * manual replays from Settings never take this branch.
- */
-export function MidAutumnEggHost({
- ready,
- showSplash,
-}: {
- ready: boolean;
- showSplash: boolean;
-}): ReactElement {
- const open = useMidAutumnEggStore((state) => state.open);
- const showMidAutumnEgg = useMidAutumnEggStore((state) => state.show);
- const hideMidAutumnEgg = useMidAutumnEggStore((state) => state.hide);
-
- useEffect(() => {
- if (!ready || showSplash) return;
- if (hasSeenMidAutumnEgg()) return;
- markMidAutumnEggSeen();
- showMidAutumnEgg();
- }, [ready, showSplash, showMidAutumnEgg]);
-
- return <MidAutumnEggOverlay open={open} onClose={hideMidAutumnEgg} />;
-}
diff --git a/apps/desktop/src/features/mid-autumn-egg/MidAutumnEggOverlay.tsx b/apps/desktop/src/features/mid-autumn-egg/MidAutumnEggOverlay.tsx
deleted file mode 100644
index a8277d489..000000000
--- a/apps/desktop/src/features/mid-autumn-egg/MidAutumnEggOverlay.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import { useEffect, useRef, type ReactNode } from "react";
-import { useTranslation } from "react-i18next";
-import { IconClose } from "../../components/icons";
-import { portalOverlay } from "../../components/ui";
-// Renderer-sized copies of the two Mid-Autumn textures (same import style as
-// components/BrandLogo.tsx).
-import moonImageUrl from "../../assets/mid-autumn-moon.webp";
-import cakeImageUrl from "../../assets/mid-autumn-cake.webp";
-import { createMidAutumnEggScene, type MidAutumnEggScene } from "./scene";
-import "./mid-autumn-egg.css";
-
-/**
- * Full-screen Mid-Autumn easter egg.
- *
- * The overlay renders one canvas; the scene owns everything that is drawn
- * inside it, including the decoration layer (veil, caption, sparks) it creates
- * next to the canvas. Closing (button or Escape) destroys the scene, so the
- * animation loop and its timers never outlive the overlay.
- */
-export function MidAutumnEggOverlay({
- open,
- onClose,
-}: {
- open: boolean;
- onClose: () => void;
-}): ReactNode {
- const { t } = useTranslation();
- const dialogRef = useRef<HTMLDivElement | null>(null);
- const canvasRef = useRef<HTMLCanvasElement | null>(null);
- const closeRef = useRef<HTMLButtonElement | null>(null);
-
- useEffect(() => {
- if (!open) return;
- const canvas = canvasRef.current;
- if (!canvas) return;
- const scene: MidAutumnEggScene = createMidAutumnEggScene({
- canvas,
- moonImageUrl,
- cakeImageUrl,
- // A failed texture is not fatal, but it must not vanish without a trace.
- onError: (error) => console.error("Mid-Autumn easter egg scene error", error),
- });
- scene.start();
- return () => scene.destroy();
- }, [open]);
-
- useEffect(() => {
- if (!open) return;
- const previouslyFocused = document.activeElement as HTMLElement | null;
- const previousOverflow = document.body.style.overflow;
- document.body.style.overflow = "hidden";
- closeRef.current?.focus();
-
- const onKeyDown = (event: KeyboardEvent) => {
- if (event.key === "Escape") {
- event.preventDefault();
- onClose();
- return;
- }
- if (event.key !== "Tab") return;
-
- const focusable = dialogRef.current?.querySelectorAll<HTMLElement>(
- 'button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])',
- );
- if (!focusable?.length) return;
- const first = focusable[0];
- const last = focusable[focusable.length - 1];
- if (event.shiftKey && document.activeElement === first) {
- event.preventDefault();
- last.focus();
- } else if (!event.shiftKey && document.activeElement === last) {
- event.preventDefault();
- first.focus();
- }
- };
-
- window.addEventListener("keydown", onKeyDown);
- return () => {
- window.removeEventListener("keydown", onKeyDown);
- document.body.style.overflow = previousOverflow;
- previouslyFocused?.focus();
- };
- }, [open, onClose]);
-
- if (!open) return null;
-
- return portalOverlay(
- <div
- ref={dialogRef}
- className="overlay mid-autumn-egg-overlay"
- role="dialog"
- aria-modal="true"
- aria-label={t("settings.midAutumnEgg")}
- >
- <canvas ref={canvasRef} className="mid-autumn-egg-canvas" />
- <button
- ref={closeRef}
- type="button"
- className="mid-autumn-egg-close"
- onClick={onClose}
- aria-label={t("settings.closeEasterEgg")}
- >
- <IconClose size={16} />
- <span>{t("settings.closeEasterEgg")}</span>
- </button>
- </div>,
- );
-}
diff --git a/apps/desktop/src/features/mid-autumn-egg/mid-autumn-egg.css b/apps/desktop/src/features/mid-autumn-egg/mid-autumn-egg.css
deleted file mode 100644
index ac2d4ea33..000000000
--- a/apps/desktop/src/features/mid-autumn-egg/mid-autumn-egg.css
+++ /dev/null
@@ -1,170 +0,0 @@
-/* Mid-Autumn easter egg overlay.
- *
- * The scene draws everything on a single canvas and owns the decoration layer
- * (`.mid-autumn-egg-decor` with veil, caption and sparks) it appends next to the
- * canvas. Caption and spark copy is Chinese on purpose: it is artwork content,
- * not UI chrome.
- *
- * The overlay itself is opaque, so the application behind it never leaks into
- * the night sky; the first canvas frame paints the same night colour.
- */
-
-.overlay.mid-autumn-egg-overlay {
- /* Full-screen takeover: above every other dialog inside the overlay root. */
- z-index: 100;
- padding: 0;
- overflow: hidden;
- isolation: isolate;
- background: var(--mid-autumn-egg-sky, #02040f);
- font-family:
- Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
- "SF Pro Display", "PingFang SC", sans-serif;
-}
-
-.mid-autumn-egg-canvas {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- display: block;
-}
-
-/* Decoration layer: never steals pointer events from the close button. */
-.mid-autumn-egg-decor {
- position: absolute;
- inset: 0;
- z-index: 1;
- overflow: hidden;
- pointer-events: none;
-}
-
-.mid-autumn-egg-veil {
- position: absolute;
- inset: 0;
- opacity: 0;
- background:
- radial-gradient(520px 300px at 78% 18%, rgba(255, 218, 148, 0.065), transparent 70%),
- linear-gradient(180deg, rgba(4, 6, 10, 0.06), rgba(4, 6, 10, 0.12));
- animation: mid-autumn-egg-veil-in 1100ms ease-out 120ms forwards;
-}
-
-@keyframes mid-autumn-egg-veil-in {
- to {
- opacity: 1;
- }
-}
-
-.mid-autumn-egg-caption {
- position: absolute;
- right: clamp(28px, 6vw, 92px);
- top: clamp(220px, 30vh, 330px);
- opacity: 0;
- transform: translateY(6px);
- text-align: right;
- color: rgba(255, 255, 255, 0.92);
- text-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
-}
-
-.mid-autumn-egg-caption.show {
- animation: mid-autumn-egg-caption-in 900ms cubic-bezier(0.22, 0.8, 0.24, 1) forwards;
-}
-
-.mid-autumn-egg-caption-title {
- font-size: var(--text-lg-plus);
- font-weight: var(--font-weight-semibold);
- letter-spacing: var(--tracking-wide);
-}
-
-.mid-autumn-egg-caption-sub {
- margin-top: 7px;
- font-size: var(--text-sm);
- color: rgba(255, 255, 255, 0.48);
- letter-spacing: var(--tracking-wide);
-}
-
-@keyframes mid-autumn-egg-caption-in {
- to {
- opacity: 0.96;
- transform: translateY(0);
- }
-}
-
-.mid-autumn-egg-spark {
- position: absolute;
- width: 3px;
- height: 3px;
- border-radius: var(--radius-round);
- background: rgba(255, 237, 188, 0.95);
- box-shadow: 0 0 10px rgba(255, 221, 150, 0.55);
- opacity: 0;
-}
-
-.mid-autumn-egg-spark.play {
- animation: mid-autumn-egg-sparkle 1.5s ease-out forwards;
-}
-
-@keyframes mid-autumn-egg-sparkle {
- 0% {
- opacity: 0;
- transform: translate(0, 0) scale(0.3);
- }
- 18% {
- opacity: 0.95;
- }
- 100% {
- opacity: 0;
- transform: translate(var(--mid-autumn-egg-spark-dx), var(--mid-autumn-egg-spark-dy)) scale(1.15);
- }
-}
-
-/* Always-visible close affordance: high contrast, >= 32x32 hit area, focus ring. */
-.mid-autumn-egg-close {
- position: absolute;
- bottom: clamp(60px, 12vh, 120px);
- left: 50%;
- transform: translateX(-50%);
- z-index: 2;
- display: inline-flex;
- align-items: center;
- gap: 6px;
- min-width: 32px;
- min-height: 32px;
- padding: 8px 20px;
- opacity: 0;
- animation: mid-autumn-egg-close-in 600ms ease-out 1.8s forwards;
- border: 1px solid rgba(255, 255, 255, 0.3);
- border-radius: var(--radius-full);
- background: rgba(12, 16, 28, 0.72);
- color: rgba(255, 255, 255, 0.94);
- font: inherit;
- font-size: var(--text-sm-plus);
- letter-spacing: var(--tracking-wide);
- cursor: pointer;
- backdrop-filter: blur(16px);
- transition:
- background 0.2s ease,
- border-color 0.2s ease,
- color 0.2s ease;
-}
-
-.mid-autumn-egg-close:hover {
- background: rgba(32, 40, 62, 0.92);
- border-color: rgba(255, 255, 255, 0.5);
- color: #fff;
-}
-
-.mid-autumn-egg-close:focus-visible {
- outline: 2px solid var(--ds-focus);
- outline-offset: 2px;
-}
-
-@keyframes mid-autumn-egg-close-in {
- from {
- opacity: 0;
- transform: translateX(-50%) translateY(8px);
- }
- to {
- opacity: 1;
- transform: translateX(-50%) translateY(0);
- }
-}
diff --git a/apps/desktop/src/features/mid-autumn-egg/poem-schedule.ts b/apps/desktop/src/features/mid-autumn-egg/poem-schedule.ts
deleted file mode 100644
index 42d671bf2..000000000
--- a/apps/desktop/src/features/mid-autumn-egg/poem-schedule.ts
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * Vertical poem layer: the pair data, the seeded schedule and the per-item
- * geometry.
- *
- * Several pairs float on screen at once. Each "lane" picks its own random gap,
- * random lifetime and random pair, so appearance time, position and font size
- * are all irregular. The schedule is precomputed once and then loops.
- */
-import {
- DEFAULT_MID_AUTUMN_EGG_CONFIG,
- POEM_CHAR_STAGGER,
- POEM_COLUMN_STAGGER,
- POEM_CYCLE_TAIL_SECONDS,
- POEM_DRIFT_MIN,
- POEM_DRIFT_RANGE,
- POEM_EDGE_PADDING,
- POEM_FONT_MAX,
- POEM_FONT_MIN,
- POEM_FONT_RATIO,
- POEM_FONT_SCALE_MIN,
- POEM_FONT_SCALE_RANGE,
- POEM_GAP_BASE_SECONDS,
- POEM_GAP_RANDOM_SECONDS,
- POEM_HALF_HEIGHT_PAD_RATIO,
- POEM_HALF_WIDTH_RATIO,
- POEM_HORIZON_SECONDS,
- POEM_LIFE_BASE_SECONDS,
- POEM_LIFE_RANDOM_SECONDS,
- POEM_LINE_HEIGHT_RATIO,
- POEM_PHASE_RANGE,
- POEM_SCHEDULE_GUARD,
- POEM_SEED,
- POEM_SWAY_MIN,
- POEM_SWAY_RANGE,
- POEM_SWAY_SPEED_MIN,
- POEM_SWAY_SPEED_RANGE,
- POEM_VERTICAL_MARGIN,
- POEM_WOBBLE_MIN,
- POEM_WOBBLE_RANGE,
- clamp,
-} from "./timeline";
-
-export type PoemPair = readonly [string, string];
-
-/** One scheduled appearance of a pair, with all of its layout parameters. */
-export type PoemScheduleItem = {
- /** Seconds, relative to the start of the poem cycle. */
- start: number;
- /** Seconds, relative to the start of the poem cycle. */
- end: number;
- /** Index into `PoemSchedule.columns`. */
- pair: number;
- fontSize: number;
- lineHeight: number;
- centerX: number;
- centerY: number;
- /** Vertical drift over the whole lifetime (negative = floats upwards). */
- drift: number;
- swayAmplitude: number;
- swaySpeed: number;
- wobble: number;
- phase: number;
-};
-
-/** Precomputed poem layer: the glyph columns plus the appearance schedule. */
-export type PoemSchedule = {
- /** `columns[pair][column]` is a list of code points; column 0 is the right (leading) line. */
- columns: string[][][];
- items: PoemScheduleItem[];
- /** Length of the precomputed table; the animation loops it. */
- cycle: number;
-};
-
-/**
- * Deterministic linear congruential generator, so the layout of the poem layer
- * is reproducible for a given viewport instead of being resampled every frame.
- */
-export function createSeededRandom(seed: number): () => number {
- let state = seed >>> 0;
- return () => {
- state = (state * 1664525 + 1013904223) >>> 0;
- return state / 4294967296;
- };
-}
-
-export function createPoemSchedule(options: {
- width: number;
- height: number;
- /** How many pairs may be on screen at the same time (at least 1). */
- maxPairs: number;
- pairs?: readonly PoemPair[];
-}): PoemSchedule {
- const { width, height, maxPairs } = options;
- const pairs = options.pairs ?? DEFAULT_MID_AUTUMN_EGG_CONFIG.poemPairs;
- const baseFontSize = clamp(
- Math.min(width, height) * POEM_FONT_RATIO,
- POEM_FONT_MIN,
- POEM_FONT_MAX,
- );
- const random = createSeededRandom(POEM_SEED);
- const laneCount = Math.max(1, Math.trunc(maxPairs));
-
- const columns = pairs.map(([leading, answering]) => [
- Array.from(leading),
- Array.from(answering),
- ]);
- const longestLines = pairs.map(([leading, answering]) =>
- Math.max(Array.from(leading).length, Array.from(answering).length),
- );
-
- const items: PoemScheduleItem[] = [];
- const laneEnds: number[] = [];
- const laneLastPairs: number[] = [];
- for (let lane = 0; lane < laneCount; lane++) {
- laneEnds.push(0);
- laneLastPairs.push(-1);
- }
-
- let guard = 0;
- while (guard++ < POEM_SCHEDULE_GUARD) {
- // Always extend the lane that finished first, so the lanes interleave.
- let slot = 0;
- for (let lane = 1; lane < laneCount; lane++) {
- if (laneEnds[lane] < laneEnds[slot]) slot = lane;
- }
-
- const start =
- laneEnds[slot] + POEM_GAP_BASE_SECONDS + random() * POEM_GAP_RANDOM_SECONDS;
- if (start > POEM_HORIZON_SECONDS) break;
- const life = POEM_LIFE_BASE_SECONDS + random() * POEM_LIFE_RANDOM_SECONDS;
-
- // The famous pair opens the animation; afterwards a lane never repeats its
- // own previous pair back to back.
- let pair = items.length === 0 ? pairs.length - 1 : Math.floor(random() * pairs.length);
- if (pair === laneLastPairs[slot]) pair = (pair + 1) % pairs.length;
- laneLastPairs[slot] = pair;
- laneEnds[slot] = start + life;
-
- const fontSize = baseFontSize * (POEM_FONT_SCALE_MIN + random() * POEM_FONT_SCALE_RANGE);
- const lineHeight = fontSize * POEM_LINE_HEIGHT_RATIO;
- const halfHeight =
- ((longestLines[pair] - 1) / 2) * lineHeight +
- fontSize * POEM_HALF_HEIGHT_PAD_RATIO;
- const halfWidth = fontSize * POEM_HALF_WIDTH_RATIO;
- const minY = halfHeight + POEM_VERTICAL_MARGIN;
- const maxY = height - halfHeight - POEM_VERTICAL_MARGIN;
- const minX = halfWidth + POEM_EDGE_PADDING;
- const maxX = width - halfWidth - POEM_EDGE_PADDING;
-
- items.push({
- start,
- end: start + life,
- pair,
- fontSize,
- lineHeight,
- // No fixed anchor: the pair may appear anywhere the text still fits.
- centerX: minX + random() * Math.max(1, maxX - minX),
- centerY: minY + random() * Math.max(1, maxY - minY),
- drift: -(POEM_DRIFT_MIN + random() * POEM_DRIFT_RANGE),
- swayAmplitude: POEM_SWAY_MIN + random() * POEM_SWAY_RANGE,
- swaySpeed: POEM_SWAY_SPEED_MIN + random() * POEM_SWAY_SPEED_RANGE,
- wobble: POEM_WOBBLE_MIN + random() * POEM_WOBBLE_RANGE,
- phase: random() * POEM_PHASE_RANGE,
- });
- }
- items.sort((left, right) => left.start - right.start);
-
- return {
- columns,
- items,
- cycle: items.length
- ? items[items.length - 1].end + POEM_CYCLE_TAIL_SECONDS
- : 1,
- };
-}
-
-/** Per-glyph phase offset used when drawing a pair. */
-export function glyphPhase(item: PoemScheduleItem, column: number, index: number): number {
- return item.phase + column * POEM_COLUMN_STAGGER + index * POEM_CHAR_STAGGER;
-}
diff --git a/apps/desktop/src/features/mid-autumn-egg/scene.ts b/apps/desktop/src/features/mid-autumn-egg/scene.ts
deleted file mode 100644
index 56b7ac0e0..000000000
--- a/apps/desktop/src/features/mid-autumn-egg/scene.ts
+++ /dev/null
@@ -1,990 +0,0 @@
-/**
- * Mid-Autumn easter egg engine.
- *
- * Owns the canvas, the timeline loop, the resize re-layout, the sparkle bursts
- * and the caption. The sky, stars, horizon glow, rising moon, mooncake rain and
- * column piling, the pixel-sampled text assembly and the vertical poem layer are
- * a faithful port of the verified standalone animation.
- *
- * The scene also creates and owns the small DOM decoration layer (veil, caption,
- * sparks) inside the canvas' parent, and tears it down in `destroy()`.
- */
-import {
- CAKE_COLUMN_WIDTH_RATIO,
- CAKE_FILL,
- CAKE_RADIUS_MAX,
- CAKE_RADIUS_MIN,
- CAKE_RADIUS_RATIO,
- CAKE_SPAWN_ABOVE_RANGE,
- CAKE_SPAWN_PAD_RATIO,
- CAKE_SPAWN_VX,
- CAKE_SPAWN_VY_MIN,
- CAKE_SPAWN_VY_RANGE,
- CAKE_SPIN_RANGE,
- CAKE_SPRITE_LIFT_RATIO,
- CAKE_SPRITE_PADDING_RATIO,
- CAKE_SPRITE_SUPERSAMPLE,
- CAPTION_SUBTITLE,
- CAPTION_TITLE,
- DEFAULT_MID_AUTUMN_EGG_CONFIG,
- GROUND_INSET_MIN,
- GROUND_INSET_RATIO,
- MAX_FAST_FORWARD_STEPS,
- MAX_FRAME_STEP_SECONDS,
- MOON_BREATH_AMPLITUDE,
- MOON_BREATH_SPEED,
- MOON_FILL,
- MOON_GLOW_INNER_RATIO,
- MOON_GLOW_OUTER_RATIO,
- MOON_PATH_END_MIN_RATIO,
- MOON_PATH_START_OFFSET,
- MOON_RADIUS_MAX,
- MOON_RADIUS_MIN,
- MOON_RADIUS_RATIO,
- MOON_SPARK_COUNT,
- MOON_TRAIL_MAX,
- ORIENTATION_DEBOUNCE_MS,
- POEM_ALPHA_BASE,
- POEM_ALPHA_RANGE,
- POEM_BREATHE_SPEED,
- POEM_CHAR_WOBBLE_AMPLITUDE,
- POEM_CHAR_WOBBLE_SPEED,
- POEM_COLUMN_GAP_RATIO,
- POEM_FADE_IN_FRACTION,
- POEM_FADE_OUT_FRACTION,
- POEM_GLOW_ALPHA_SCALE,
- POEM_GLOW_BLUR,
- POEM_MIN_ENVELOPE,
- RAIN_SPAWN_GUARD,
- RESIZE_DEBOUNCE_MS,
- SERIF_FONT_STACK,
- TEXT_FONT_STACK,
- SIMULATION_STEP_SECONDS,
- SPARK_DELAY_RANGE_MS,
- SPARK_DISTANCE_MIN,
- SPARK_DISTANCE_RANGE,
- SPARK_LIFETIME_MS,
- STAR_ALPHA_MIN,
- STAR_ALPHA_RANGE,
- STAR_BAND_RATIO,
- STAR_COUNT_MAX,
- STAR_COUNT_MIN,
- STAR_DENSITY,
- STAR_RADIUS_MIN,
- STAR_RADIUS_RANGE,
- STAR_SPEED_MIN,
- STAR_SPEED_RANGE,
- STATIC_FRAME_TAIL_SECONDS,
- TEXT_ARC_LIFT,
- TEXT_ARC_LIFT_RANDOM,
- TEXT_CONTROL_SPREAD,
- TEXT_DELAY_RANDOM,
- TEXT_RECT_ASPECT,
- TEXT_RECT_CENTER_Y_RATIO,
- TEXT_RECT_MAX_HEIGHT_RATIO,
- TEXT_RECT_MAX_WIDTH,
- TEXT_RECT_WIDTH_RATIO,
- TEXT_SPARK_COUNT,
- TEXT_STACK_JITTER_RATIO,
- TRAIL_GLOW_INNER_BASE,
- TRAIL_GLOW_INNER_LIFE,
- TRAIL_LIFETIME,
- TRAIL_RADIUS_BASE,
- TRAIL_RADIUS_LIFE,
- clamp,
- createMidAutumnEggPhases,
- cubicPoint,
- easeInOutCubic,
- easeInOutQuad,
- rand,
- type MidAutumnEggConfig,
- type MidAutumnEggPhases,
- type Vec2,
-} from "./timeline";
-import { glyphPhase, createPoemSchedule, type PoemSchedule } from "./poem-schedule";
-import { sampleTextPoints, type TextSamplePoint } from "./text-sampling";
-
-export type MidAutumnEggSceneOptions = {
- canvas: HTMLCanvasElement;
- moonImageUrl: string;
- cakeImageUrl: string;
- /** When set, freeze the timeline at this many seconds and render one frame instead of animating (used by QA screenshots). */
- seekSeconds?: number;
- /** Called for a non-fatal failure (e.g. an asset failed to decode) instead of silently swallowing it. */
- onError?: (error: unknown) => void;
-};
-
-export type MidAutumnEggScene = { start(): void; destroy(): void };
-
-type CakeLifecycle = "falling" | "landed" | "placed";
-
-type Cake = {
- x: number;
- y: number;
- vx: number;
- vy: number;
- rot: number;
- rot0: number;
- spin: number;
- state: CakeLifecycle;
- targetX: number;
- targetY: number;
- originX: number;
- originY: number;
- controlX: number;
- controlY: number;
- delay: number;
- bornAt: number;
-};
-
-type Star = {
- x: number;
- y: number;
- r: number;
- alpha: number;
- phase: number;
- speed: number;
-};
-
-type TrailSample = { x: number; y: number; bornAt: number };
-
-type SparkHandle = { element: HTMLElement; timer: number };
-
-type MoonPath = { start: Vec2; control1: Vec2; control2: Vec2; end: Vec2 };
-
-type TextRect = { x: number; y: number; w: number; h: number };
-
-export function createMidAutumnEggScene(
- options: MidAutumnEggSceneOptions,
-): MidAutumnEggScene {
- const canvas = options.canvas;
- const maybeContext = canvas.getContext("2d");
- if (!maybeContext) {
- options.onError?.(new Error("Mid-Autumn easter egg: no 2D canvas context"));
- return { start: () => {}, destroy: () => {} };
- }
- const context: CanvasRenderingContext2D = maybeContext;
-
- const config: MidAutumnEggConfig = DEFAULT_MID_AUTUMN_EGG_CONFIG;
- const phases: MidAutumnEggPhases = createMidAutumnEggPhases(config);
- const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
- const seekSeconds =
- typeof options.seekSeconds === "number" && Number.isFinite(options.seekSeconds)
- ? Math.max(0, options.seekSeconds)
- : null;
-
- /* ---- decoration layer owned by the scene (veil, caption, sparks) ---- */
- const container = canvas.parentElement ?? canvas.ownerDocument.body;
- const decor = document.createElement("div");
- decor.className = "mid-autumn-egg-decor";
- decor.setAttribute("aria-hidden", "true");
- const veil = document.createElement("div");
- veil.className = "mid-autumn-egg-veil";
- const caption = document.createElement("div");
- caption.className = "mid-autumn-egg-caption";
- const captionTitle = document.createElement("div");
- captionTitle.className = "mid-autumn-egg-caption-title";
- captionTitle.textContent = CAPTION_TITLE;
- const captionSubtitle = document.createElement("div");
- captionSubtitle.className = "mid-autumn-egg-caption-sub";
- captionSubtitle.textContent = CAPTION_SUBTITLE;
- caption.append(captionTitle, captionSubtitle);
- decor.append(veil, caption);
- container.appendChild(decor);
-
- /* ---- layout state, rebuilt by setup() ---- */
- let width = 0;
- let height = 0;
- let dpr = 1;
- let cakeRadius = 9;
- let groundY = 0;
- let columnWidth = 16;
- let columnCount = 0;
- let columnHeights = new Float32Array(0);
- let moonRadius = 60;
- let moonPath: MoonPath = createMoonPath(0, 0, 0);
-
- /* ---- scene state ---- */
- let stars: Star[] = [];
- let cakes: Cake[] = [];
- let trail: TrailSample[] = [];
- let poem: PoemSchedule | null = null;
- let moonImage: HTMLImageElement | null = null;
- let cakeImage: HTMLImageElement | null = null;
- let cakeSprite: HTMLCanvasElement | null = null;
- let cakeSpriteScale = 1;
- let textRect: TextRect | null = null;
- let sparks: SparkHandle[] = [];
-
- let elapsed = 0;
- let startTime = 0;
- let lastFrameTime = 0;
- let spawnAccumulator = 0;
- let skyProgress = 0;
- let textTargetsBuilt = false;
- let poemBuilt = false;
- let moonSparkDone = false;
- let textSparkDone = false;
-
- let frameId: number | null = null;
- let sparkFrames: number[] = [];
- let resizeTimer: number | null = null;
- let started = false;
- let destroyed = false;
-
- /* ------------------------------------------------------------------ *
- * Layout
- * ------------------------------------------------------------------ */
-
- function createMoonPath(viewWidth: number, viewHeight: number, radius: number): MoonPath {
- return {
- start: {
- x: -radius * MOON_PATH_START_OFFSET,
- y: viewHeight + radius * MOON_PATH_START_OFFSET,
- },
- control1: { x: viewWidth * 0.05, y: viewHeight * 0.7 },
- control2: { x: viewWidth * 0.33, y: viewHeight * 0.04 },
- end: {
- x: viewWidth * 0.78,
- y: Math.max(radius * MOON_PATH_END_MIN_RATIO, viewHeight * 0.16),
- },
- };
- }
-
- function setup(): void {
- dpr = Math.min(window.devicePixelRatio || 1, 2);
- width = window.innerWidth;
- height = window.innerHeight;
-
- canvas.width = Math.round(width * dpr);
- canvas.height = Math.round(height * dpr);
- canvas.style.width = `${width}px`;
- canvas.style.height = `${height}px`;
- context.setTransform(dpr, 0, 0, dpr, 0, 0);
-
- cakeRadius = clamp(
- Math.min(width, height) * CAKE_RADIUS_RATIO,
- CAKE_RADIUS_MIN,
- CAKE_RADIUS_MAX,
- );
- groundY = height - Math.max(GROUND_INSET_MIN, height * GROUND_INSET_RATIO);
- columnWidth = cakeRadius * CAKE_COLUMN_WIDTH_RATIO;
- columnCount = Math.ceil(width / columnWidth) + 2;
- columnHeights = new Float32Array(columnCount);
-
- moonRadius = clamp(
- Math.min(width, height) * MOON_RADIUS_RATIO,
- MOON_RADIUS_MIN,
- MOON_RADIUS_MAX,
- );
- moonPath = createMoonPath(width, height, moonRadius);
-
- buildStars();
- if (cakeImage) buildCakeSprite();
- reset();
- }
-
- function reset(): void {
- cakes = [];
- trail = [];
- poem = null;
- columnHeights.fill(0);
- spawnAccumulator = 0;
- elapsed = 0;
- startTime = 0;
- lastFrameTime = 0;
- skyProgress = 0;
- textTargetsBuilt = false;
- poemBuilt = false;
- moonSparkDone = false;
- textSparkDone = false;
- textRect = null;
- caption.classList.remove("show");
- clearSparks();
- }
-
- function columnIndexOf(x: number): number {
- return clamp(Math.floor(x / columnWidth), 0, columnCount - 1);
- }
-
- /* ------------------------------------------------------------------ *
- * Stars and horizon glow
- * ------------------------------------------------------------------ */
-
- function buildStars(): void {
- stars = [];
- const count = clamp(Math.round((width * height) / STAR_DENSITY), STAR_COUNT_MIN, STAR_COUNT_MAX);
- for (let index = 0; index < count; index++) {
- stars.push({
- x: Math.random() * width,
- y: Math.random() * height * STAR_BAND_RATIO,
- r: Math.random() * STAR_RADIUS_RANGE + STAR_RADIUS_MIN,
- alpha: STAR_ALPHA_MIN + Math.random() * STAR_ALPHA_RANGE,
- phase: Math.random() * Math.PI * 2,
- speed: STAR_SPEED_MIN + Math.random() * STAR_SPEED_RANGE,
- });
- }
- }
-
- function drawStars(skyAlpha: number): void {
- if (skyAlpha <= 0) return;
- for (const star of stars) {
- const twinkle = 0.5 + 0.5 * Math.sin(elapsed * star.speed + star.phase);
- context.globalAlpha = star.alpha * (0.3 + 0.7 * twinkle) * skyAlpha;
- context.fillStyle = "#dbe7ff";
- context.beginPath();
- context.arc(star.x, star.y, star.r, 0, Math.PI * 2);
- context.fill();
- }
- context.globalAlpha = 1;
- }
-
- function drawHorizon(skyAlpha: number): void {
- if (skyAlpha <= 0) return;
- context.globalAlpha = skyAlpha;
-
- const glow = context.createLinearGradient(0, height * 0.68, 0, height);
- glow.addColorStop(0, "rgba(255,190,110,0)");
- glow.addColorStop(0.6, "rgba(255,172,92,0.055)");
- glow.addColorStop(1, "rgba(255,152,70,0.14)");
- context.fillStyle = glow;
- context.fillRect(0, height * 0.68, width, height * 0.32);
-
- const pool = context.createRadialGradient(
- width * 0.5,
- height * 1.06,
- 0,
- width * 0.5,
- height * 1.06,
- width * 0.72,
- );
- pool.addColorStop(0, "rgba(255,186,104,0.11)");
- pool.addColorStop(0.5, "rgba(255,170,90,0.04)");
- pool.addColorStop(1, "rgba(255,170,90,0)");
- context.fillStyle = pool;
- context.fillRect(0, height * 0.55, width, height * 0.45);
-
- context.globalAlpha = 1;
- }
-
- /* ------------------------------------------------------------------ *
- * Mooncake sprite: the asset is scaled once into an offscreen canvas,
- * because 500+ cakes per frame would be too slow to scale every time.
- * ------------------------------------------------------------------ */
-
- function buildCakeSprite(): void {
- if (!cakeImage) return;
- const supersample = CAKE_SPRITE_SUPERSAMPLE;
- const body = (cakeRadius * 2) / CAKE_FILL * supersample;
- const size = Math.ceil(body * CAKE_SPRITE_PADDING_RATIO);
-
- const sprite = document.createElement("canvas");
- sprite.width = size;
- sprite.height = size;
- const spriteContext = sprite.getContext("2d");
- if (!spriteContext) {
- options.onError?.(new Error("Mid-Autumn easter egg: cake sprite context unavailable"));
- return;
- }
- spriteContext.imageSmoothingEnabled = true;
- spriteContext.imageSmoothingQuality = "high";
-
- const glow = spriteContext.createRadialGradient(
- size / 2,
- size / 2,
- body * 0.42,
- size / 2,
- size / 2,
- size * 0.5,
- );
- glow.addColorStop(0, "rgba(255,204,116,0.32)");
- glow.addColorStop(0.5, "rgba(255,178,88,0.10)");
- glow.addColorStop(1, "rgba(255,168,76,0)");
- spriteContext.fillStyle = glow;
- spriteContext.fillRect(0, 0, size, size);
-
- // The body sits slightly high to cancel the baked-in drop shadow.
- spriteContext.drawImage(
- cakeImage,
- (size - body) / 2,
- (size - body) / 2 - body * CAKE_SPRITE_LIFT_RATIO,
- body,
- body,
- );
-
- cakeSprite = sprite;
- cakeSpriteScale = 1 / supersample;
- }
-
- /* ------------------------------------------------------------------ *
- * Moon
- * ------------------------------------------------------------------ */
-
- function moonPosition(): Vec2 {
- const progress = clamp(elapsed / phases.rise, 0, 1);
- return cubicPoint(
- moonPath.start,
- moonPath.control1,
- moonPath.control2,
- moonPath.end,
- easeInOutQuad(progress),
- );
- }
-
- function drawMoon(): void {
- if (!moonImage) return;
- const position = moonPosition();
- // Breathing once the moon has arrived.
- const radius =
- moonRadius * (1 + Math.sin(elapsed * MOON_BREATH_SPEED) * MOON_BREATH_AMPLITUDE);
-
- const glow = context.createRadialGradient(
- position.x,
- position.y,
- radius * MOON_GLOW_INNER_RATIO,
- position.x,
- position.y,
- radius * MOON_GLOW_OUTER_RATIO,
- );
- glow.addColorStop(0, "rgba(255,238,175,0.28)");
- glow.addColorStop(0.32, "rgba(255,220,140,0.10)");
- glow.addColorStop(0.66, "rgba(255,205,120,0.03)");
- glow.addColorStop(1, "rgba(255,200,110,0)");
- context.fillStyle = glow;
- context.beginPath();
- context.arc(position.x, position.y, radius * MOON_GLOW_OUTER_RATIO, 0, Math.PI * 2);
- context.fill();
-
- const diameter = (radius * 2) / MOON_FILL;
- context.drawImage(
- moonImage,
- position.x - diameter / 2,
- position.y - diameter / 2,
- diameter,
- diameter,
- );
- }
-
- function drawTrail(): void {
- if (!trail.length) return;
- for (let index = trail.length - 1; index >= 0; index--) {
- const sample = trail[index];
- const age = elapsed - sample.bornAt;
- if (age > TRAIL_LIFETIME || age < 0) {
- trail.splice(index, 1);
- continue;
- }
- const life = 1 - age / TRAIL_LIFETIME;
- const glow = context.createRadialGradient(
- sample.x,
- sample.y,
- 0,
- sample.x,
- sample.y,
- TRAIL_GLOW_INNER_BASE + life * TRAIL_GLOW_INNER_LIFE,
- );
- glow.addColorStop(0, `rgba(255,238,192,${(0.15 * life).toFixed(4)})`);
- glow.addColorStop(0.28, `rgba(255,211,133,${(0.09 * life).toFixed(4)})`);
- glow.addColorStop(1, "rgba(255,190,92,0)");
- context.fillStyle = glow;
- context.beginPath();
- context.arc(sample.x, sample.y, TRAIL_RADIUS_BASE + life * TRAIL_RADIUS_LIFE, 0, Math.PI * 2);
- context.fill();
- }
- }
-
- /* ------------------------------------------------------------------ *
- * Mooncake rain
- * ------------------------------------------------------------------ */
-
- /** Pre-computed text target points, filled once by precomputeTextTargets(). */
- let textPoints: TextSamplePoint[] = [];
- let textRectX = 0;
- let textRectY = 0;
-
- function precomputeTextTargets(): void {
- const count = config.cakes;
- let rectWidth = Math.min(width * TEXT_RECT_WIDTH_RATIO, TEXT_RECT_MAX_WIDTH);
- let rectHeight = rectWidth / TEXT_RECT_ASPECT;
- const maxRectHeight = height * TEXT_RECT_MAX_HEIGHT_RATIO;
- if (rectHeight > maxRectHeight) {
- rectHeight = maxRectHeight;
- rectWidth = rectHeight * TEXT_RECT_ASPECT;
- }
- textRectX = (width - rectWidth) / 2;
- textRectY = height * TEXT_RECT_CENTER_Y_RATIO - rectHeight * 0.5;
- textRect = { x: textRectX, y: textRectY, w: rectWidth, h: rectHeight };
-
- const raw = sampleTextPoints(config.text, count, rectWidth, rectHeight);
- if (!raw.length) return;
- raw.sort((left, right) => left.x - right.x);
-
- if (raw.length > count) {
- const last = raw.length - 1;
- for (let i = 0; i < count; i++) {
- textPoints.push(raw[Math.round((i * last) / Math.max(1, count - 1))]);
- }
- } else {
- textPoints = raw.slice();
- }
- }
-
- function spawnCake(): void {
- const pad = cakeRadius * CAKE_SPAWN_PAD_RATIO;
- const spawnX = pad + Math.random() * Math.max(1, width - pad * 2);
- const spawnY = -cakeRadius * 2 - Math.random() * CAKE_SPAWN_ABOVE_RANGE;
- const idx = cakes.length;
- const total = Math.max(1, textPoints.length);
- const point = textPoints[idx % total];
- const stacked = idx >= total;
- const jitter = cakeRadius * TEXT_STACK_JITTER_RATIO;
- const tx = textRectX + (point ? point.x : 0) + (stacked ? rand(-jitter, jitter) : 0);
- const ty = textRectY + (point ? point.y : 0) + (stacked ? rand(-jitter, jitter) : 0);
-
- cakes.push({
- x: spawnX,
- y: spawnY,
- vx: 0,
- vy: 0,
- rot: Math.random() * Math.PI * 2,
- rot0: Math.random() * Math.PI * 2,
- spin: 0,
- state: "falling",
- targetX: tx,
- targetY: ty,
- originX: spawnX,
- originY: spawnY,
- controlX: (spawnX + tx) * 0.5 + rand(-TEXT_CONTROL_SPREAD, TEXT_CONTROL_SPREAD),
- controlY: Math.min(spawnY, ty) - TEXT_ARC_LIFT - Math.random() * TEXT_ARC_LIFT_RANDOM,
- delay: 0,
- bornAt: elapsed,
- });
- }
-
-
-
- /* ------------------------------------------------------------------ *
- * Poem layer
- * ------------------------------------------------------------------ */
-
- function drawPoem(): void {
- if (!poem || !poem.items.length) return;
-
- const local = elapsed - phases.poemStart;
- if (local <= 0) return;
-
- const time = local % poem.cycle;
- const intro = clamp(local / phases.poemFade, 0, 1);
-
- context.save();
- context.textAlign = "center";
- context.textBaseline = "middle";
-
- for (const item of poem.items) {
- if (time < item.start || time >= item.end) continue;
-
- const progress = (time - item.start) / (item.end - item.start);
- const envelope =
- intro *
- easeInOutQuad(clamp(progress / POEM_FADE_IN_FRACTION, 0, 1)) *
- easeInOutQuad(clamp((1 - progress) / POEM_FADE_OUT_FRACTION, 0, 1));
- if (envelope <= POEM_MIN_ENVELOPE) continue;
-
- const lines = poem.columns[item.pair];
- const rise = progress * item.drift;
- const sway = Math.sin(elapsed * item.swaySpeed + item.phase) * item.swayAmplitude;
-
- context.font = `500 ${item.fontSize.toFixed(1)}px ${SERIF_FONT_STACK}`;
-
- for (let column = 0; column < 2; column++) {
- const glyphs = lines[column];
- // Right column carries the leading line, left column the answer.
- const columnX =
- item.centerX +
- (column === 0 ? item.fontSize * POEM_COLUMN_GAP_RATIO : -item.fontSize * POEM_COLUMN_GAP_RATIO) +
- sway;
- for (let index = 0; index < glyphs.length; index++) {
- const phase = glyphPhase(item, column, index);
- const y =
- item.centerY +
- (index - (glyphs.length - 1) / 2) * item.lineHeight +
- rise +
- Math.sin(elapsed * POEM_CHAR_WOBBLE_SPEED * item.wobble + phase) *
- POEM_CHAR_WOBBLE_AMPLITUDE;
- const breathe = 0.5 + 0.5 * Math.sin(elapsed * POEM_BREATHE_SPEED + phase * 0.8);
- const alpha = envelope * (POEM_ALPHA_BASE + POEM_ALPHA_RANGE * breathe);
-
- context.shadowColor = `rgba(255,226,160,${(alpha * POEM_GLOW_ALPHA_SCALE).toFixed(4)})`;
- context.shadowBlur = POEM_GLOW_BLUR;
- context.fillStyle = `rgba(255,238,196,${alpha.toFixed(4)})`;
- context.fillText(glyphs[index], columnX, y);
- }
- }
- }
- context.restore();
- }
-
- /* ------------------------------------------------------------------ *
- * Update
- * ------------------------------------------------------------------ */
-
- function update(dt: number): void {
- /* Phase 1: the moon */
- if (elapsed <= phases.rise) {
- const position = moonPosition();
- trail.push({ x: position.x, y: position.y, bornAt: elapsed });
- if (trail.length > MOON_TRAIL_MAX) trail.shift();
- } else if (!moonSparkDone) {
- moonSparkDone = true;
- burst(moonPath.end.x, moonPath.end.y, MOON_SPARK_COUNT);
- }
-
- /* Phase 2+3: spawn mooncakes and fly them directly to text targets */
- if (elapsed >= phases.rainStart && !textTargetsBuilt) {
- // Pre-compute text targets so each cake gets one on spawn.
- precomputeTextTargets();
- textTargetsBuilt = true;
- }
-
- if (elapsed >= phases.rainStart && elapsed < phases.rainStart + phases.spawnDuration) {
- spawnAccumulator += dt * phases.rainRate;
- let guard = 0;
- while (spawnAccumulator >= 1 && guard++ < RAIN_SPAWN_GUARD) {
- spawnAccumulator -= 1;
- spawnCake();
- }
- }
-
- // Fly every spawned cake toward its target immediately.
- for (const cake of cakes) {
- if (cake.state === "placed") continue;
-
- const local = elapsed - cake.bornAt;
- if (local <= 0) continue;
-
- const progress = Math.min(1, local / phases.flyDuration);
- const eased = easeInOutCubic(progress);
- const inverse = 1 - eased;
-
- cake.x = inverse * inverse * cake.originX + 2 * inverse * eased * cake.controlX + eased * eased * cake.targetX;
- cake.y = inverse * inverse * cake.originY + 2 * inverse * eased * cake.controlY + eased * eased * cake.targetY;
- cake.rot = cake.rot0 * (1 - eased);
-
- if (progress >= 1) {
- cake.state = "placed";
- cake.x = cake.targetX;
- cake.y = cake.targetY;
- cake.rot = 0;
- }
- }
-
- if (!textSparkDone && elapsed >= phases.rainStart + phases.spawnDuration + phases.flyDuration + 0.1) {
- textSparkDone = true;
- if (textRect) burst(textRect.x + textRect.w / 2, textRect.y + textRect.h / 2, TEXT_SPARK_COUNT);
- showCaption();
- }
-
- /* Phase 4: the background poem layer */
- if (elapsed >= phases.poemStart && !poemBuilt) {
- poem = createPoemSchedule({
- width,
- height,
- maxPairs: config.poemMax,
- pairs: config.poemPairs,
- });
- poemBuilt = true;
- }
- }
-
- /* ------------------------------------------------------------------ *
- * Render
- * ------------------------------------------------------------------ */
-
- function drawCakes(): void {
- if (!cakeSprite) return;
- const spriteWidth = cakeSprite.width * cakeSpriteScale;
- const spriteHeight = cakeSprite.height * cakeSpriteScale;
-
- for (const cake of cakes) {
- if (cake.y < -60) continue;
- context.save();
- context.translate(cake.x, cake.y);
- if (cake.rot) context.rotate(cake.rot);
- context.drawImage(cakeSprite, -spriteWidth / 2, -spriteHeight / 2, spriteWidth, spriteHeight);
- context.restore();
- }
- }
-
- function render(): void {
- context.clearRect(0, 0, width, height);
-
- // Opaque dark base prevents alpha-compositing seams between gradient stops.
- context.fillStyle = "#02040f";
- context.fillRect(0, 0, width, height);
- if (skyProgress > 0) {
- context.globalAlpha = skyProgress;
- const sky = context.createLinearGradient(0, 0, 0, height);
- sky.addColorStop(0.0, "#02040f");
- sky.addColorStop(0.35, "#061024");
- sky.addColorStop(0.7, "#0a1730");
- sky.addColorStop(1.0, "#10203d");
- context.fillStyle = sky;
- context.fillRect(0, 0, width, height);
- context.globalAlpha = 1;
- }
-
- const skyAlpha = skyProgress;
-
- drawStars(skyAlpha);
- drawHorizon(skyAlpha);
-
- // The poem layer stays at the very back so it never fights the text.
- if (poemBuilt) drawPoem();
-
- drawTrail();
- drawMoon();
- drawCakes();
- }
-
- /* ------------------------------------------------------------------ *
- * Sparks and caption
- * ------------------------------------------------------------------ */
-
- function burst(x: number, y: number, count: number): void {
- if (!config.sparkle) return;
- for (let index = 0; index < count; index++) {
- const spark = document.createElement("i");
- spark.className = "mid-autumn-egg-spark";
- const angle = Math.random() * Math.PI * 2;
- const distance = SPARK_DISTANCE_MIN + Math.random() * SPARK_DISTANCE_RANGE;
- spark.style.left = `${x}px`;
- spark.style.top = `${y}px`;
- spark.style.setProperty("--mid-autumn-egg-spark-dx", `${Math.cos(angle) * distance}px`);
- spark.style.setProperty("--mid-autumn-egg-spark-dy", `${Math.sin(angle) * distance}px`);
- spark.style.animationDelay = `${Math.random() * SPARK_DELAY_RANGE_MS}ms`;
- decor.appendChild(spark);
-
- const frame = window.requestAnimationFrame(() => {
- sparkFrames = sparkFrames.filter((id) => id !== frame);
- if (destroyed) return;
- spark.classList.add("play");
- });
- sparkFrames.push(frame);
-
- const timer = window.setTimeout(() => {
- spark.remove();
- sparks = sparks.filter((handle) => handle.element !== spark);
- }, SPARK_LIFETIME_MS);
- sparks.push({ element: spark, timer });
- }
- }
-
- function clearSparks(): void {
- for (const handle of sparks) {
- window.clearTimeout(handle.timer);
- handle.element.remove();
- }
- sparks = [];
- for (const frame of sparkFrames) window.cancelAnimationFrame(frame);
- sparkFrames = [];
- }
-
- function showCaption(): void {
- if (!config.caption) return;
- caption.classList.remove("show");
- void caption.offsetWidth; // Force a reflow so the animation can replay.
- caption.classList.add("show");
- }
-
- /* ------------------------------------------------------------------ *
- * Main loop, seek and static frame
- * ------------------------------------------------------------------ */
-
- function loop(now: number): void {
- if (destroyed) return;
- if (!lastFrameTime) lastFrameTime = now;
- let dt = (now - lastFrameTime) / 1000;
- lastFrameTime = now;
- if (dt > MAX_FRAME_STEP_SECONDS) dt = MAX_FRAME_STEP_SECONDS;
- if (dt < 0) dt = 0;
-
- if (!startTime) startTime = now;
- elapsed = (now - startTime) / 1000;
- skyProgress = clamp(elapsed / phases.skyIn, 0, 1);
-
- update(dt);
- render();
-
- frameId = window.requestAnimationFrame(loop);
- }
-
- /** Run the simulation forward in fixed steps; used by reduced motion and by QA seeks. */
- function fastForward(target: number): void {
- elapsed = 0;
- skyProgress = 1;
- const step = SIMULATION_STEP_SECONDS;
- let steps = 0;
- while (elapsed < target && steps++ < MAX_FAST_FORWARD_STEPS) {
- elapsed += step;
- update(step);
- }
- elapsed = target;
- }
-
- function renderStaticFrame(): void {
- fastForward(phases.done + STATIC_FRAME_TAIL_SECONDS);
- skyProgress = 1;
- render();
- }
-
- function renderSeekFrame(target: number): void {
- fastForward(target);
- skyProgress = clamp(target / phases.skyIn, 0, 1);
- render();
- if (target >= phases.done) showCaption();
- }
-
- /* ------------------------------------------------------------------ *
- * Resize
- * ------------------------------------------------------------------ */
-
- function onResize(): void {
- resizeTimer = null;
- setup();
- if (seekSeconds !== null) {
- renderSeekFrame(seekSeconds);
- return;
- }
- if (reduceMotion) {
- renderStaticFrame();
- showCaption();
- }
- }
-
- function scheduleRelayout(delay: number): void {
- if (destroyed) return;
- if (resizeTimer !== null) window.clearTimeout(resizeTimer);
- resizeTimer = window.setTimeout(onResize, delay);
- }
-
- function onWindowResize(): void {
- scheduleRelayout(RESIZE_DEBOUNCE_MS);
- }
-
- function onOrientationChange(): void {
- scheduleRelayout(ORIENTATION_DEBOUNCE_MS);
- }
-
- /* ------------------------------------------------------------------ *
- * Assets and lifecycle
- * ------------------------------------------------------------------ */
-
- function loadImage(url: string, onSettled: () => void): HTMLImageElement {
- const image = new Image();
- image.onload = onSettled;
- image.onerror = () => {
- // Non-fatal: the animation keeps running without that layer.
- options.onError?.(new Error(`Mid-Autumn easter egg: failed to load ${url}`));
- onSettled();
- };
- image.src = url;
- return image;
- }
-
- function loadImages(onReady: () => void): void {
- let settled = 0;
- const done = (): void => {
- if (++settled === 2) onReady();
- };
- moonImage = loadImage(options.moonImageUrl, done);
- cakeImage = loadImage(options.cakeImageUrl, done);
- }
-
- /**
- * Wait for the Chinese font used by `sampleTextPoints` so the first open
- * samples the correct glyphs instead of a fallback font's metrics.
- *
- * Uses the Font Loading API (widely supported). Falls back to a short
- * timeout when the API is unavailable so the animation never hangs.
- */
- function ensureTextFont(onReady: () => void): void {
- const font = `bold 48px ${TEXT_FONT_STACK}`;
- if (typeof document.fonts?.load === "function") {
- document.fonts.load(font, config.text).then(onReady, onReady);
- } else {
- onReady();
- }
- }
-
- function releaseImages(): void {
- for (const image of [moonImage, cakeImage]) {
- if (!image) continue;
- image.onload = null;
- image.onerror = null;
- }
- moonImage = null;
- cakeImage = null;
- }
-
- function start(): void {
- if (started || destroyed) return;
- started = true;
-
- window.addEventListener("resize", onWindowResize);
- window.addEventListener("orientationchange", onOrientationChange);
- setup();
-
- // Wait for both images and the text font before starting the animation.
- // Without the font the first-open text sampling produces incomplete glyphs.
- let pending = 2;
- const onAssetReady = (): void => {
- if (--pending > 0) return;
- if (destroyed) return;
- if (cakeImage) buildCakeSprite();
- reset();
- if (seekSeconds !== null) {
- renderSeekFrame(seekSeconds);
- return;
- }
- if (reduceMotion) {
- renderStaticFrame();
- showCaption();
- return;
- }
- frameId = window.requestAnimationFrame(loop);
- };
- loadImages(onAssetReady);
- ensureTextFont(onAssetReady);
- }
-
- function destroy(): void {
- if (destroyed) return;
- destroyed = true;
-
- if (frameId !== null) {
- window.cancelAnimationFrame(frameId);
- frameId = null;
- }
- if (resizeTimer !== null) {
- window.clearTimeout(resizeTimer);
- resizeTimer = null;
- }
- window.removeEventListener("resize", onWindowResize);
- window.removeEventListener("orientationchange", onOrientationChange);
-
- clearSparks();
- releaseImages();
- caption.classList.remove("show");
- decor.remove();
-
- cakes = [];
- stars = [];
- trail = [];
- poem = null;
- columnHeights = new Float32Array(0);
- cakeSprite = null;
- textRect = null;
- }
-
- return { start, destroy };
-}
diff --git a/apps/desktop/src/features/mid-autumn-egg/text-sampling.ts b/apps/desktop/src/features/mid-autumn-egg/text-sampling.ts
deleted file mode 100644
index a60418702..000000000
--- a/apps/desktop/src/features/mid-autumn-egg/text-sampling.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Pixel sampling of the target text.
- *
- * The offscreen canvas is drawn and read back purely for geometry: it produces
- * the points the mooncakes fly to. Nothing here touches the scene, the DOM of
- * the overlay or the animation clock.
- */
-import { TEXT_FONT_STACK, rand } from "./timeline";
-
-/** A sampled point of the target text, in the coordinate space of the offscreen canvas. */
-export type TextSamplePoint = { x: number; y: number };
-
-/** Alpha above which a pixel counts as part of a glyph. */
-const ALPHA_THRESHOLD = 128;
-/** Font size as a share of the offscreen canvas height. */
-const FONT_SIZE_RATIO = 0.94;
-/** Glyph width is kept inside this share of the canvas width. */
-const WIDTH_FIT_RATIO = 0.96;
-/** Random jitter per point, as a share of the sampling step. */
-const JITTER_RATIO = 0.16;
-const MIN_STEP = 3;
-const MIN_STEP_REFINED = 2;
-/** Accepted deviation of the point count from the requested target. */
-const ACCEPT_MIN_RATIO = 0.85;
-const ACCEPT_MAX_RATIO = 1.15;
-const MAX_REFINE_PASSES = 5;
-
-/**
- * Sample the filled pixels of `text` on a `width` x `height` offscreen canvas.
- *
- * The sampling step is refined until the point count is within ±15% of
- * `target`, so the number of points matches the number of mooncakes. Returns an
- * empty array when the 2D context is unavailable (canvas unsupported) or when
- * the text paints nothing; the caller then keeps the mooncakes on the ground.
- */
-export function sampleTextPoints(
- text: string,
- target: number,
- width: number,
- height: number,
-): TextSamplePoint[] {
- const canvasWidth = Math.max(2, Math.round(width));
- const canvasHeight = Math.max(2, Math.round(height));
-
- const canvas = document.createElement("canvas");
- canvas.width = canvasWidth;
- canvas.height = canvasHeight;
- const context = canvas.getContext("2d");
- if (!context) return [];
-
- let fontSize = canvasHeight * FONT_SIZE_RATIO;
- const applyFont = (): void => {
- context.font = `bold ${fontSize.toFixed(1)}px ${TEXT_FONT_STACK}`;
- };
- context.textAlign = "center";
- context.textBaseline = "middle";
- applyFont();
- const measured = context.measureText(text).width;
- if (measured > canvasWidth * WIDTH_FIT_RATIO) {
- fontSize *= (canvasWidth * WIDTH_FIT_RATIO) / measured;
- applyFont();
- }
- context.fillStyle = "#fff";
- context.fillText(text, canvasWidth / 2, canvasHeight / 2);
-
- const pixels = context.getImageData(0, 0, canvasWidth, canvasHeight).data;
-
- const collect = (step: number): TextSamplePoint[] => {
- const points: TextSamplePoint[] = [];
- const jitter = step * JITTER_RATIO;
- let row = 0;
- for (let y = step * 0.5; y < canvasHeight; y += step, row++) {
- const offset = (row % 2) * step * 0.5;
- for (let x = step * 0.5 + offset; x < canvasWidth; x += step) {
- const sampleX = x | 0;
- const sampleY = y | 0;
- if (sampleX < 0 || sampleX >= canvasWidth) continue;
- if (sampleY < 0 || sampleY >= canvasHeight) continue;
- if (pixels[(sampleY * canvasWidth + sampleX) * 4 + 3] > ALPHA_THRESHOLD) {
- points.push({ x: x + rand(-jitter, jitter), y: y + rand(-jitter, jitter) });
- }
- }
- }
- return points;
- };
-
- let step = Math.max(
- MIN_STEP,
- Math.sqrt((canvasWidth * canvasHeight) / Math.max(1, target)),
- );
- let points = collect(step);
- for (let pass = 0; pass < MAX_REFINE_PASSES; pass++) {
- if (!points.length) break;
- const ratio = points.length / target;
- if (ratio > ACCEPT_MAX_RATIO || ratio < ACCEPT_MIN_RATIO) {
- step = Math.max(MIN_STEP_REFINED, step * Math.sqrt(ratio));
- points = collect(step);
- } else {
- break;
- }
- }
- return points;
-}
diff --git a/apps/desktop/src/features/mid-autumn-egg/timeline.ts b/apps/desktop/src/features/mid-autumn-egg/timeline.ts
deleted file mode 100644
index fb0a43636..000000000
--- a/apps/desktop/src/features/mid-autumn-egg/timeline.ts
+++ /dev/null
@@ -1,331 +0,0 @@
-/**
- * Timeline, easing helpers and tuning constants for the Mid-Autumn easter egg.
- *
- * This is a faithful port of the hand-verified standalone animation: the same
- * timeline, the same physics, the same shapes and the same poem scheduling.
- * Every magic number of that animation lives here with a name, so the scene
- * module stays readable and nothing drifts while the port is reviewed.
- */
-
-/** Tunable knobs of the animation. The defaults are the verified baseline. */
-export type MidAutumnEggConfig = {
- /** Baseline duration in seconds. Only the moon rise scales with it. */
- duration: number;
- /** Moon rise slowdown factor (1.5 = the moon rises 1.5x slower than the baseline). */
- moonSpeed: number;
- /** Sky opacity: below 1 the overlay canvas lets the application shine through. */
- skyAlpha: number;
- /** Total number of mooncakes; also the pixel density of the assembled text. */
- cakes: number;
- /** Text assembled out of mooncakes (on-screen artwork, intentionally Chinese). */
- text: string;
- /**
- * Vertical poem pairs. Within a pair the right column is the leading line and
- * the left column answers it (vertical text reads right to left).
- */
- poemPairs: readonly (readonly [string, string])[];
- /** How many poem pairs may float on screen at the same time. */
- poemMax: number;
- /** Spark bursts when the moon arrives and when the text is assembled. */
- sparkle: boolean;
- /** Closing caption in the top-right corner. */
- caption: boolean;
-};
-
-/** The configuration the standalone animation was verified with. */
-export const DEFAULT_MID_AUTUMN_EGG_CONFIG: MidAutumnEggConfig = {
- duration: 2.5,
- moonSpeed: 1.5,
- skyAlpha: 0.9,
- cakes: 520,
- text: "中秋快乐",
- poemPairs: [
- ["明月几时有", "把酒问青天"],
- ["不知天上宫阙", "今夕是何年"],
- ["我欲乘风归去", "又恐琼楼玉宇"],
- ["高处不胜寒", "起舞弄清影"],
- ["何似在人间", "转朱阁低绮户"],
- ["照无眠", "不应有恨"],
- ["何事长向别时圆", "人有悲欢离合"],
- ["月有阴晴圆缺", "此事古难全"],
- // The most famous pair opens the animation.
- ["但愿人长久", "千里共婵娟"],
- ],
- poemMax: 4,
- sparkle: true,
- caption: true,
-};
-
-/** Absolute timeline of one run, in seconds. */
-export type MidAutumnEggPhases = {
- /** Moon rise along the bezier curve. */
- rise: number;
- /** Short hold in the top-right corner after the rise. */
- hold: number;
- /** First fallen mooncake. */
- rainStart: number;
- /** Window during which mooncakes are spawned. */
- spawnDuration: number;
- /** End of the falling window. */
- rainEnd: number;
- /** Mooncakes take off to assemble the text. */
- flyStart: number;
- /** Left-to-right stagger of the take-off. */
- flyStagger: number;
- /** Flight time of a single mooncake. */
- flyDuration: number;
- /** The text is fully assembled. */
- done: number;
- /** Background poem pairs start fading in. */
- poemStart: number;
- /** Fade-in duration of the whole poem layer. */
- poemFade: number;
- /** Night sky fade-in. */
- skyIn: number;
- /** Mooncakes spawned per second during the spawn window. */
- rainRate: number;
-};
-
-/**
- * Derive the timeline from the config.
- *
- * The rise scales with `duration * 0.21 * moonSpeed`; every later phase is a
- * fixed offset from `rainStart`, so the mooncake rain keeps its own rhythm no
- * matter how slow the moon is.
- */
-export function createMidAutumnEggPhases(
- config: MidAutumnEggConfig,
-): MidAutumnEggPhases {
- const rise = config.duration * 0.21 * config.moonSpeed;
- const hold = 0.25;
- const rainStart = 0;
- const spawnDuration = 0.8;
- const flyStart = rainStart + 2.2;
- const flyStagger = 0.5;
- const flyDuration = 0.6;
- return {
- rise,
- hold,
- rainStart,
- spawnDuration,
- rainEnd: rainStart + 1.75,
- flyStart,
- flyStagger,
- flyDuration,
- done: flyStart + flyStagger + flyDuration,
- poemStart: rainStart + 3.15,
- poemFade: 0.75,
- skyIn: 0.3,
- rainRate: config.cakes / spawnDuration,
- };
-}
-
-/* ------------------------------------------------------------------ *
- * Helpers
- * ------------------------------------------------------------------ */
-
-export type Vec2 = { x: number; y: number };
-
-export function clamp(value: number, min: number, max: number): number {
- return value < min ? min : value > max ? max : value;
-}
-
-export function rand(min: number, max: number): number {
- return min + Math.random() * (max - min);
-}
-
-export function easeInOutQuad(t: number): number {
- return t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2;
-}
-
-export function easeInOutCubic(t: number): number {
- return t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
-}
-
-/** Point on a cubic bezier curve at `t` in 0..1. */
-export function cubicPoint(
- p0: Vec2,
- p1: Vec2,
- p2: Vec2,
- p3: Vec2,
- t: number,
-): Vec2 {
- const mt = 1 - t;
- const a = mt * mt * mt;
- const b = 3 * mt * mt * t;
- const c = 3 * mt * t * t;
- const d = t * t * t;
- return {
- x: a * p0.x + b * p1.x + c * p2.x + d * p3.x,
- y: a * p0.y + b * p1.y + c * p2.y + d * p3.y,
- };
-}
-
-/* ------------------------------------------------------------------ *
- * Fonts and sprite geometry
- * ------------------------------------------------------------------ */
-
-export const TEXT_FONT_STACK =
- '"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC",sans-serif';
-export const SERIF_FONT_STACK =
- '"Songti SC","STSong","SimSun","Noto Serif SC",serif';
-
-/** Share of the moon/cake sprite that is the solid body (the images carry a glow). */
-export const MOON_FILL = 0.86;
-export const CAKE_FILL = 0.87;
-/** Supersampling factor of the cached mooncake sprite, plus its glow padding. */
-export const CAKE_SPRITE_SUPERSAMPLE = 2;
-export const CAKE_SPRITE_PADDING_RATIO = 1.36;
-export const CAKE_SPRITE_LIFT_RATIO = 0.015;
-
-/* ------------------------------------------------------------------ *
- * Layout ratios (resolution independent)
- * ------------------------------------------------------------------ */
-
-export const CAKE_RADIUS_RATIO = 0.012;
-export const CAKE_RADIUS_MIN = 5;
-export const CAKE_RADIUS_MAX = 11;
-export const GROUND_INSET_RATIO = 0.06;
-export const GROUND_INSET_MIN = 26;
-/** Stacking column width as a multiple of the mooncake radius. */
-export const CAKE_COLUMN_WIDTH_RATIO = 1.6;
-export const MOON_RADIUS_RATIO = 0.075;
-export const MOON_RADIUS_MIN = 34;
-export const MOON_RADIUS_MAX = 88;
-export const MOON_PATH_START_OFFSET = 1.8;
-export const MOON_PATH_END_MIN_RATIO = 1.9;
-export const STAR_DENSITY = 9000;
-export const STAR_COUNT_MIN = 80;
-export const STAR_COUNT_MAX = 320;
-export const STAR_BAND_RATIO = 0.88;
-export const STAR_RADIUS_MIN = 0.35;
-export const STAR_RADIUS_RANGE = 1.3;
-export const STAR_ALPHA_MIN = 0.2;
-export const STAR_ALPHA_RANGE = 0.65;
-export const STAR_SPEED_MIN = 0.5;
-export const STAR_SPEED_RANGE = 1.9;
-
-/* ------------------------------------------------------------------ *
- * Physics and rain
- * ------------------------------------------------------------------ */
-
-/** Gravity = screen height * this factor, so the fall time is resolution independent. */
-export const GRAVITY_K = 3.2;
-export const GRAVITY_MIN = 1500;
-export const CAKE_SPAWN_PAD_RATIO = 2.2;
-export const CAKE_SPAWN_ABOVE_RANGE = 80;
-export const CAKE_SPAWN_VX = 27;
-export const CAKE_SPAWN_VY_MIN = 50;
-export const CAKE_SPAWN_VY_RANGE = 110;
-export const CAKE_SPIN_RANGE = 2.5;
-export const CAKE_BOUNCE_DAMPING = 0.5;
-/** Contact offset of the cake centre above the floor and the pile top. */
-export const CAKE_CONTACT_RATIO = 0.82;
-export const CAKE_COLUMN_GROWTH = 1.5;
-export const CAKE_COLUMN_GROWTH_RANDOM = 0.3;
-export const CAKE_COLUMN_SPREAD = 0.12;
-export const RAIN_SPAWN_GUARD = 24;
-
-/* ------------------------------------------------------------------ *
- * Text assembly
- * ------------------------------------------------------------------ */
-
-export const TEXT_RECT_MAX_WIDTH = 1100;
-export const TEXT_RECT_WIDTH_RATIO = 0.88;
-export const TEXT_RECT_ASPECT = 4.6;
-export const TEXT_RECT_MAX_HEIGHT_RATIO = 0.38;
-export const TEXT_RECT_CENTER_Y_RATIO = 0.47;
-/** Stacked mooncakes (more cakes than sampled points) scatter by this much. */
-export const TEXT_STACK_JITTER_RATIO = 0.6;
-export const TEXT_CONTROL_SPREAD = 60;
-export const TEXT_ARC_LIFT = 80;
-export const TEXT_ARC_LIFT_RANDOM = 110;
-export const TEXT_DELAY_RANDOM = 0.12;
-
-/* ------------------------------------------------------------------ *
- * Moon
- * ------------------------------------------------------------------ */
-
-export const MOON_BREATH_SPEED = 1.7;
-export const MOON_BREATH_AMPLITUDE = 0.012;
-export const MOON_GLOW_INNER_RATIO = 0.6;
-export const MOON_GLOW_OUTER_RATIO = 3.2;
-export const MOON_TRAIL_MAX = 70;
-export const TRAIL_LIFETIME = 0.7;
-export const TRAIL_GLOW_INNER_BASE = 14;
-export const TRAIL_GLOW_INNER_LIFE = 18;
-export const TRAIL_RADIUS_BASE = 18;
-export const TRAIL_RADIUS_LIFE = 16;
-
-/* ------------------------------------------------------------------ *
- * Sparks and caption
- * ------------------------------------------------------------------ */
-
-export const MOON_SPARK_COUNT = 18;
-export const TEXT_SPARK_COUNT = 22;
-export const SPARK_DISTANCE_MIN = 18;
-export const SPARK_DISTANCE_RANGE = 42;
-export const SPARK_DELAY_RANGE_MS = 180;
-export const SPARK_LIFETIME_MS = 1900;
-/** Caption copy: artwork content, not UI chrome. */
-export const CAPTION_TITLE = "月满 · 团圆";
-export const CAPTION_SUBTITLE = "AIUO · PI-DESKTOP";
-
-/* ------------------------------------------------------------------ *
- * Loop, resize and fast-forward
- * ------------------------------------------------------------------ */
-
-export const MAX_FRAME_STEP_SECONDS = 0.05;
-export const SIMULATION_STEP_SECONDS = 1 / 60;
-/** Upper bound of fast-forward steps, so a hostile seek value cannot hang the renderer. */
-export const MAX_FAST_FORWARD_STEPS = 60 * 600;
-export const STATIC_FRAME_TAIL_SECONDS = 0.8;
-export const RESIZE_DEBOUNCE_MS = 160;
-export const ORIENTATION_DEBOUNCE_MS = 260;
-
-/* ------------------------------------------------------------------ *
- * Poem layer tuning
- * ------------------------------------------------------------------ */
-
-export const POEM_SEED = 20260924;
-/** The schedule is precomputed for 30 minutes and then loops. */
-export const POEM_HORIZON_SECONDS = 1800;
-export const POEM_SCHEDULE_GUARD = 5000;
-export const POEM_GAP_BASE_SECONDS = 0.6;
-export const POEM_GAP_RANDOM_SECONDS = 3.2;
-export const POEM_LIFE_BASE_SECONDS = 8;
-export const POEM_LIFE_RANDOM_SECONDS = 6;
-export const POEM_FONT_RATIO = 0.03;
-export const POEM_FONT_MIN = 13;
-export const POEM_FONT_MAX = 34;
-export const POEM_FONT_SCALE_MIN = 0.72;
-export const POEM_FONT_SCALE_RANGE = 0.62;
-export const POEM_LINE_HEIGHT_RATIO = 1.12;
-export const POEM_HALF_HEIGHT_PAD_RATIO = 0.62;
-/** Horizontal half-extent of a two-column pair, in font sizes. */
-export const POEM_HALF_WIDTH_RATIO = 1.35;
-export const POEM_COLUMN_GAP_RATIO = 0.82;
-export const POEM_EDGE_PADDING = 12;
-export const POEM_VERTICAL_MARGIN = 14;
-export const POEM_DRIFT_MIN = 20;
-export const POEM_DRIFT_RANGE = 45;
-export const POEM_SWAY_MIN = 4;
-export const POEM_SWAY_RANGE = 9;
-export const POEM_SWAY_SPEED_MIN = 0.16;
-export const POEM_SWAY_SPEED_RANGE = 0.22;
-export const POEM_WOBBLE_MIN = 0.55;
-export const POEM_WOBBLE_RANGE = 0.4;
-export const POEM_PHASE_RANGE = 6.283;
-export const POEM_CYCLE_TAIL_SECONDS = 0.3;
-export const POEM_FADE_IN_FRACTION = 0.16;
-export const POEM_FADE_OUT_FRACTION = 0.28;
-export const POEM_MIN_ENVELOPE = 0.002;
-export const POEM_ALPHA_BASE = 0.042;
-export const POEM_ALPHA_RANGE = 0.062;
-export const POEM_GLOW_ALPHA_SCALE = 1.5;
-export const POEM_GLOW_BLUR = 12;
-export const POEM_COLUMN_STAGGER = 0.9;
-export const POEM_CHAR_STAGGER = 0.5;
-export const POEM_CHAR_WOBBLE_SPEED = 0.7;
-export const POEM_CHAR_WOBBLE_AMPLITUDE = 3.4;
-export const POEM_BREATHE_SPEED = 0.6;
diff --git a/apps/desktop/src/features/settings/SettingsPage.tsx b/apps/desktop/src/features/settings/SettingsPage.tsx
index f9f7db675..95e3a474d 100644
--- a/apps/desktop/src/features/settings/SettingsPage.tsx
+++ b/apps/desktop/src/features/settings/SettingsPage.tsx
@@ -7,7 +7,6 @@ import type {
ShortcutPlatform,
} from "@pi-desktop/shared";
import { useAppStore } from "../../stores/app-store";
-import { useMidAutumnEggStore } from "../../stores/mid-autumn-egg-store";
import { api } from "../../lib/api";
import {
isSettingsDestinationHidden,
@@ -89,7 +88,6 @@ export function SettingsPage() {
const settings = useAppStore((s) => s.settings);
const version = useAppStore((s) => s.version);
const refreshProviders = useAppStore((s) => s.refreshProviders);
- const showMidAutumnEgg = useMidAutumnEggStore((s) => s.show);
const platform = (window.piDesktop?.platform ?? "darwin") as ShortcutPlatform;
// Developer-only destinations (Cloud sync and Remote Hosts) exist only
@@ -598,17 +596,6 @@ export function SettingsPage() {
<UpdatesRow currentVersion={version?.version} />
</SettingsCard>
- <SettingsCard title={t("settings.easterEggs")}>
- <SettingsRow
- title={t("settings.midAutumnEgg")}
- description={t("settings.midAutumnEggDesc")}
- >
- <Button variant="secondary" onClick={showMidAutumnEgg}>
- {t("settings.playMidAutumnEgg")}
- </Button>
- </SettingsRow>
- </SettingsCard>
-
{settings && (
<DeveloperSection settings={settings} saveSettings={saveSettings} />
)}
diff --git a/apps/desktop/src/lib/mid-autumn-egg-preferences.ts b/apps/desktop/src/lib/mid-autumn-egg-preferences.ts
deleted file mode 100644
index a6be7ea74..000000000
--- a/apps/desktop/src/lib/mid-autumn-egg-preferences.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-const MID_AUTUMN_EGG_SEEN_STORAGE_KEY = "pi.desktop.midAutumnEggSeen.v2";
-
-function storage(): Storage | null {
- try {
- return typeof globalThis !== "undefined" && "localStorage" in globalThis
- ? globalThis.localStorage
- : null;
- } catch {
- return null;
- }
-}
-
-/** True once the launch easter egg has been shown so it never replays by itself. */
-export function hasSeenMidAutumnEgg(): boolean {
- const store = storage();
- if (!store) return false;
- try {
- return store.getItem(MID_AUTUMN_EGG_SEEN_STORAGE_KEY) === "1";
- } catch {
- return false;
- }
-}
-
-export function markMidAutumnEggSeen(): void {
- const store = storage();
- if (!store) return;
- try {
- store.setItem(MID_AUTUMN_EGG_SEEN_STORAGE_KEY, "1");
- } catch {
- // A blocked or full localStorage must not prevent the app from running.
- }
-}
diff --git a/apps/desktop/src/stores/mid-autumn-egg-store.ts b/apps/desktop/src/stores/mid-autumn-egg-store.ts
deleted file mode 100644
index cb5f5a151..000000000
--- a/apps/desktop/src/stores/mid-autumn-egg-store.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { create } from "zustand";
-
-/**
- * Whether the full-screen Mid-Autumn overlay is showing. `show` is used both
- * for the once-only launch replay and for the manual replay in Settings.
- */
-export const useMidAutumnEggStore = create<{
- open: boolean;
- show: () => void;
- hide: () => void;
-}>((set) => ({
- open: false,
- show: () => set({ open: true }),
- hide: () => set({ open: false }),
-}));
diff --git a/apps/desktop/src/styles/chat-shell.css b/apps/desktop/src/styles/chat-shell.css
index 2858c6f68..a3eb3777c 100644
--- a/apps/desktop/src/styles/chat-shell.css
+++ b/apps/desktop/src/styles/chat-shell.css
@@ -733,29 +733,21 @@
user-select: none;
}
-:root:not([data-theme="light"]):not([lang^="zh"]) .home-mascot-logo .home-mascot-motion.home-mascot-dark:not(.home-mascot-dark-zh),
+:root:not([data-theme="light"]) .home-mascot-logo .home-mascot-motion.home-mascot-dark,
:root[data-theme="light"] .home-mascot-logo .home-mascot-motion.home-mascot-light {
display: block;
}
-:root:not([data-theme="light"])[lang^="zh"] .home-mascot-logo .home-mascot-motion.home-mascot-dark.home-mascot-dark-zh {
- display: block;
-}
-
@media (prefers-reduced-motion: reduce) {
:root:not([data-theme="light"]) .home-mascot-logo .home-mascot-motion.home-mascot-dark,
:root[data-theme="light"] .home-mascot-logo .home-mascot-motion.home-mascot-light {
display: none;
}
- :root:not([data-theme="light"]):not([lang^="zh"]) .home-mascot-logo .home-mascot-still.home-mascot-dark:not(.home-mascot-dark-zh),
+ :root:not([data-theme="light"]) .home-mascot-logo .home-mascot-still.home-mascot-dark,
:root[data-theme="light"] .home-mascot-logo .home-mascot-still.home-mascot-light {
display: block;
}
-
- :root:not([data-theme="light"])[lang^="zh"] .home-mascot-logo .home-mascot-still.home-mascot-dark.home-mascot-dark-zh {
- display: block;
- }
}
.empty-hero h1 {
diff --git a/apps/desktop/test/mid-autumn-egg.test.mjs b/apps/desktop/test/mid-autumn-egg.test.mjs
deleted file mode 100644
index f1d8d492a..000000000
--- a/apps/desktop/test/mid-autumn-egg.test.mjs
+++ /dev/null
@@ -1,239 +0,0 @@
-/**
- * Mid-Autumn easter egg contract.
- *
- * Two layers are covered:
- *
- * 1. The pure timeline / poem-schedule modules, which carry the timing that was
- * tuned by hand: the moon rises 1.5x slower than the baseline while the
- * mooncake rain, the assembly and the poem keep their own fixed rhythm, and
- * several poem pairs float on screen at unfixed positions.
- * 2. The renderer wiring: a once-only launch gate that waits for the existing
- * startup splash to finish, a settings row that replays it, and the assets
- * that ship with the feature.
- *
- * All user-visible copies go through i18n, so the catalogue keys are part of
- * the contract as well.
- */
-import assert from "node:assert/strict";
-import { existsSync, readFileSync, readdirSync } from "node:fs";
-import test from "node:test";
-
-import {
- DEFAULT_MID_AUTUMN_EGG_CONFIG,
- createMidAutumnEggPhases,
-} from "../src/features/mid-autumn-egg/timeline.ts";
-
-const featureDir = new URL("../src/features/mid-autumn-egg/", import.meta.url);
-const read = (relative) => readFileSync(new URL(relative, import.meta.url), "utf8");
-
-const overlaySource = read("../src/features/mid-autumn-egg/MidAutumnEggOverlay.tsx");
-const hostSource = read("../src/features/mid-autumn-egg/MidAutumnEggHost.tsx");
-const sceneSource = read("../src/features/mid-autumn-egg/scene.ts");
-const preferencesSource = read("../src/lib/mid-autumn-egg-preferences.ts");
-const storeSource = read("../src/stores/mid-autumn-egg-store.ts");
-const settingsPageSource = read("../src/features/settings/SettingsPage.tsx");
-const appShellSource = read("../src/features/app/AppShell.tsx");
-
-/* ------------------------------------------------------------------ *
- * Timeline
- * ------------------------------------------------------------------ */
-
-test("a slow moon does not change the mooncake rain rhythm", () => {
- const baseline = createMidAutumnEggPhases({
- ...DEFAULT_MID_AUTUMN_EGG_CONFIG,
- moonSpeed: 1,
- });
- const slowed = createMidAutumnEggPhases(DEFAULT_MID_AUTUMN_EGG_CONFIG);
-
- // The moon rise is the only phase that scales.
- assert.equal(slowed.rise, baseline.rise * DEFAULT_MID_AUTUMN_EGG_CONFIG.moonSpeed);
- assert.equal(slowed.rise.toFixed(3), "0.788");
- assert.equal(baseline.rise.toFixed(3), "0.525");
-
- assert.equal(slowed.spawnDuration, baseline.spawnDuration);
- assert.equal(slowed.flyStagger, baseline.flyStagger);
- const round = (value) => Number(value.toFixed(3));
- assert.equal(
- round(slowed.rainEnd - slowed.rainStart),
- round(baseline.rainEnd - baseline.rainStart),
- );
- assert.equal(slowed.flyDuration, baseline.flyDuration);
- assert.equal(slowed.poemFade, baseline.poemFade);
- // rainStart = 0 (fixed), so changing moonSpeed does not shift the rain start.
- assert.equal(
- slowed.rainStart - baseline.rainStart,
- 0,
- );
-});
-
-test("the phases keep the hand-tuned absolute timeline", () => {
- const phases = createMidAutumnEggPhases(DEFAULT_MID_AUTUMN_EGG_CONFIG);
-
- assert.equal(phases.rainStart.toFixed(3), "0.000");
- assert.equal(phases.spawnDuration.toFixed(3), "0.800");
- assert.equal(phases.rainEnd.toFixed(3), "1.750");
- assert.equal(phases.flyStart.toFixed(3), "2.200");
- assert.equal(phases.done.toFixed(3), "3.300");
- assert.equal(phases.poemStart.toFixed(3), "3.150");
- assert.equal(phases.skyIn, 0.3);
-
- // All 520 mooncakes are spawned inside the spawn window.
- assert.equal(phases.rainRate.toFixed(3), (DEFAULT_MID_AUTUMN_EGG_CONFIG.cakes / 0.8).toFixed(3));
-
- // The text is assembled after the rain has landed, and the poem follows it.
- assert.ok(phases.spawnDuration < phases.rainEnd - phases.rainStart);
- assert.ok(phases.flyStart > phases.rainEnd);
- assert.ok(phases.poemStart < phases.done);
-});
-
-test("the poem data ships as vertical pairs with a famous closing pair", () => {
- const pairs = DEFAULT_MID_AUTUMN_EGG_CONFIG.poemPairs;
-
- assert.ok(pairs.length >= 8);
- for (const [leading, answering] of pairs) {
- assert.ok(leading.length > 0 && answering.length > 0);
- // Vertical columns stay inside the reserved height on a small viewport.
- assert.ok(Math.max(leading.length, answering.length) <= 7);
- }
- assert.deepEqual(pairs.at(-1), ["但愿人长久", "千里共婵娟"]);
-});
-
-/* ------------------------------------------------------------------ *
- * Poem schedule
- *
- * The scheduler imports its layout constants through the repo's extensionless
- * specifier convention, which node:test cannot resolve by itself, so its
- * contract is pinned at the source level here. The runtime behaviour (several
- * pairs on screen at once, at unfixed positions, cycling in a random order) is
- * verified by the screenshot harness described in the pull request.
- * ------------------------------------------------------------------ */
-
-const poemScheduleSource = read("../src/features/mid-autumn-egg/poem-schedule.ts");
-
-test("the poem scheduler is seeded, lane-capped and cyclic", () => {
- // A fixed seed is what keeps the layout reproducible for a given viewport.
- assert.match(poemScheduleSource, /createSeededRandom\(POEM_SEED\)/);
- assert.match(poemScheduleSource, /1664525/);
- assert.match(poemScheduleSource, /1013904223/);
-
- // Concurrency is bounded by lanes, and the table loops instead of growing.
- assert.match(poemScheduleSource, /maxPairs/);
- assert.match(poemScheduleSource, /cycle/);
-
- // Every scheduled appearance owns its lifetime, placement and drift.
- for (const field of ["start", "end", "centerX", "centerY", "drift", "fontSize"]) {
- assert.match(poemScheduleSource, new RegExp(`\\b${field}\\b`));
- }
-
- // Placements come from the seeded stream, not from a fixed slot table.
- assert.match(poemScheduleSource, /random\(\)/);
- assert.match(poemScheduleSource, /pairs\.map/);
-});
-
-test("the schedule keeps every pair as two vertical columns", () => {
- assert.match(poemScheduleSource, /Array\.from\(leading\)/);
- assert.match(poemScheduleSource, /Array\.from\(answering\)/);
- assert.match(poemScheduleSource, /columns/);
-});
-
-/* ------------------------------------------------------------------ *
- * Assets
- * ------------------------------------------------------------------ */
-
-test("the two artwork assets ship as webp", () => {
- const assets = new URL("../src/assets/", import.meta.url);
-
- for (const name of ["mid-autumn-moon.webp", "mid-autumn-cake.webp"]) {
- const file = new URL(name, assets);
- assert.ok(existsSync(file), `${name} must exist`);
- const bytes = readFileSync(file);
- assert.equal(bytes.subarray(0, 4).toString("ascii"), "RIFF");
- assert.equal(bytes.subarray(8, 12).toString("ascii"), "WEBP");
- assert.ok(bytes.length > 4096, `${name} looks like a real image`);
- }
-
- // The animation must not carry base64 artwork or an embedded html document.
- assert.equal(sceneSource.includes("data:image"), false);
- assert.equal(sceneSource.includes("srcdoc"), false);
- assert.equal(overlaySource.includes("iframe"), false);
- assert.equal(overlaySource.includes("data:image"), false);
- assert.equal(readdirSync(featureDir).some((name) => name.endsWith(".html")), false);
-});
-
-/* ------------------------------------------------------------------ *
- * Once-only launch gate
- * ------------------------------------------------------------------ */
-
-test("the seen flag is a guarded renderer preference", () => {
- assert.match(preferencesSource, /pi\.desktop\.midAutumnEggSeen/);
- assert.match(preferencesSource, /export function hasSeenMidAutumnEgg\(\): boolean/);
- assert.match(preferencesSource, /export function markMidAutumnEggSeen\(\): void/);
- // Storage access must never throw into the app.
- assert.match(preferencesSource, /catch\s*\{/);
- assert.equal(/window\.localStorage/.test(preferencesSource), false);
-});
-
-test("the launch gate waits for the existing startup splash", () => {
- // The gate is explicit about both signals instead of racing the splash.
- assert.match(hostSource, /ready/);
- assert.match(hostSource, /showSplash/);
- assert.match(hostSource, /hasSeenMidAutumnEgg\(\)/);
- assert.match(hostSource, /markMidAutumnEggSeen\(\)/);
- // Marking before showing is what makes it a single automatic playback.
- assert.ok(
- hostSource.indexOf("markMidAutumnEggSeen()") < hostSource.indexOf("showMidAutumnEgg()"),
- "the flag must be written before the overlay opens",
- );
- // It must not touch or replace the boot/loading surface.
- assert.equal(/StartupSplash|setSplashPhase|splashPhase/.test(hostSource), false);
- assert.equal(hostSource.includes("any"), false);
- assert.match(appShellSource, /<MidAutumnEggHost[^>]*showSplash=\{showSplash\}/);
-});
-
-test("the overlay is dismissible from its top-right corner", () => {
- assert.match(overlaySource, /role="dialog"/);
- assert.match(overlaySource, /aria-modal/);
- assert.match(overlaySource, /settings\.closeEasterEgg/);
- assert.match(overlaySource, /Escape/);
- assert.match(overlaySource, /createMidAutumnEggScene\(/);
- assert.match(overlaySource, /\.destroy\(\)/);
- assert.match(overlaySource, /mid-autumn-moon\.webp/);
- assert.match(overlaySource, /mid-autumn-cake\.webp/);
- assert.equal(overlaySource.includes(": any"), false);
-});
-
-/* ------------------------------------------------------------------ *
- * Replay from settings
- * ------------------------------------------------------------------ */
-
-test("settings exposes the egg and replays it through the store", () => {
- assert.match(storeSource, /useMidAutumnEggStore/);
- for (const field of ["open", "show", "hide"]) assert.match(storeSource, new RegExp(field));
- assert.match(settingsPageSource, /settings\.easterEggs/);
- assert.match(settingsPageSource, /settings\.midAutumnEgg/);
- assert.match(settingsPageSource, /settings\.playMidAutumnEgg/);
- assert.match(settingsPageSource, /useMidAutumnEggStore/);
-});
-
-test("every catalogue carries the easter egg strings", () => {
- const locales = readdirSync(new URL("../../../packages/i18n/src/locales/", import.meta.url), {
- withFileTypes: true,
- }).filter((entry) => entry.isDirectory());
-
- assert.ok(locales.length >= 8);
- for (const locale of locales) {
- const catalogue = readFileSync(
- new URL(`../../../packages/i18n/src/locales/${locale.name}/index.ts`, import.meta.url),
- "utf8",
- );
- for (const key of [
- "easterEggs",
- "midAutumnEgg",
- "midAutumnEggDesc",
- "playMidAutumnEgg",
- "closeEasterEgg",
- ]) {
- assert.match(catalogue, new RegExp(`\\b${key}\\b`), `${locale.name} is missing ${key}`);
- }
- }
-});
diff --git a/apps/desktop/test/renderer-branding.test.mjs b/apps/desktop/test/renderer-branding.test.mjs
index abb76c5d9..5f64f4bb7 100644
--- a/apps/desktop/test/renderer-branding.test.mjs
+++ b/apps/desktop/test/renderer-branding.test.mjs
@@ -54,36 +54,22 @@ test("app chrome uses the shared brand asset without branding the composer input
assert.match(icons, /export const IconNewSession/);
assert.doesNotMatch(icons, /IconCodexHome|IconCompose|IconPiMark|IconPiHome/);
await access(new URL("../src/assets/home-mascot-dark.gif", import.meta.url));
- await access(new URL("../src/assets/home-mascot-dark-zh.gif", import.meta.url));
await access(new URL("../src/assets/home-mascot-light.gif", import.meta.url));
await access(new URL("../src/assets/home-mascot-still-dark.png", import.meta.url));
- await access(new URL("../src/assets/home-mascot-still-dark-zh.png", import.meta.url));
await access(new URL("../src/assets/home-mascot-still-light.png", import.meta.url));
await assert.rejects(
() => access(new URL("../src/assets/home-mascot-groups.png", import.meta.url)),
);
assert.match(chatSurface, /<HomeMascotLogo \/>/);
assert.match(mascotLogo, /import mascotMotionDarkUrl from\s*"\.\.\/assets\/home-mascot-dark\.gif"/);
- assert.match(mascotLogo, /import mascotMotionDarkZhUrl from\s*"\.\.\/assets\/home-mascot-dark-zh\.gif"/);
assert.match(mascotLogo, /import mascotMotionLightUrl from\s*"\.\.\/assets\/home-mascot-light\.gif"/);
assert.match(mascotLogo, /import mascotStillDarkUrl from\s*"\.\.\/assets\/home-mascot-still-dark\.png"/);
- assert.match(mascotLogo, /import mascotStillDarkZhUrl from\s*"\.\.\/assets\/home-mascot-still-dark-zh\.png"/);
assert.match(mascotLogo, /import mascotStillLightUrl from\s*"\.\.\/assets\/home-mascot-still-light\.png"/);
assert.match(mascotLogo, /className="home-mascot-logo"/);
assert.match(mascotLogo, /aria-hidden="true"/);
assert.match(mascotLogo, /className="home-mascot-motion home-mascot-dark"/);
- assert.match(mascotLogo, /className="home-mascot-motion home-mascot-dark home-mascot-dark-zh"/);
- assert.match(
- mascotLogo,
- /className="home-mascot-motion home-mascot-dark home-mascot-dark-zh"[\s\S]{0,100}src={mascotMotionDarkZhUrl}/,
- );
assert.match(mascotLogo, /className="home-mascot-motion home-mascot-light"/);
assert.match(mascotLogo, /className="home-mascot-still home-mascot-dark"/);
- assert.match(mascotLogo, /className="home-mascot-still home-mascot-dark home-mascot-dark-zh"/);
- assert.match(
- mascotLogo,
- /className="home-mascot-still home-mascot-dark home-mascot-dark-zh"[\s\S]{0,100}src={mascotStillDarkZhUrl}/,
- );
assert.match(mascotLogo, /className="home-mascot-still home-mascot-light"/);
assert.doesNotMatch(mascotLogo, /<svg/);
assert.doesNotMatch(
@@ -98,11 +84,7 @@ test("app chrome uses the shared brand asset without branding the composer input
);
assert.match(
styles,
- /:root:not\(\[data-theme="light"\]\):not\(\[lang\^="zh"\]\) \.home-mascot-logo \.home-mascot-motion\.home-mascot-dark:not\(\.home-mascot-dark-zh\)/,
- );
- assert.match(
- styles,
- /:root:not\(\[data-theme="light"\]\)\[lang\^="zh"\] \.home-mascot-logo \.home-mascot-motion\.home-mascot-dark\.home-mascot-dark-zh\s*\{\s*display:\s*block;/,
+ /:root:not\(\[data-theme="light"\]\) \.home-mascot-logo \.home-mascot-motion\.home-mascot-dark/,
);
assert.match(
styles,
@@ -110,11 +92,7 @@ test("app chrome uses the shared brand asset without branding the composer input
);
assert.match(
styles,
- /@media \(prefers-reduced-motion: reduce\)[\s\S]*?:root:not\(\[data-theme="light"\]\):not\(\[lang\^="zh"\]\) \.home-mascot-logo \.home-mascot-still\.home-mascot-dark:not\(\.home-mascot-dark-zh\),[\s\S]*?\.home-mascot-still\.home-mascot-light[\s\S]*?display:\s*block;/,
- );
- assert.match(
- styles,
- /@media \(prefers-reduced-motion: reduce\)[\s\S]*?:root:not\(\[data-theme="light"\]\)\[lang\^="zh"\] \.home-mascot-logo \.home-mascot-still\.home-mascot-dark\.home-mascot-dark-zh\s*\{\s*display:\s*block;/,
+ /@media \(prefers-reduced-motion: reduce\)[\s\S]*?\.home-mascot-still\.home-mascot-dark,[\s\S]*?\.home-mascot-still\.home-mascot-light[\s\S]*?display:\s*block;/,
);
assert.match(appLanguage, /document\.documentElement\.lang\s*=\s*target/);
assert.doesNotMatch(styles, /@keyframes home-mascot-orbit|@keyframes home-mascot-breathe|@keyframes home-mascot-blink/);
diff --git a/docs/adr/0152-eight-frame-empty-home-mascot-gif.md b/docs/adr/0152-eight-frame-empty-home-mascot-gif.md
index b55f38f7c..402c6ac1e 100644
--- a/docs/adr/0152-eight-frame-empty-home-mascot-gif.md
+++ b/docs/adr/0152-eight-frame-empty-home-mascot-gif.md
@@ -9,38 +9,35 @@
## Context
ADR 0150 replaced a randomized pixel-art sprite atlas with a 100px inline SVG
-agent mark so the empty-home hero stayed quiet. The empty-home mark now uses
-transparent animated artwork, with dedicated light and dark variants. Chinese
-locales have a separate dark variant supplied as a 30-frame GIF; the standard
-light and dark variants remain eight-frame waves.
+agent mark so the empty-home hero stayed quiet. A new eight-frame waving
+mascot is now the intended empty-home mark, with separate light and dark
+artwork that already uses a transparent background. The previous SVG
+orbit/breathe cycle no longer matches that artwork, and a single raster would
+read poorly when the shell theme changes.
## Decision
-Keep `HomeMascotLogo` in the existing 100px empty-home slot. It is decorative
-(`aria-hidden="true"`) and renders six images, of which CSS shows one at a
-time:
+Replace the inline SVG with processed eight-frame GIFs in the existing 100px
+empty-home slot. `HomeMascotLogo` is decorative (`aria-hidden="true"`) and
+renders four images, of which CSS shows one at a time:
-- `src/assets/home-mascot-light.gif` / `home-mascot-dark.gif` — the standard
- eight-frame wave, with a short idle hold on the first frame
-- `src/assets/home-mascot-dark-zh.gif` — the supplied transparent 30-frame
- artwork for Chinese locales in dark mode
-- The three matching still PNGs — the first frame for each artwork, shown only
- under `prefers-reduced-motion: reduce`
+- `src/assets/home-mascot-light.gif` / `home-mascot-dark.gif` — the looping
+ wave, with a short idle hold on the first frame
+- `src/assets/home-mascot-still-light.png` / `home-mascot-still-dark.png` —
+ the matching first frame, shown only under `prefers-reduced-motion: reduce`
-Theme selection follows `document.documentElement[data-theme]`; language
-selection follows its `lang` attribute. Anything other than `light` uses dark
-artwork, and `lang` values beginning with `zh` select the Chinese dark
-variant. Playback is native to the GIF. There is no random selection, no
-JavaScript timer, and pointer hover does not change cadence.
+The active pair follows `document.documentElement[data-theme]`. Anything other
+than `light` uses the dark artwork, matching `BrandLogo`. Playback is native
+to the GIF. There is no random selection, no JavaScript timer, and pointer
+hover does not change cadence.
## Consequences
- Empty-home branding uses the supplied mascot action set instead of a
code-native SVG.
- The 100px layout slot, decorative role, and reduced-motion freeze remain.
-- Light and dark surfaces keep dedicated artwork. Chinese dark mode uses the
- supplied Chinese action set, while other locales retain the existing dark
- wave.
+- Light and dark surfaces each keep a dedicated mascot treatment instead of
+ recoloring one asset through theme tokens.
- The historical `home-mascot-groups.png` atlas is not in the repository;
the GIFs and still frames are the source assets.
diff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.md
index 625984149..fb76f9d1c 100644
--- a/docs/spec/04-ux/06-settings-ia.md
+++ b/docs/spec/04-ux/06-settings-ia.md
@@ -742,14 +742,6 @@ system while preserving their different data ownership:
- disabling developer mode closes an open console and disables or removes
every entry point; Settings search indexes the card, switch, and console
action
-- **Easter eggs** card with one row that replays the Mid-Autumn egg: a
- full-screen Moon Festival canvas animation (moonrise, a mooncake rain, the
- mooncakes flying up to assemble 「中秋快乐」, and vertical poem lines drifting
- behind them). The same animation also plays by itself once, at most one time
- ever per profile, and only after the startup splash has finished — it must
- never cover the boot splash or appear while the app is still loading.
- Closing it (top-right close button or Escape) returns to the app; afterwards
- it is only reachable from this row
- The Updates row always exposes a Release notes action. It opens a modal
containing the complete shipped stable changelog in newest-first order,
localized to the product language and marking the current and available
diff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.md
index 0470566cc..374cb4fd9 100644
--- a/docs/spec/04-ux/07-ui-design-system.md
+++ b/docs/spec/04-ux/07-ui-design-system.md
@@ -124,12 +124,14 @@ Codex as a visual reference. The identity contract is deliberately small:
and NSIS shortcut identity stay aligned so native notifications,
notification settings, and taskbar groups identify the app as `PI-Desktop`
rather than Electron.
-- The empty-home hero uses a 100px `HomeMascotLogo` GIF. The standard
- eight-frame wave remains in light mode and non-Chinese dark mode. Chinese
- locales (`lang` beginning with `zh`) use the supplied 30-frame transparent
- GIF in dark mode. Reduced motion swaps each variant to its matching first
- frame without changing the 100px slot. Playback is native to GIF; there is
- no random pose selection, JavaScript timer, or hover-driven speed change.
+- The empty-home hero uses a 100px `HomeMascotLogo` GIF: an eight-frame waving
+ mascot compiled from the supplied light and dark action sets, with a short
+ idle hold on the first frame. CSS selects the pair from
+ `document.documentElement[data-theme]`; anything other than `light` uses the
+ dark artwork. Playback is native to the GIF. There is no random pose
+ selection, JavaScript timer, or hover-driven speed change. Reduced motion
+ swaps the GIF for the matching first-frame PNG without changing the 100px
+ slot.
`BrandLogo` remains 20px/18px in the expanded/collapsed sidebar and 64px in
the startup splash. Composer prompt rows do not render a leading brand icon
in either home or thread-docked mode.
@@ -852,10 +854,11 @@ model):
controls remain icon-only and use the semantic hover wash
- Empty hero title uses `var(--ds-text-primary)` (light override `#1a1c1f`);
never hardcode light ink for shared hero styles
-- Empty-home branding stays quiet: the 100px mascot GIF is the sole animated
- hero mark. The standard light/dark variants keep their eight-frame wave;
- dark Chinese locales use a 30-frame transparent variant. Pointer hover does
- not change cadence; reduced motion shows the matching still first frame.
+- Empty-home branding stays quiet: the 100px eight-frame mascot GIF is the
+ sole animated hero mark. Light and dark themes each use a dedicated asset
+ pair. It loops a short wave with an idle hold so the composer remains the
+ primary task surface. Pointer hover does not change the cadence; reduced
+ motion shows the matching still first frame.
- Night home composer plate styles are **dark-scoped only** (elevated-primary
`#212121f5` + standard elevation-prominent)
- Empty draft row keeps **one visible line / 28px optical minimum** so the
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index cbba43b56..8b14ef60f 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -659,14 +659,14 @@ visually distinct from list content.
splash at 3x; ADR 0125). The component subscribes to
`document.documentElement[data-theme]` via a `MutationObserver` and swaps the
source at runtime for the sidebar and startup splash without a reload. The
- empty-home hero uses `HomeMascotLogo` in a 100px slot. The standard light and
- dark GIFs remain eight-frame waves with matching still PNGs. When the root
- `lang` begins with `zh` and the theme is dark, CSS selects the supplied
- 30-frame transparent Chinese GIF and its matching still PNG. Theme and
- language changes take effect without a reload. Playback is native to GIF,
- does not change on pointer hover, and reduced motion selects the matching
- still. The expanded/collapsed sidebar remains 20px/18px and the startup
- splash 64px.
+ empty-home hero uses `HomeMascotLogo` as a 100px eight-frame GIF. Light and
+ dark themes each have a dedicated GIF plus still PNG. CSS follows
+ `document.documentElement[data-theme]` without a reload; anything other than
+ `light` uses the dark artwork. The mascot loops a processed wave with a
+ short idle hold on the first frame. Playback is native to the GIF and does
+ not change on pointer hover; reduced motion swaps to the matching still
+ first-frame PNG. The expanded/collapsed sidebar remains 20px/18px and the
+ startup splash 64px.
Home and thread-docked composer prompt rows do not render a leading brand
icon.
- Project and Temporary session creation controls render the dedicated
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index e94cb4407..209d68879 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -175,21 +175,6 @@
- **Status:** Documented; run after integration into main.
-### E2E-SHELL-mid-autumn-egg-first-open
-
-- **Preconditions:** A profile whose renderer storage has never recorded the
- Mid-Autumn egg (`pi.desktop.midAutumnEggSeen` unset).
-- **Steps:** Launch the app and watch the startup splash; after the shell is
- ready close the egg with its top-right close button, relaunch and confirm no
- automatic playback, then open Settings → Info and activate the Mid-Autumn
- egg row.
-- **Expected:** The automatic egg appears only once the startup splash has
- finished; it never covers or delays the splash and never appears while the
- app is still loading. It fills the window, exposes an obvious top-right
- close button, and both that button and Escape dismiss it and restore focus
- to the app. Settings → Info shows the Easter eggs card, and its row replays
- the same animation on demand regardless of the seen flag.
-- **Status:** Documented; run after integration into main.
- Document every user-visible and protocol-visible behavior that MVP must verify.
- Provide a scenario catalog that maps to acceptance criteria (A–H) and milestones (M1–M6).
- Serve as the traceability backbone: scenario ID ↔ acceptance criterion ↔ spec.
@@ -3176,20 +3161,18 @@ identify the platform validation still needed.
#### E2E-046: PI-Desktop renderer branding and composer icon boundary
-- **Preconditions**: App running in English, zh-CN, and zh-TW locales, with
- an empty home and a docked transcript available.
-- **Steps**: 1) Inspect the expanded and collapsed sidebar. 2) In light mode,
- inspect the empty-home hero in English and Chinese. 3) Switch to dark mode;
- confirm English uses the standard dark wave and `zh-CN` / `zh-TW` use the
- 30-frame Chinese GIF. Move the pointer over the mascot and confirm its
- cadence and geometry do not change. Enable reduced motion and confirm each
- locale/theme combination shows its matching still first frame. 4) Inspect
- the docked composer, footer Settings and Plugins icons, and session-create
- controls. 5) Open Settings and the composer input.
+- **Preconditions**: App running in both English and zh-CN locales, with an
+ empty home and a docked transcript available.
+- **Steps**: 1) Inspect the expanded and collapsed sidebar. 2) Inspect the
+ empty-home hero and docked composer. 3) Observe the eight-frame mascot GIF
+ looping in place, move the pointer over it, and confirm its cadence and
+ geometry do not change. Enable reduced motion and confirm the still first
+ frame is shown. 4) Focus the footer Settings and Plugins icons, then each
+ project/Temporary session create control. 5) Open Settings and the composer
+ input.
- **Expected**: Visible shell identity reads `PI-Desktop`; the empty-home hero
- renders the theme- and locale-matching 100px `HomeMascotLogo` GIF. Only dark
- Chinese locales use the supplied 30-frame artwork; other combinations keep
- their existing variants. Pointer hover does not alter cadence or geometry,
+ renders the theme-matching 100px `HomeMascotLogo` GIF with a short idle hold
+ and a looping wave. Pointer hover does not alter the cadence or geometry,
and reduced motion shows the matching still first frame.
The expanded/collapsed
sidebar renders the derived `src/assets/brand/logo-*.png` asset through `BrandLogo`
@@ -5288,21 +5271,17 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
and inspect the light eight-frame `HomeMascotLogo` GIF in the empty-home
hero. Hover the mascot and verify that its cadence does not change.
3. Switch the theme to dark (Settings → Basics → Appearance, or system appearance change).
- 4. In English, confirm the standard dark GIF. Switch the app language to
- `zh-CN` and `zh-TW` and confirm the 30-frame Chinese dark GIF appears
- without a reload. Enable reduced motion and confirm the matching Chinese
- still frame appears.
+ 4. Re-inspect the same surfaces without reloading.
5. Switch back to light and re-inspect.
- **Expected**:
- Light and dark mode render `src/assets/brand/logo-light.png` /
`src/assets/brand/logo-dark.png`
live in the sidebar and startup splash without a window reload.
- - The empty-home hero renders the 100px mascot GIF for the active theme and
- locale. Light mode uses `home-mascot-light.gif`; dark mode uses
- `home-mascot-dark.gif`, except Chinese locales use
- `home-mascot-dark-zh.gif`. Theme and language changes swap the asset live
- without a window reload. Pointer hover does not change cadence; reduced
- motion shows the matching still first frame.
+ - The empty-home hero renders the 100px eight-frame mascot GIF for the
+ active theme (`home-mascot-light.gif` / `home-mascot-dark.gif`) with a
+ short idle hold and a looping wave. Switching theme swaps the pair live
+ without a window reload. Pointer hover does not change the cadence;
+ under reduced motion the matching still first frame remains visible.
- Sizes stay stable across theme changes (sidebar 20px, hero 100px, splash
64px), and the marks stay decorative with no click, keyboard, or focus
behavior.
@@ -8778,12 +8757,11 @@ This test plan spec is accepted when:
row, with no Logo/Home brand or back/forward buttons.
### US-UI-17 PI-Desktop home hero logo
-- On empty chat home, the 100px `HomeMascotLogo` renders above the title.
- Light mode and non-Chinese dark mode use the existing eight-frame GIFs;
- dark `zh-CN` and `zh-TW` use the 30-frame Chinese GIF and matching still.
-- Theme and locale changes select the matching art without a reload. Pointer
- hover does not change cadence or geometry; reduced motion shows the matching
- still first frame. The mascot remains decorative.
+- On empty chat home, the 100px `HomeMascotLogo` GIF renders above the title
+ as an eight-frame waving mascot with a short idle hold. Light and dark
+ themes each use a dedicated GIF and still PNG.
+- Pointer hover does not change the cadence or geometry; reduced motion shows
+ the matching still first frame. The mascot remains decorative.
- Title is 28px / weight 400; active project name uses dotted underline (1px, offset 4px).
- Composer does not render attachment or appshot controls before their payload
reaches pi end to end.
diff --git a/docs/zh-CN/spec/04-ux/07-ui-design-system.md b/docs/zh-CN/spec/04-ux/07-ui-design-system.md
index 62c0313c6..4f68a3591 100644
--- a/docs/zh-CN/spec/04-ux/07-ui-design-system.md
+++ b/docs/zh-CN/spec/04-ux/07-ui-design-system.md
@@ -104,11 +104,11 @@ PI-Desktop 的行为类似于桌面应用程序 shell,因此意外拖动
和 NSIS 快捷方式标识保持一致,以便本机通知,
通知设置和任务栏组将应用程序标识为 `PI-Desktop`
而不是 Electron。
-- 空首页英雄使用 100px 的 `HomeMascotLogo` GIF。浅色模式和非中文深色
- 模式继续使用标准八帧挥手动画;深色模式下,根元素 `lang` 以 `zh` 开头
- 的中文环境使用提供的 30 帧透明 GIF。减少动态效果时切换为对应首帧,
- 槽位仍为 100px。播放由 GIF 自身完成,没有随机姿势、JavaScript 定时器
- 或悬停加速。
+- 空首页英雄使用 100px 的 `HomeMascotLogo` GIF:由浅色和深色八帧挥手
+ 动作合成,首帧短暂停留后循环播放。CSS 根据
+ `document.documentElement[data-theme]` 选择对应资源,非 `light` 时使用
+ 深色稿。播放由 GIF 自身完成,没有随机姿势、JavaScript 定时器或悬停
+ 加速。减少动态效果时切换为对应首帧 PNG,槽位仍为 100px。
`BrandLogo` 在 expanded/collapsed 侧边栏中保留 20px/18px,在
启动水花。 Composer 提示行不呈现领先品牌图标
在主模式或线程对接模式下。
@@ -770,9 +770,10 @@ Toast enter/exit 保留现有移除合同(`animationend` 于
控件仅保留图标并使用语义悬停清洗
- 空英雄标题使用`var(--ds-text-primary)`(轻覆盖`#1a1c1f`);
切勿对共享英雄样式的浅色墨水进行硬编码
-- 空置房屋品牌保持安静:100 像素的吉祥物 GIF 是唯一的动画英雄标记。
- 标准浅色和深色版本保留八帧挥手动画;深色中文环境使用 30 帧透明版本。
- 指针悬停不改变节奏;减少动态效果时显示对应静止首帧。
+- 空置房屋品牌保持安静:100 像素的八帧吉祥物 GIF 是唯一的
+ 动画英雄标记。浅色和深色主题各使用一套资源。它循环一段短挥手
+ 并在首帧稍作停留,因此输入框仍然是主要的任务表面。指针悬停
+ 不改变节奏;减少运动时显示对应静止首帧。
- 夜间家庭输入框板样式**仅限黑暗范围**(高架主
`#212121f5` + 标准标高-突出)
- 空草稿行保持 **一条可见线/28 像素光学最小值**,因此
diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.md
index 132bfe680..e2ba61a53 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -497,12 +497,12 @@ Collapsed (48px):
64 px 启动画面;ADR 0125)。该组件订阅了
`document.documentElement[data-theme]` 通过 `MutationObserver` 并交换
运行时侧边栏和启动画面的源代码,无需重新加载。的
- 空屋英雄在 100 像素槽位使用 `HomeMascotLogo`。标准浅色和深色 GIF
- 保留八帧挥手动画,并各有对应静止 PNG。根元素 `lang` 以 `zh` 开头且
- 主题为深色时,CSS 会选择提供的 30 帧透明中文 GIF 及对应静止 PNG。
- 主题和语言变化无需重新加载即可生效。播放由 GIF 自身完成,指针悬停
- 不改变节奏;减少动态效果时显示对应静止图。展开和折叠侧边栏仍分别
- 使用 20px/18px 图标,启动画面仍为 64px。
+ 空屋英雄在 100 像素处使用 `HomeMascotLogo` 八帧 GIF。浅色和深色主题
+ 各有一套 GIF 和静止 PNG。CSS 跟随 `document.documentElement[data-theme]`,
+ 无需重新加载;非 `light` 时使用深色稿。吉祥物循环一段处理后的挥手
+ 动作,并在首帧稍作停留。播放由 GIF 自身完成,指针悬停不改变节奏;
+ 减少运动时切换为对应静止首帧 PNG。这
+expanded/collapsed 侧边栏仍为 20px/18px 且启动画面为 64 像素。
主目录和线程停靠的输入框提示行不会呈现领先品牌
图标。
- 项目和临时会话创建控件呈现专用
diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 33c210237..49cde897f 100644
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@ -1784,19 +1784,17 @@ task-candidate E2E 从请求工作树运行,但使用主工作区已经准备
#### E2E-046:PI-Desktop 渲染器品牌和输入框图标边界
-- **先决条件**:应用程序分别以英语、`zh-CN` 和 `zh-TW` 运行,并带有
- 空首页和可用的停靠成绩单。
-- **步骤**:1) 检查展开和折叠的侧边栏。 2) 在浅色模式检查英语和中文
- 空首页。 3) 切换到深色模式,确认英语使用标准深色动画,`zh-CN` 和
- `zh-TW` 使用 30 帧中文 GIF。将指针移到吉祥物上,确认节奏和几何形状
- 不变。开启减少动态效果,并确认每种语言和主题组合都显示对应静止图。
- 4)检查停靠输入框、页脚设置和插件
+- **先决条件**:应用程序在英语和中中文语言环境中运行,并带有
+ 空荡荡的家和可用的停靠成绩单。
+- **步骤**:1) 检查展开和折叠的侧边栏。 2) 检查
+ 空荡荡的英雄和停靠的输入框。 3) 观察八帧吉祥物 GIF 原地循环,
+ 将指针移到其上并确认节奏与几何形状不变。开启减少动态
+ 效果并确认显示静止首帧。 4)关注页脚设置和插件
图标,然后每个 project/Temporary 会话创建控件。 5)打开设置
和输入框输入。
-- **预期**:可见 shell 标识为 `PI-Desktop`;空首页英雄渲染与主题和语言
- 匹配的 100px `HomeMascotLogo` GIF。只有深色中文环境使用提供的 30 帧
- 动画,其他组合保留原资源。指针悬停不改变节奏或几何形状,减少动态
- 效果时显示对应静止首帧。
+- **预期**:可见 shell 标识为 `PI-Desktop`;空荡荡的家英雄
+ 渲染与当前主题匹配的 100px `HomeMascotLogo` GIF,首帧短暂停留后循环挥手;
+ 指针悬停不改变节奏或几何形状,减少运动时显示对应静止首帧。
expanded/collapsed
侧边栏通过 `BrandLogo` 呈现派生的 `src/assets/brand/logo-*.png` 资源
并且停靠的输入框提示行没有前导
@@ -3255,18 +3253,16 @@ IPC 请求无法关闭。
并检查空首页英雄中的浅色八帧 `HomeMascotLogo` GIF。
将鼠标悬停在吉祥物上并验证节奏不变。
3. 将主题切换为深色(设置→基础→外观,或系统外观更改)。
- 4. 确认英语使用标准深色 GIF;将应用语言切换为 `zh-CN` 和 `zh-TW`,
- 确认无需重新加载即可显示 30 帧中文深色 GIF。开启减少动态效果,
- 确认显示对应的中文静止图。
+ 4. 重新检查相同的表面,无需重新加载。
5. 切换回光源并重新检查。
- **预期**:
- 明暗模式渲染 `src/assets/brand/logo-light.png` /
`src/assets/brand/logo-dark.png`
位于侧边栏和启动画面中,无需重新加载窗口。
- - 空首页英雄按当前主题和语言渲染 100 像素的吉祥物 GIF。浅色模式使用
- `home-mascot-light.gif`;深色模式使用 `home-mascot-dark.gif`,但中文
- 环境使用 `home-mascot-dark-zh.gif`。切换主题或语言时即时更换资源,
- 无需重新加载窗口。指针悬停不改变节奏;减少动态效果时显示对应静止图。
+- 空首页英雄按当前主题渲染 100 像素的八帧吉祥物 GIF
+ (`home-mascot-light.gif` / `home-mascot-dark.gif`),首帧短暂停留后
+ 循环挥手。切换主题时即时更换资源,无需重新加载窗口。指针悬停
+ 不改变节奏;减少运动时对应静止首帧仍然可见。
- 尺寸在主题变化时保持稳定(侧边栏 20 像素、英雄 100 像素、启动栏
64px),标记保持装饰性,无需点击、键盘或焦点
行为。
@@ -5604,11 +5600,11 @@ eleven-tool-round desktop paths are verified by
行,没有 Logo/Home 品牌或 back/forward 按钮。
### US-UI-17 PI-Desktop 家庭英雄标志
-- 在空聊天主页上,100px `HomeMascotLogo` 显示在标题上方。浅色模式和
- 非中文深色模式使用现有八帧 GIF;深色 `zh-CN` 和 `zh-TW` 使用 30 帧
- 中文 GIF 及对应静止图。
-- 主题和语言变化无需重新加载即可选择对应图像。指针悬停不改变节奏或
- 几何形状;减少动态效果时显示对应静止图。吉祥物保持装饰性。
+- 在空聊天主页上,100px `HomeMascotLogo` GIF 在标题上方呈现
+ 八帧挥手吉祥物,并在首帧稍作停留。浅色和深色主题各使用一套
+ GIF 和静止 PNG。
+- 指针悬停不改变节奏或几何形状;减少运动时显示对应静止
+ 首帧。吉祥物保持装饰性。
- 标题为 28px / 粗细为 400;活动项目名称使用点下划线(1 像素,偏移 4 像素)。
- Composer 不会在有效负载之前渲染附件或 appshot 控件
首尾相连达到 pi。
diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.ts
index f69e044f2..fb17bccbc 100644
--- a/packages/i18n/src/locales/de/index.ts
+++ b/packages/i18n/src/locales/de/index.ts
@@ -1452,11 +1452,6 @@ sklm: {
"feedback": "Ein Problem melden",
"feedbackDesc": "Öffnet GitHub mit Ihrer ausgefüllten Version.",
"openFeedback": "Öffnen Sie GitHub",
- "easterEggs": "Ostereier",
- "midAutumnEgg": "Mondfest-Osterei",
- "midAutumnEggDesc": "Eine bildschirmfüllende Mondfest-Animation, die beim Start der App einmal abgespielt wird; hier können Sie sie erneut abspielen.",
- "playMidAutumnEgg": "Abspielen",
- "closeEasterEgg": "Schließen",
"developer": "Entwickler",
"developerMode": "Entwicklermodus",
"developerModeDesc": "Aktivieren Sie Entwicklertools und F12.",
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index 2620018d7..5697a1a32 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -1471,11 +1471,6 @@ sklm: {
feedback: "Report a problem",
feedbackDesc: "Opens GitHub with your version filled in.",
openFeedback: "Open GitHub",
- easterEggs: "Easter eggs",
- midAutumnEgg: "Mid-Autumn egg",
- midAutumnEggDesc: "A full-screen Moon Festival animation that plays once when the app opens; replay it here.",
- playMidAutumnEgg: "Play",
- closeEasterEgg: "Close",
developer: "Developer",
developerMode: "Developer mode",
developerModeDesc: "Enable developer tools and F12.",
diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.ts
index a2ee1d441..6fc256979 100644
--- a/packages/i18n/src/locales/es/index.ts
+++ b/packages/i18n/src/locales/es/index.ts
@@ -1452,11 +1452,6 @@ sklm: {
"feedback": "Informar un problema",
"feedbackDesc": "Abre GitHub con su versión completa.",
"openFeedback": "Abrir GitHub",
- "easterEggs": "Huevos de Pascua",
- "midAutumnEgg": "Huevo del Festival del Medio Otoño",
- "midAutumnEggDesc": "Una animación a pantalla completa del Festival del Medio Otoño que se reproduce una vez al abrir la aplicación; puedes volver a reproducirla aquí.",
- "playMidAutumnEgg": "Reproducir",
- "closeEasterEgg": "Cerrar",
"developer": "Desarrollador",
"developerMode": "Modo desarrollador",
"developerModeDesc": "Habilitar herramientas de desarrollador y F12.",
diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.ts
index 52b1b5de1..2dc5a0780 100644
--- a/packages/i18n/src/locales/fr/index.ts
+++ b/packages/i18n/src/locales/fr/index.ts
@@ -1452,11 +1452,6 @@ sklm: {
"feedback": "Signaler un problème",
"feedbackDesc": "Ouvre GitHub avec votre version renseignée.",
"openFeedback": "Ouvrez GitHub",
- "easterEggs": "Œufs de Pâques",
- "midAutumnEgg": "Œuf de la Fête de la mi-automne",
- "midAutumnEggDesc": "Une animation en plein écran de la Fête de la mi-automne qui se joue une fois à l'ouverture de l'application ; vous pouvez la relancer ici.",
- "playMidAutumnEgg": "Lire",
- "closeEasterEgg": "Fermer",
"developer": "Développeur",
"developerMode": "Mode développeur",
"developerModeDesc": "Activez les outils de développement et F12.",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index 29337c9f7..a50491373 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -1469,11 +1469,6 @@ sklm: {
feedback: "문제 신고",
feedbackDesc: "버전 정보가 입력된 GitHub 페이지를 엽니다.",
openFeedback: "GitHub 열기",
- easterEggs: "이스터 에그",
- midAutumnEgg: "추석 이스터 에그",
- midAutumnEggDesc: "앱을 열 때 한 번 재생되는 전체 화면 추석 애니메이션이며, 여기서 다시 재생할 수 있습니다.",
- playMidAutumnEgg: "다시 재생",
- closeEasterEgg: "닫기",
developer: "개발자",
developerMode: "개발자 모드",
developerModeDesc: "개발자 도구와 F12를 활성화합니다.",
diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.ts
index 016e07a15..9f6096c17 100644
--- a/packages/i18n/src/locales/pt-BR/index.ts
+++ b/packages/i18n/src/locales/pt-BR/index.ts
@@ -1414,11 +1414,6 @@ export const ptBR = {
feedback: "Relatar um problema",
feedbackDesc: "Abra uma issue no GitHub com diagnósticos opcionais.",
openFeedback: "Abrir GitHub",
- easterEggs: "Ovos de Páscoa",
- midAutumnEgg: "Ovo do Festival do Meio do Outono",
- midAutumnEggDesc: "Uma animação em tela cheia do Festival do Meio do Outono que é reproduzida uma vez ao abrir o aplicativo; você pode reproduzi-la novamente aqui.",
- playMidAutumnEgg: "Reproduzir",
- closeEasterEgg: "Fechar",
developer: "Desenvolvedor",
developerMode: "Modo de desenvolvedor",
developerModeDesc: "Habilita logs adicionais, painéis de depuração e inspeção.",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index 0b550ae9c..103349c12 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -1459,11 +1459,6 @@ sklm: {
feedback: "Sorun bildir",
feedbackDesc: "Sürümünüz doldurulmuş olarak GitHub’ı açar.",
openFeedback: "GitHub’ı aç",
- easterEggs: "Sürprizler",
- midAutumnEgg: "Sonbahar Ortası sürprizi",
- midAutumnEggDesc: "Uygulama açıldığında bir kez oynatılan tam ekran Sonbahar Ortası (Ay Festivali) animasyonu; buradan yeniden oynatabilirsiniz.",
- playMidAutumnEgg: "Oynat",
- closeEasterEgg: "Kapat",
developer: "Geliştirici",
developerMode: "Geliştirici kipi",
developerModeDesc: "Geliştirici araçlarını ve F12’yi aç.",
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index c2d3ddc13..e0121bc56 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -1439,11 +1439,6 @@ sklm: {
feedback: "问题反馈",
feedbackDesc: "在 GitHub 提交问题,并自动带上当前版本。",
openFeedback: "打开 GitHub",
- easterEggs: "彩蛋",
- midAutumnEgg: "中秋彩蛋",
- midAutumnEggDesc: "应用启动时播放一次的全屏中秋动画,可在此再次播放。",
- playMidAutumnEgg: "再播一次",
- closeEasterEgg: "关闭",
developer: "开发者",
developerMode: "开发者模式",
developerModeDesc: "启用开发者工具和 F12。",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index b7146353c..ede7e12de 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -1439,11 +1439,6 @@ sklm: {
feedback: "問題反饋",
feedbackDesc: "在 GitHub 提交問題,並自動帶上當前版本。",
openFeedback: "開啟 GitHub",
- easterEggs: "彩蛋",
- midAutumnEgg: "中秋彩蛋",
- midAutumnEggDesc: "應用程式啟動時播放一次的全螢幕中秋動畫,可在此再次播放。",
- playMidAutumnEgg: "再播一次",
- closeEasterEgg: "關閉",
developer: "開發者",
developerMode: "開發者模式",
developerModeDesc: "啟用開發者工具和 F12。",