wordpress.nix zieht die echten Elementor-CSS-Dateien (Kit, Widget-Styles) von hausdermaterialisierung.org per fetchurl statt der Plugin-Defaults; hdm-header-footer.php dequeued die Defaults zugunsten dieser CSS und entfernt wpautop für migrierten Elementor-Content. Neue hdm-scroll-animations.js/hdm-visual.css bilden Elementors Motion-Effects (pulse/jello/bounceInDown/swing/tada) als IntersectionObserver-Fallback nach, da Elementor Pro nicht lizenziert ist. Auf blunix aktiviert und live geprüft (Kit-13-Zuordnung, Medien-404-Sweep, Animationen Desktop/ Mobil bestätigt); zwei absolut positionierte Deko-Elemente bleiben ohne Elementors Offset-JS unsichtbar, offener Folgepunkt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UyB72YNyCNXwVxCTgfnXCp
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
(() => {
|
|
const supported = new Set(["pulse", "jello", "bounceInDown", "swing", "tada"]);
|
|
|
|
const reveal = (element) => {
|
|
let settings = {};
|
|
try {
|
|
settings = JSON.parse(element.dataset.settings || "{}");
|
|
} catch (_error) {
|
|
return;
|
|
}
|
|
|
|
const animation = settings._animation;
|
|
if (!supported.has(animation)) {
|
|
return;
|
|
}
|
|
|
|
element.classList.remove("elementor-invisible");
|
|
element.classList.add("hdm-animation-fallback", `hdm-${animation}`);
|
|
};
|
|
|
|
window.addEventListener("load", () => {
|
|
const pending = [...document.querySelectorAll(".elementor-invisible[data-settings]")];
|
|
if (!pending.length) {
|
|
return;
|
|
}
|
|
|
|
if (!("IntersectionObserver" in window)) {
|
|
pending.forEach(reveal);
|
|
return;
|
|
}
|
|
|
|
const observer = new IntersectionObserver((entries) => {
|
|
for (const entry of entries) {
|
|
if (entry.isIntersecting) {
|
|
reveal(entry.target);
|
|
observer.unobserve(entry.target);
|
|
}
|
|
}
|
|
}, { rootMargin: "0px 0px -8%", threshold: 0.05 });
|
|
|
|
pending.forEach((element) => observer.observe(element));
|
|
});
|
|
})();
|