Skip to content

Commit e0c619d

Browse files
disable zoom
1 parent 79883d4 commit e0c619d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

editor/pages/_app.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ function GlobalCss() {
77
return (
88
<Global
99
styles={css`
10+
html {
11+
background-color: #252526;
12+
touch-action: none;
13+
}
14+
1015
body {
1116
margin: 0px;
1217
padding: 0;
@@ -57,6 +62,17 @@ function HeadInjection() {
5762
media="(prefers-color-scheme: dark)"
5863
/>
5964

65+
{/* disable zoom */}
66+
<meta
67+
name="viewport"
68+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
69+
/>
70+
<script
71+
dangerouslySetInnerHTML={{
72+
__html: `function init() { document.body.addEventListener("wheel", (event) => {const { ctrlKey } = event; if (ctrlKey) { event.preventDefault(); return; }}, { passive: false });} window.addEventListener("DOMContentLoaded", init, false);`,
73+
}}
74+
/>
75+
6076
{/* region Google analytics */}
6177
{/* https://stackoverflow.com/a/62552263 */}
6278
<script

0 commit comments

Comments
 (0)