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:
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user