Use standard form buttons and resume entrance effects in 1.10.1
CMS quality / php (8.2) (push) Canceled after 0s
CMS quality / php (8.4) (push) Canceled after 0s
CMS quality / browser (push) Canceled after 0s
CMS quality / mysql (push) Canceled after 0s

This commit is contained in:
kantarci committed 2026-09-14 15:22:42 +02:00
1 parent f182f9e125
commit cff468167b
12 files changed
+161 -12

No files matched your search

+13 -4
View File
@@ -26,10 +26,19 @@ export function initMotion(doc = document) {
const observer = new view.IntersectionObserver(entries => {
for (const entry of entries) if (entry.isIntersecting) { show(entry.target); observer.unobserve(entry.target); }
}, { threshold: 0, rootMargin: '0px 0px -24px 0px' });
if (!preference.matches) nodes.forEach(node => observer.observe(node));
const reduce = () => { if (preference.matches) { observer.disconnect(); animations.forEach(animation => animation.cancel()); } };
preference.addEventListener('change', reduce);
return () => { observer.disconnect(); animations.forEach(animation => animation.cancel()); preference.removeEventListener('change', reduce); };
const syncPreference = () => {
if (preference.matches) {
observer.disconnect();
animations.forEach(animation => animation.cancel());
} else {
// Reduction may have been active at startup or enabled during this visit.
// Resume observing unseen content when movement is allowed again.
nodes.forEach(node => { if (!seen.has(node)) observer.observe(node); });
}
};
preference.addEventListener('change', syncPreference);
syncPreference();
return () => { observer.disconnect(); animations.forEach(animation => animation.cancel()); preference.removeEventListener('change', syncPreference); };
}
if (!document.querySelector('#editor')) initMotion();