UNPKG

fluid-pointer-react

Version:

A dependency-free fluid simulation component with WebGL-based physics - supports both vanilla web components and React

47 lines (39 loc) 2 kB
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [1.0.0] - 2025-01-16 ### Added - Initial release of fluid-pointer component library - Vanilla web component implementation with WebGL-based fluid simulation - React component wrapper with full TypeScript support - Dual package exports supporting both web component and React usage - Comprehensive prop interface for React component - Imperative API through React refs (play, pause, reset, addSplat, addRandomSplats) - Event callbacks for React (onFluidReady, onFluidSplat, etc.) - Quality presets for easy configuration (low, medium, high, ultra) - Multiple color modes (rainbow, monochrome, custom) - Responsive sizing and aspect ratio support - CSS styling options and custom style prop support - Interactive demo application - Comprehensive documentation and usage examples ### Features - **Zero external dependencies** (except React peer dependency for React component) - **WebGL-based physics simulation** with realistic fluid dynamics - **Customizable visual effects** including shading, color transitions, and curl - **Interactive controls** with mouse and touch support - **Performance optimized** with configurable quality settings - **TypeScript support** with full type definitions - **Accessibility features** including reduced motion support - **Cross-browser compatibility** with WebGL fallbacks ### Technical Details - Built with TypeScript and Vite - Supports ES modules and UMD formats - React 16.8+ compatibility (hooks-based) - WebGL 1.0/2.0 support with automatic fallbacks - Responsive design with ResizeObserver integration - Memory-efficient with proper cleanup on unmount ### Package Exports - `fluid-pointer` - Vanilla web component - `fluid-pointer/react` - React component - `fluid-pointer/css` - Optional CSS styles