DOM ENGINEV0.21.3FIZLET

TOUCH V0.21.3 BETA

@fzlt/core/touch

Taps and swipes on an animation or a game never zoom or pan the page. One delegated listener set on the document (capture, not passive) cancels, on the surfaces that match sel, what CSS touch-action can't: iOS Safari's gesturestart / gesturechange (its pinch, which ignores user-scalable=no) and any multi-touch touchstart / touchmove (a pinch anywhere else). One finger is never touched, so taps, drags and the page's own scroll stay. The CSS half lives in the Board UI kit (board-ui.css): touch-action: manipulation on the page (no double-tap zoom) and touch-action: none / pan-y plus overscroll-behavior: none on the same surfaces. Pass null to lock the whole page (a full-screen board; content pages keep pinch-zoom for WCAG 1.4.4). Returns release(): the page gets its gestures back.

@fzlt/core/touch · GZIP310 B0.3 KB of a 0.5 KB budget

Measured on this build: minified and gzipped with everything it imports, the way npm run size checks the budget in CI.

Drag the blue brick and let go to throw it.6.1 KB gz

STATUS · what the flags meanBETA

Tested and budgeted; not yet carried by a shipped game, or its API is still moving. Shipped now; COMPLETE also asks that its API has had no breaking change since it shipped, which is still to be confirmed.

SINCE
v0.20.0
SHIPPED IN
  • Null Invaders 1.0.3, Byte Runner 1.0.2 and Sherman Bytes 1.1.0 (through @fzlt/core/arcade: no page zoom while a run is live)
  • the DOM Battlefield and Battlefield Blitz sites
  • fizlet.com: every page
MODULES · hosted on this site
import { SURFACES, lockTouch } from "https://fizlet.com/dist/touch.js";
NPM · @fzlt/core
npm install @fzlt/core
import { SURFACES, lockTouch } from "@fzlt/core/touch";
IN SHORT
lockTouch(); // pinch never zooms the page from a slot, a game or the pad
lockTouch(document, null); // a full-screen board: the whole page

API

Every export with its signature, parameters, return type, doc comment and status flag, generated at build time from the published type declarations of v0.21.3 by the TypeScript compiler. For AI agents: the whole API as plain text.

SURFACES const BETA

The surfaces Fizlet draws on: slot stages, game hosts, the touch pad, draggable panels, and anything marked data-touch-lock.

Type
"[data-fizlet-slot],[data-fizlet-host],[data-touch-lock],.bui-pad,.bui-grip"
export declare const SURFACES = "[data-fizlet-slot],[data-fizlet-host],[data-touch-lock],.bui-pad,.bui-grip";

lockTouch function BETA

Lock pinch on the surfaces matching sel (null: the whole page). Returns release().

lockTouch(doc?: Document, sel?: string | null): () => void
doc?
Document optional
sel?
string | null optional
Returns
() => void
Declaration
export declare function lockTouch(doc?: Document, sel?: string | null): () => void;