@flip-engine/binding-dom
v0.1.2
Published
Web (DOM) platform binding for @flip-engine/core — CSS custom properties, pointer/keyboard wiring, rAF. The only DOM-coupled package.
Maintainers
Readme
@flip-engine/binding-dom
The web platform binding (L3) for @flip-engine/core. Implements the
four ports with CSS custom properties (output), getBoundingClientRect (measure),
requestAnimationFrame (clock) and matchMedia (env), and wires pointer +
keyboard input. The only DOM-coupled package — Angular, React and vanilla all
share it.
import { createDomBinding } from '@flip-engine/binding-dom';
import '@flip-engine/binding-dom/flip-engine.css'; // host carries the `.flip-engine` class
const binding = createDomBinding({ host, spread });
const detach = binding.connect(engine); // wires events; call detach() to tear downflip-engine.css is the shared stylesheet (scoped under .flip-engine). Import it
once, globally.
Using it directly (no framework)? The vanilla guide walks through the binding options, the render loop and the required DOM. The ports this implements are described in ports.md.
