feat(frontend): replace lazy loading with zibll lazysizes
This commit is contained in:
1 parent
02571eecd6
commit
435ee1daa7
78 files changed
+1515
-909
No files matched your search
@@ -734,27 +734,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
// Lazy images
|
||||
root.querySelectorAll('img.aksrt-lazy[data-src]').forEach(function (img) {
|
||||
if (img.classList.contains('aksrt-loaded')) return;
|
||||
if ('IntersectionObserver' in window) {
|
||||
var obs = new IntersectionObserver(function (entries) {
|
||||
entries.forEach(function (entry) {
|
||||
if (!entry.isIntersecting) return;
|
||||
img.src = img.dataset.src;
|
||||
img.classList.remove('aksrt-lazy');
|
||||
img.classList.add('aksrt-loaded');
|
||||
obs.unobserve(img);
|
||||
});
|
||||
}, { rootMargin: '200px' });
|
||||
obs.observe(img);
|
||||
} else {
|
||||
img.src = img.dataset.src;
|
||||
img.classList.remove('aksrt-lazy');
|
||||
img.classList.add('aksrt-loaded');
|
||||
}
|
||||
});
|
||||
|
||||
// Swiper re-init
|
||||
if (typeof Swiper !== 'undefined') {
|
||||
root.querySelectorAll('[data-swiper-config]:not(.swiper-initialized)').forEach(function (el) {
|
||||
|
||||
Reference in new issue
Block a user