Skip to content

feat(theme): polish P3R motion and transitions - #13

Merged
yororoA merged 2 commits into
mainfrom
feat/p3r-animation-polish
Oct 16, 2026
Merged

yororoA merged 2 commits into
mainfrom
feat/p3r-animation-polish

Conversation

@yororoA

@yororoA yororoA commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

发布介绍

这次更新对 P3R 主题的动效做了完整打磨:跨页转场会先由点击位置扩散出边缘起伏的钴蓝流体,完全覆盖后再交接路由;全屏菜单从导航按钮流体展开,并沿原轮廓收回。页面入场、场景视差和弹窗进入也统一为无回弹、分层且更接近参考画面的节奏。

主要改动

  • 新增共享流体轮廓,统一跨页 wipe 与菜单展开/收回的视觉形态
  • 路由与 onNavigate 延后到全屏覆盖完成,避免加载骨架在扩张边缘旁闪现
  • 菜单改为透明背景上的流体展开,支持 Esc、关闭按钮、中途反向收回和焦点恢复
  • 首页及页面标题增加分层入场,并与 wipe 的 covered/revealing 阶段同步
  • P3R 场景增加精确指针视差,触屏、reduced motion 和模态遮挡时自动停用
  • 博客 Modal、账号管理和声明面板改为邮件式斜面分开展示
  • 完善 reduced-motion 降级、快速连续点击与慢路由兜底
  • 补充第三轮实现与验证文档;登录水效 renderer 保持不变

验证

  • verify-polish.cjs: 16/16
  • P3R wipe 语义回归: 5/5
  • 登录流程回归: 10/10
  • 水效参考帧: 3/3
  • 首帧遮罩: 3/3
  • verify:blog: 19/19
  • TypeScript(src)、修改文件 ESLint、git diff --check 通过
  • Next.js 16.2.10 隔离生产构建 next build --webpack 通过
  • Chromium 1440 / 390 / 320px,浅色 / 深色及 reduced-motion 验证通过,无横向溢出

验证边界

  • 移动端使用 Chromium 视口模拟,未在实体手机或 Safari 上验证
  • 登录页模糊弹层下的场景视差会停用,避免不可见的重绘

Summary by Sourcery

Polish P3R navigation, menu, scene, and panel motion with coordinated fluid transitions, reliable route handoff, and accessible motion fallbacks.

New Features:

  • Add shared fluid transitions for P3R page navigation and full-screen menu interactions.
  • Add pointer-based layered parallax to P3R scenes with automatic disabling for touch, modal, and reduced-motion contexts.

Bug Fixes:

  • Delay client navigation until the transition fully covers the page, preventing loading-state flashes during route changes.
  • Improve menu dismissal behavior with animated reversal, keyboard support, focus restoration, and interrupted-transition handling.
  • Add loading and slow-route safeguards so transitions do not reveal blank or incomplete pages.

Enhancements:

  • Unify P3R entrance animations, modal presentation, and reduced-motion behavior across the site and login panels.

Documentation:

  • Document the third-round P3R motion polish, interaction timing, behavior, and validation results.

Tests:

  • Expand visual and interaction validation for transitions, menus, responsive layouts, reduced motion, routing, and parallax behavior.

Chores:

  • Preserve the existing login water renderer while retiring older P3R transition implementations from the active design guidance.

Route changes now wait until the fluid wipe fully covers the page, so loading
boundaries no longer flash beside the expanding edge. The menu floods from its
opener and drains back, page stages enter in layers, scenes follow fine
pointers in depth, and dialogs open with a mail-style split slab.
Capture the baseline problems, reference timings, implementation contract and
verification results so later rounds keep the cover-then-navigate behavior.
@vercel

vercel Bot commented Oct 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ark Ready Ready Preview Oct 16, 2026 1:40pm UTC

@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR polishes P3R motion by introducing a shared seeded fluid transition system, postponing route handoffs until coverage, rebuilding the menu around reversible opener-originated fluid clips, synchronizing layered entrances, adding modal mail-slab transitions and guarded scene parallax, and documenting the implementation and validation results.

Sequence diagram for the P3R covered route transition

sequenceDiagram
    participant User
    participant P3RLink
    participant P3REffects
    participant Router
    participant Page

    User->>P3RLink: click pathname-changing link
    P3RLink->>Router: prefetch(destination)
    P3RLink->>P3REffects: requestP3RWipe(x, y, navigate, fallback)
    P3REffects->>P3REffects: fluid cover 220ms
    P3REffects->>P3REffects: setPhase(covered)
    P3REffects->>P3RLink: navigate callback
    P3RLink->>Router: push(destination)
    Router-->>Page: route content streams
    P3REffects->>P3REffects: wait HOLD_MS / LOADING_GRACE_MS
    P3REffects->>P3REffects: setPhase(revealing)
    P3REffects->>Page: reveal fluid opening 340ms
Loading

Sequence diagram for reversible P3R menu motion

sequenceDiagram
    participant User
    participant Menu
    participant Dialog
    participant P3RScene

    User->>Menu: open menu
    Menu->>Menu: menuOrigin(opener)
    Menu->>Dialog: showModal()
    Menu->>Menu: floodMenu(opening, 420ms)
    Menu->>P3RScene: display menu scene
    alt close button, Esc, or same-page link
        User->>Menu: dismiss()
        Menu->>Dialog: set inert
        Menu->>Menu: floodMenu(closing, reach)
        Menu->>Dialog: close()
        Menu->>Menu: restore opener focus
    else cross-page link
        User->>Menu: select destination
        Menu->>Menu: requestP3RWipe()
        P3RScene->>Menu: isP3RWipeCovering()
        Menu->>Dialog: close under full wipe cover
    end
Loading

State diagram for the P3R page wipe lifecycle

stateDiagram-v2
    [*] --> idle
    idle --> expanding: requestP3RWipe
    expanding --> covered: COVER_MS elapsed
    covered --> covered: wait for route and content
    covered --> revealing: HOLD_MS and content ready
    revealing --> idle: REVEAL_MS complete
    expanding --> idle: Escape or reduced motion
    covered --> idle: Escape or page hidden
    revealing --> expanding: new pathname click
Loading

File-Level Changes

Change Details Files
Reworked P3R page transitions around a shared, seeded fluid outline and delayed route handoff.
  • Added reusable harmonic fluid geometry and canvas rendering for cover and reveal phases.
  • Deferred client navigation until full coverage, with prefetching, loading-boundary grace time, cancellation handling, and fallback timeout.
  • Exposed wipe phases to synchronize destination entrance animations and preserved reduced-motion behavior.
src/components/appearance/p3r-fluid.ts
src/components/appearance/p3r-effects.tsx
src/components/appearance/p3r-link.tsx
src/components/appearance/p3r-transition.ts
src/components/blog/route-loading.tsx
Replaced the P3R full-screen menu ring with an opener-originated fluid expansion and reversible dismissal.
  • Animated dialog and cyan rim with matching clip-path outlines derived from the shared fluid geometry.
  • Handled Escape, close controls, same-page links, interrupted opening, focus restoration, inert dismissal state, and force-close synchronization.
  • Made the menu transparent around the expanding outline and disabled its motion cleanly for reduced-motion users.
src/components/blog/p3r-navigation.tsx
src/components/blog/p3r-navigation.module.scss
src/components/blog/blog-shell.tsx
Unified P3R visual motion into layered, non-bouncy entrances and mail-style modal transitions.
  • Added staged home and page-heading entrances gated by the wipe phase.
  • Introduced shared diagonal-splitting panel motion for blog dialogs and login account/declaration panels.
  • Added reduced-motion styles that remove entrance, panel, and transition animation.
src/styles/_p3r-motion.scss
src/components/blog/_p3r-ui.scss
src/app/login/components/components.module.scss
Added conditional multi-layer pointer parallax to P3R scenes without affecting the existing login water renderer.
  • Applied depth-specific CSS translation to scene layers using rAF-smoothed fine-pointer coordinates.
  • Disabled tracking for touch, reduced motion, hidden/inert scenes, modal-obscured scenes, and heading variants.
  • Documented and retained the existing login water-effect implementation unchanged.
src/components/appearance/p3r-scene.tsx
src/components/appearance/p3r-scene.module.scss
docs/p3r-theme.md
.uicraft.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@yororoA
yororoA merged commit 06f652e into main Oct 16, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — b96997f8 Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant