UNPKG

@figliolia/ripples

Version:

WebGL ripples based on the clever work of Pim Schreurs

31 lines (30 loc) 875 B
import { WebGL } from "./WebGL"; export declare class Ripples extends WebGL { ID?: string; visible: boolean; running: boolean; destroyed: boolean; initialized: boolean; constructor(...options: ConstructorParameters<typeof WebGL>); drop(x: number, y: number, radius: number, strength: number): void; updateSize: () => void; show(): void; hide(): void; pause(): void; play(): void; destroy(): void; reloadImage(): Promise<void>; private cacheTargetPositions; private setupWebGL; private setupPointerEvents; private onClick; private onTouch; private onMouseMove; private get pointerEventsEnabled(); private step; private computeBackgroundSize; private computeTextureBoundaries; private translateBackgroundPosition; private restoreCSSBackground; private dropAtPointer; }