mAi: #7 - Mobile-Gating: Touch-Fix nur unter 768px

CSS touch-action: pan-y und JS-Listener-Scope (wrapper statt hero,
ohne preventDefault) jetzt explizit per @media / matchMedia auf
max-width: 768px begrenzt. Über 768px bleibt das ursprüngliche
Verhalten erhalten — touchmove auf .hero mit preventDefault, falls
Touch-Hardware im Desktop-Layout im Spiel ist.
This commit is contained in:
mAi
2026-04-27 20:08:25 +02:00
parent 66d0203f55
commit 095ed0fccf

View File

@@ -93,7 +93,9 @@
margin: 0 auto 40px;
display: flex; justify-content: center;
padding: 60px 40px;
touch-action: pan-y;
}
@media (max-width: 768px) {
.text3d-wrapper { touch-action: pan-y; }
}
.text3d {
@@ -686,9 +688,16 @@
}
hero.addEventListener('mousemove', function(e) { handleMove(e.clientX, e.clientY); });
if (window.matchMedia('(max-width: 768px)').matches) {
wrapper.addEventListener('touchmove', function(e) {
handleMove(e.touches[0].clientX, e.touches[0].clientY);
}, {passive: true});
} else {
hero.addEventListener('touchmove', function(e) {
e.preventDefault();
handleMove(e.touches[0].clientX, e.touches[0].clientY);
}, {passive: false});
}
hero.addEventListener('mouseleave', function() {
text.style.animation = '';
text.style.transform = '';