Merge pull request #41 from ClovertaTheTrilobita/dev
Some checks are pending
Sync and Deploy Astro Blog / sync-blog-content (push) Waiting to run
Sync and Deploy Astro Blog / build-and-deploy (push) Blocked by required conditions
Sync and Deploy Astro Blog / manual-deploy (push) Waiting to run

fix header
This commit is contained in:
ClovertaTheTrilobita 2026-09-17 19:00:36 +08:00 committed by GitHub
commit 8ce67232e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,6 +186,12 @@ const publishedDate = new Intl.DateTimeFormat(
const content = document.querySelector<HTMLElement>(".post-content"); const content = document.querySelector<HTMLElement>(".post-content");
if (!bar || !content) return; if (!bar || !content) return;
// Keep the fixed progress bar outside Astro's animated page container.
// Otherwise the header's transformed compositor layer can paint above it.
if (bar.parentElement !== document.body) {
document.body.appendChild(bar);
}
const updateProgress = () => { const updateProgress = () => {
const contentTop = content.getBoundingClientRect().top + window.scrollY; const contentTop = content.getBoundingClientRect().top + window.scrollY;
const readableDistance = Math.max( const readableDistance = Math.max(