迁移A04为自适应文档流

This commit is contained in:
rain
2026-07-21 11:49:46 +08:00
parent 5a86803f9b
commit a28678ca0b
3 changed files with 70 additions and 76 deletions
+3
View File
@@ -83,6 +83,7 @@ const run = async () => {
const header = document.querySelector('.auth-shell__header')
const headerImage = document.querySelector('.auth-shell__header-image img')
const paper = document.querySelector('.auth-shell__paper')
const title = document.querySelector('.page-title')
const loginEntry = document.querySelector('.login-entry')
return {
width: document.documentElement.scrollWidth,
@@ -93,6 +94,7 @@ const run = async () => {
headerNaturalWidth: headerImage?.naturalWidth,
headerNaturalHeight: headerImage?.naturalHeight,
paperTop: paper?.getBoundingClientRect().top,
titleCenter: title ? title.getBoundingClientRect().left + title.getBoundingClientRect().width / 2 : null,
loginEntryBottom: loginEntry?.getBoundingClientRect().bottom + window.scrollY
}
})()`)
@@ -100,6 +102,7 @@ const run = async () => {
assert.deepStrictEqual([metrics.headerNaturalWidth, metrics.headerNaturalHeight], [824, 340], `A04 header asset changed at ${size.width}x${size.height}`)
assert(Math.abs(metrics.headerImageHeight / metrics.headerImageWidth - 340 / 824) < 0.01, `A04 header is distorted at ${size.width}x${size.height}`)
assert(metrics.paperTop >= metrics.headerBottom - 1, `A04 paper overlaps its header at ${size.width}x${size.height}`)
assert(Math.abs(metrics.titleCenter - size.width / 2) <= 1, `A04 title is not centered at ${size.width}x${size.height}: ${metrics.titleCenter}`)
assert(metrics.loginEntryBottom <= metrics.documentScrollHeight + 1, `A04 last action is unreachable at ${size.width}x${size.height}`)
}