diff --git a/sites/smartin3.de/index.html b/sites/smartin3.de/index.html index 8736fe1..74eab9a 100644 --- a/sites/smartin3.de/index.html +++ b/sites/smartin3.de/index.html @@ -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); }); - wrapper.addEventListener('touchmove', function(e) { - handleMove(e.touches[0].clientX, e.touches[0].clientY); - }, {passive: true}); + 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 = '';