Initial commit

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
fish03
2026-09-23 14:43:16 +07:00
co-authored by Claude Opus 5.5
commit bef9f8b4ed
663 changed files with 81305 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
(function () {
function setupRoot(root) {
var track = root.querySelector(".square-promo__track");
var group = root.querySelector(".square-promo__group");
if (!track || !group) return;
var clone = root.querySelector(".square-promo__group--clone");
if (clone) clone.remove();
root.classList.remove("is-marquee");
track.style.animationDuration = "";
if (group.scrollWidth <= root.clientWidth + 1) return;
clone = group.cloneNode(true);
clone.classList.add("square-promo__group--clone");
clone.setAttribute("aria-hidden", "true");
clone.querySelectorAll("a").forEach(function (link) {
link.setAttribute("tabindex", "-1");
});
track.appendChild(clone);
root.classList.add("is-marquee");
track.style.animationDuration =
Math.max(18, Math.round(group.scrollWidth / 36)) + "s";
if (typeof window.initLazyImages === "function") {
window.initLazyImages(clone);
}
}
function setupAll() {
document.querySelectorAll("[data-square-promo]").forEach(setupRoot);
}
var resizeTimer = 0;
function onResize() {
window.clearTimeout(resizeTimer);
resizeTimer = window.setTimeout(setupAll, 160);
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", setupAll, { once: true });
} else {
setupAll();
}
window.addEventListener("resize", onResize);
})();