fix(gallery): 1.9.4 消除滚动加载时的闪动——卡片按宽高比占位 + 异步解码 + 加大预取
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 34s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 34s
闪动的来源:卡片初始只有「加载中…」那一行字的高度,缩略图一到就从一行字长成整图高, 整列跟着重排,滚动时看起来就是闪一下。 - itemNode:按 it.w/it.h 给卡片设 aspect-ratio,占位阶段就占好最终高度;有宽高时占位文案不写「加载中…」 - styles.css:占位层 absolute inset:0 铺满卡片(否则卡片高了、占位还是 84px 的小框) - img 插入后调用 decode(),解码不占主线程 - 预取范围从 0.8/1.8 屏提到 1.2/2.4 屏,滚动时少触发几次窗口重排
This commit is contained in:
1 parent
b2bcc07cb5
commit
89bb19beab
4 files changed
+16
-10
No files matched your search
@@ -80,6 +80,8 @@
|
||||
border-color: var(--iwb-hover-border, var(--iwb-brand));
|
||||
box-shadow: var(--iwb-hover-shadow, 0 5px 16px rgba(0, 0, 0, .22));
|
||||
}
|
||||
/* v1.9.4:卡片按宽高比占位后,占位层要铺满卡片 —— 否则缩略图出现时仍会有一次高度跳变(滚动时表现为闪动) */
|
||||
.iwb-history-embedded .iwb-history-item .iwb-history-missing { position: absolute; inset: 0; min-height: 0; }
|
||||
.iwb-history-missing {
|
||||
display: flex; align-items: center; justify-content: center; text-align: center;
|
||||
min-height: 84px; padding: 8px; border-radius: 6px; border: 1px dashed var(--iwb-border);
|
||||
|
||||
Reference in new issue
Block a user