UNPKG

balloons-js

Version:

Animated balloons effect for your website

43 lines (42 loc) 1.29 kB
export declare enum StringLightVariant { CLASSIC = "classic", LED = "led", MODERN_LED = "modern-led" } export declare class StringLights { canvas: HTMLCanvasElement; private ctx; private points; private mousePos; private prevMousePos; private animationFrameId?; private readonly SEGMENTS; private readonly CONSTRAINT_ITERATIONS; private readonly GRAVITY; private readonly DAMPING; private readonly MOUSE_INFLUENCE; private readonly MOUSE_RADIUS; private readonly ANGULAR_DAMPING; private readonly FLICKER_THRESHOLD; private readonly FLICKER_CHANCE; private isPowered; private readonly yPosition; private readonly variant; constructor(canvas: HTMLCanvasElement, yPosition?: number, variant?: StringLightVariant); private setCanvasSize; private initializePoints; private updatePoints; private constrainPoints; private updateBulbPhysics; private updateBulbFlicker; private drawFixturePoint; private draw; private setupEventListeners; private handleMouseMove; handleResize: () => void; destroy(): void; togglePower(): void; private drawClassicBulb; private drawLEDBulb; private drawModernLEDBulb; }