Skip to content

Commit

Permalink
prevent pinch-zoom events on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
blairdrivescout committed Oct 29, 2023
1 parent 03c6193 commit 8975d4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions build/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@
-webkit-filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.\[touch-action\:pan-x_pan-y\] {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
html, body {
height: 100%;
}
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h2>Your High Scores</h2>
</ol>
</div>
</section>
<div id="game-container" class="game-container sm:mx-auto">
<div id="game-container" class="game-container sm:mx-auto [touch-action:pan-x_pan-y]">
<!--start screen-->
<section id="start-screen" class="py-5">
<h2>Welcome to BlairSnake!<br>This is not your ordinary game of snake.</h2>
Expand Down Expand Up @@ -67,7 +67,7 @@ <h2 class="speed inline-block">choose your speed...</h2>
<div class="flex-1 max-sm:hidden"></div>

<!-- keypad for mobile/touch devices -->
<section class="keypad justify-center w-full p-4 pt-1">
<section class="keypad justify-center w-full p-4 pt-1 [touch-action:pan-x_pan-y]">
<div class="basis-[480px]">
<div class="grid grid-cols-6 grid-rows-2 gap-1 mb-4">
<button id="up" class="mt-0 col-span-2 col-start-3" data-key="up">&#8673;</button> <!-- up arrow -->
Expand Down

0 comments on commit 8975d4d

Please sign in to comment.