Repository navigation
fix: 降低页面转场与滚动动画的布局开销 - #58
Closed
cursor[bot] wants to merge 3 commits into
Closed
cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
瞬态页超过 1200 个节点,或偏好减少动态效果时,不再克隆滚动区,导航直接切换。只改 query 或 hash 时清掉尚未使用的快照,避免下一次离场贴上过期画面。 Co-authored-by: zilorn <[email protected]>
滚动条拇指用 translate 定位,高度只在变化时写入。开关滑块改为 translate,章节进度圆球用 transform,高亮用 clip-path,并按轨道 1px 边框修正右端。 Co-authored-by: zilorn <[email protected]>
折页渐变按方向在开始时写一次,阴影和折痕改为 transform。分段控件只过渡背景、文字和阴影,字重变化不再参与过渡。 Co-authored-by: zilorn <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决的问题 / Problem
Fixes #56
长页面离场会克隆整页滚动区并重新布局,自定义滚动条、开关、章节进度条和折页动画逐帧写
top/left/width等布局属性,滚动和路由切换时掉帧。分段控件的transition-all还会把字重变化算进过渡。改动后的行为 / Resulting behavior
prefers-reduced-motion也不再克隆、不播放转场。只改 query / hash 时清掉尚未使用的快照。translate定位,高度只在变化时写入。开关滑块改为translate,章节进度圆球用transform,高亮用clip-path,并按轨道 1px 边框修正右端。transform/opacity/clip-path。打断收尾与目标屏图片复用语义不变。验证 / Validation
pnpm exec tsc --noEmit通过pnpm run i18n:check通过pnpm build通过node scripts/reader-page-turn-test.mjs、reader-position-transition-test.mjs、desktop-page-title-test.mjs、reader-auto-page-test.mjs通过pnpm dev):书架来源开关在translateX(20px)与translateX(0)之间切换,不写left;主题分段的transition-property为background-color, color, box-shadow,选中后补上背景与字重类。连续滚动 25 帧,拇指未写top,高度只出现一个值,位置走translate。prefers-reduced-motion下克隆 0 次。桌面宽度下侧栏、主题分段和开关仍在。数据与兼容性 / Data and compatibility
不涉及 / N/A。未改持久化格式、路由或书源引擎。
提交前检查 / Checklist