@fluritheme/fluri
Version:
Interactive snowfall for websites: DOM-aware snow accumulation, mouse interactions, snow physics, Canvas 2D rendering, and Christmas effects.
43 lines • 1.43 kB
TypeScript
import type { PluginContext, Surface, Vec2, YetiPhase } from '../types.js';
export interface YetiTarget extends Vec2 {
support: Surface;
localX: number;
}
export interface YetiWorld {
targets(): YetiTarget[];
gather(surface: Surface, x: number, radius: number, mass: number): number;
hit(from: Vec2, to: Vec2, radius: number, vx: number): boolean;
}
/** A single visitor, one real snowball, and a bounded state machine. No timers or DOM nodes. */
export declare class Yeti {
private readonly context;
private readonly world;
phase: YetiPhase;
private support;
private x;
private age;
private elapsed;
private held;
private facing;
private wait;
private projectile;
private target;
constructor(context: PluginContext, world: YetiWorld);
get state(): Readonly<{
phase: YetiPhase;
x: number;
y: number;
mass: number;
flying: boolean;
}>;
private point;
private change;
spawn(preferred?: Surface): void;
private spill;
clear(recycle?: boolean): void;
update(dt: number): void;
render(ctx: CanvasRenderingContext2D): void;
}
/** Original vector artwork: furry silhouette, mittens, tiny horns and expressive poses. */
export declare function drawYeti(ctx: CanvasRenderingContext2D, phase: YetiPhase, elapsed: number, age: number, ball: number): void;
//# sourceMappingURL=Yeti.d.ts.map