mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-17 20:01:33 +02:00
perf: optimize katex config, implement async css loading for katex, improve scrollbar and lightbox loading logic
This commit is contained in:
parent
625879b061
commit
979f36a796
6 changed files with 66 additions and 60 deletions
|
@ -53,11 +53,13 @@ function setupPhotoSwipe() {
|
|||
}
|
||||
|
||||
function lazySetupPhotoSwipe() {
|
||||
if ('requestIdleCallback' in window) {
|
||||
if (typeof window.requestIdleCallback === 'function') {
|
||||
window.requestIdleCallback(() => setupPhotoSwipe(), { timeout: 1000 })
|
||||
}
|
||||
else {
|
||||
setTimeout(setupPhotoSwipe, 100)
|
||||
requestAnimationFrame(() => {
|
||||
setupPhotoSwipe()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue