mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-blog.git
synced 2026-10-25 21:43:53 +00:00
Compare commits
2 commits
a40f7749cc
...
8ce67232e4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ce67232e4 | ||
| b03cf9238e |
1 changed files with 6 additions and 0 deletions
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue