upload all

This commit is contained in:
zibright
2025-06-24 13:03:14 +08:00
commit bc51415f2f
99 changed files with 5113 additions and 0 deletions

38
config/js/listLazyload.js Normal file
View File

@@ -0,0 +1,38 @@
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const element = entry.target;
const bgUrl = element.getAttribute('data-bg');
if (bgUrl) {
const img = new Image();
img.onload = () => {
element.style.backgroundImage = `url(${bgUrl})`;
};
img.src = bgUrl;
observer.unobserve(element);
}
}
});
}, {
// 配置项
rootMargin: '50px 0px',
threshold: 0.01
});
const lazyLoadElements = document.querySelectorAll('.AKAROMlazyload');
lazyLoadElements.forEach(element => {
observer.observe(element);
});
const styles = `
.AKAROMlazyload {
background-color: Aquamarine;
}
`;
const styleSheet = document.createElement('style');
styleSheet.textContent = styles;
document.head.appendChild(styleSheet);