own-the-canvas 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +355 -0
- package/dist/components/AudioVisualizer/AudioVisualizer.d.ts +48 -0
- package/dist/components/AudioVisualizer/AudioVisualizer.stories.d.ts +10 -0
- package/dist/components/AudioVisualizer/index.d.ts +3 -0
- package/dist/components/AudioVisualizer/useAudioVisualizer.d.ts +25 -0
- package/dist/components/Boids/Boids.d.ts +43 -0
- package/dist/components/Boids/index.d.ts +2 -0
- package/dist/components/Boids/useBoids.d.ts +22 -0
- package/dist/components/ClothSimulation/ClothSimulation.d.ts +47 -0
- package/dist/components/ClothSimulation/index.d.ts +2 -0
- package/dist/components/ClothSimulation/useClothSimulation.d.ts +24 -0
- package/dist/components/Confetti/Confetti.d.ts +51 -0
- package/dist/components/Confetti/Confetti.stories.d.ts +10 -0
- package/dist/components/Confetti/index.d.ts +3 -0
- package/dist/components/Confetti/useConfetti.d.ts +25 -0
- package/dist/components/ConstellationMap/ConstellationMap.d.ts +42 -0
- package/dist/components/ConstellationMap/ConstellationMap.stories.d.ts +9 -0
- package/dist/components/ConstellationMap/index.d.ts +3 -0
- package/dist/components/ConstellationMap/useConstellationMap.d.ts +22 -0
- package/dist/components/FireEffect/FireEffect.d.ts +28 -0
- package/dist/components/FireEffect/FireEffect.stories.d.ts +10 -0
- package/dist/components/FireEffect/index.d.ts +3 -0
- package/dist/components/FireEffect/useFireEffect.d.ts +15 -0
- package/dist/components/Fireworks/Fireworks.d.ts +37 -0
- package/dist/components/Fireworks/index.d.ts +2 -0
- package/dist/components/Fireworks/useFireworks.d.ts +21 -0
- package/dist/components/FlowField/FlowField.d.ts +31 -0
- package/dist/components/FlowField/index.d.ts +2 -0
- package/dist/components/FlowField/useFlowField.d.ts +16 -0
- package/dist/components/FluidSimulation/FluidSimulation.d.ts +33 -0
- package/dist/components/FluidSimulation/index.d.ts +2 -0
- package/dist/components/FluidSimulation/useFluidSimulation.d.ts +17 -0
- package/dist/components/GameOfLife/GameOfLife.d.ts +30 -0
- package/dist/components/GameOfLife/index.d.ts +2 -0
- package/dist/components/GameOfLife/useGameOfLife.d.ts +21 -0
- package/dist/components/GlitchOverlay/GlitchOverlay.d.ts +35 -0
- package/dist/components/GlitchOverlay/index.d.ts +2 -0
- package/dist/components/GlitchOverlay/useGlitchOverlay.d.ts +18 -0
- package/dist/components/Lightning/Lightning.d.ts +37 -0
- package/dist/components/Lightning/index.d.ts +2 -0
- package/dist/components/Lightning/useLightning.d.ts +19 -0
- package/dist/components/LiveChart/LiveChart.d.ts +46 -0
- package/dist/components/LiveChart/index.d.ts +2 -0
- package/dist/components/LiveChart/useLiveChart.d.ts +31 -0
- package/dist/components/MagneticBlob/MagneticBlob.d.ts +35 -0
- package/dist/components/MagneticBlob/index.d.ts +2 -0
- package/dist/components/MagneticBlob/useMagneticBlob.d.ts +18 -0
- package/dist/components/Mandala/Mandala.d.ts +35 -0
- package/dist/components/Mandala/index.d.ts +2 -0
- package/dist/components/Mandala/useMandala.d.ts +18 -0
- package/dist/components/MatrixRain/MatrixRain.d.ts +22 -0
- package/dist/components/MatrixRain/MatrixRain.stories.d.ts +11 -0
- package/dist/components/MatrixRain/index.d.ts +3 -0
- package/dist/components/MatrixRain/useMatrixRain.d.ts +13 -0
- package/dist/components/NoiseGradient/NoiseGradient.d.ts +27 -0
- package/dist/components/NoiseGradient/NoiseGradient.stories.d.ts +9 -0
- package/dist/components/NoiseGradient/index.d.ts +2 -0
- package/dist/components/NoiseGradient/useNoiseGradient.d.ts +14 -0
- package/dist/components/ParticleField/ParticleField.d.ts +39 -0
- package/dist/components/ParticleField/ParticleField.stories.d.ts +9 -0
- package/dist/components/ParticleField/index.d.ts +2 -0
- package/dist/components/ParticleField/useParticleField.d.ts +20 -0
- package/dist/components/PixelDissolve/PixelDissolve.d.ts +25 -0
- package/dist/components/PixelDissolve/PixelDissolve.stories.d.ts +8 -0
- package/dist/components/PixelDissolve/index.d.ts +3 -0
- package/dist/components/PixelDissolve/usePixelDissolve.d.ts +15 -0
- package/dist/components/Rain/Rain.d.ts +31 -0
- package/dist/components/Rain/index.d.ts +2 -0
- package/dist/components/Rain/useRain.d.ts +16 -0
- package/dist/components/RippleEffect/RippleEffect.d.ts +33 -0
- package/dist/components/RippleEffect/RippleEffect.stories.d.ts +7 -0
- package/dist/components/RippleEffect/index.d.ts +2 -0
- package/dist/components/RippleEffect/useRippleEffect.d.ts +17 -0
- package/dist/components/Shockwave/Shockwave.d.ts +35 -0
- package/dist/components/Shockwave/index.d.ts +2 -0
- package/dist/components/Shockwave/useShockwave.d.ts +20 -0
- package/dist/components/Spotlight/Spotlight.d.ts +37 -0
- package/dist/components/Spotlight/index.d.ts +2 -0
- package/dist/components/Spotlight/useSpotlight.d.ts +19 -0
- package/dist/components/Starfield/Starfield.d.ts +40 -0
- package/dist/components/Starfield/Starfield.stories.d.ts +9 -0
- package/dist/components/Starfield/index.d.ts +3 -0
- package/dist/components/Starfield/useStarfield.d.ts +21 -0
- package/dist/components/Wormhole/Wormhole.d.ts +33 -0
- package/dist/components/Wormhole/index.d.ts +2 -0
- package/dist/components/Wormhole/useWormhole.d.ts +17 -0
- package/dist/hooks/useCanvasSetup.d.ts +12 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.es.js +4619 -0
- package/dist/types/index.d.ts +28 -0
- package/package.json +68 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ConfettiShape = "square" | "circle" | "triangle" | "strip";
|
|
4
|
+
export interface UseConfettiOptions {
|
|
5
|
+
trigger: boolean;
|
|
6
|
+
particleCount: number;
|
|
7
|
+
spread: number;
|
|
8
|
+
gravity: number;
|
|
9
|
+
colors: string[];
|
|
10
|
+
shapes: ConfettiShape[];
|
|
11
|
+
duration: number;
|
|
12
|
+
continuous: boolean;
|
|
13
|
+
wind: number;
|
|
14
|
+
spawnX: number;
|
|
15
|
+
spawnY: number;
|
|
16
|
+
spawnSpread: number;
|
|
17
|
+
speedMin: number;
|
|
18
|
+
speedMax: number;
|
|
19
|
+
sizeMin: number;
|
|
20
|
+
sizeMax: number;
|
|
21
|
+
angularVelocity: number;
|
|
22
|
+
emissionRate: number;
|
|
23
|
+
onComplete?: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useConfetti(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseConfettiOptions): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
import { ConstellationLineStyle } from './useConstellationMap';
|
|
3
|
+
|
|
4
|
+
type ConstellationPreset = "default" | "cosmos" | "minimal" | "aurora" | "gold";
|
|
5
|
+
export interface ConstellationMapProps extends BaseCanvasProps {
|
|
6
|
+
/** Number of stars (default: 80) */
|
|
7
|
+
starCount?: number;
|
|
8
|
+
/** Star color (default: "#ffffff") */
|
|
9
|
+
starColor?: string;
|
|
10
|
+
/** Connection line color (default: "#8888ff") */
|
|
11
|
+
lineColor?: string;
|
|
12
|
+
/** Background color (default: "#050510") */
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
/** Star drift speed (default: 0.3) */
|
|
15
|
+
speed?: number;
|
|
16
|
+
/** Enable drag-to-move stars (default: true) */
|
|
17
|
+
interactive?: boolean;
|
|
18
|
+
/** Line style (default: "solid") */
|
|
19
|
+
lineStyle?: ConstellationLineStyle;
|
|
20
|
+
/** Glow effect on stars (default: true) */
|
|
21
|
+
glowStars?: boolean;
|
|
22
|
+
/** Max distance for drawing lines (default: 100) */
|
|
23
|
+
connectionDistance?: number;
|
|
24
|
+
/** Velocity multiplier for initial star speed (default: 0.3) */
|
|
25
|
+
velocityMultiplier?: number;
|
|
26
|
+
/** Drag detection radius in px (default: 20) */
|
|
27
|
+
dragRadius?: number;
|
|
28
|
+
/** Twinkle animation speed (default: 0.03) */
|
|
29
|
+
twinkleSpeed?: number;
|
|
30
|
+
/** Max line opacity (default: 0.5) */
|
|
31
|
+
lineAlpha?: number;
|
|
32
|
+
/** Connection line width (default: 0.8) */
|
|
33
|
+
lineWidth?: number;
|
|
34
|
+
/** Glow blur as multiple of star size (default: 4) */
|
|
35
|
+
glowMultiplier?: number;
|
|
36
|
+
/** Twinkle opacity amplitude 0–1 (default: 0.4) */
|
|
37
|
+
twinkleAmplitude?: number;
|
|
38
|
+
/** Named preset: "default" | "cosmos" | "minimal" | "aurora" | "gold" */
|
|
39
|
+
preset?: ConstellationPreset | string;
|
|
40
|
+
}
|
|
41
|
+
export declare const ConstellationMap: import('react').ForwardRefExoticComponent<ConstellationMapProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ConstellationMap } from './ConstellationMap';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof ConstellationMap>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof ConstellationMap>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Dashed: Story;
|
|
9
|
+
export declare const Dense: Story;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ConstellationLineStyle = "solid" | "dashed";
|
|
4
|
+
export interface UseConstellationMapOptions {
|
|
5
|
+
starCount: number;
|
|
6
|
+
starColor: string;
|
|
7
|
+
lineColor: string;
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
speed: number;
|
|
10
|
+
interactive: boolean;
|
|
11
|
+
lineStyle: ConstellationLineStyle;
|
|
12
|
+
glowStars: boolean;
|
|
13
|
+
connectionDistance: number;
|
|
14
|
+
velocityMultiplier: number;
|
|
15
|
+
dragRadius: number;
|
|
16
|
+
twinkleSpeed: number;
|
|
17
|
+
lineAlpha: number;
|
|
18
|
+
lineWidth: number;
|
|
19
|
+
glowMultiplier: number;
|
|
20
|
+
twinkleAmplitude: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function useConstellationMap(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseConstellationMapOptions): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
import { FirePalette } from './useFireEffect';
|
|
3
|
+
|
|
4
|
+
type FirePreset = "default" | "inferno" | "toxic" | "ice" | "plasma";
|
|
5
|
+
export interface FireEffectProps extends BaseCanvasProps {
|
|
6
|
+
/** Color theme (default: "smoke") */
|
|
7
|
+
palette?: FirePalette;
|
|
8
|
+
/** Flame intensity 0–1 (default: 0.95) */
|
|
9
|
+
intensity?: number;
|
|
10
|
+
/** Wind horizontal strength -1 to 1 (default: 0.3) */
|
|
11
|
+
windStrength?: number;
|
|
12
|
+
/** Wind direction: 1 = right, -1 = left (default: 1) */
|
|
13
|
+
windDirection?: number;
|
|
14
|
+
/** Flame spread 0–1 (default: 0.7) */
|
|
15
|
+
spread?: number;
|
|
16
|
+
/** Cooling rate 0–1 — higher = shorter flames (default: 0.3) */
|
|
17
|
+
cooling?: number;
|
|
18
|
+
/** Bottom-row seed noise magnitude (default: 60) */
|
|
19
|
+
noiseStrength?: number;
|
|
20
|
+
/** Cooling amount scaling factor (default: 5) */
|
|
21
|
+
coolingScale?: number;
|
|
22
|
+
/** Fire buffer resolution relative to canvas — 0.5 = half size for perf (default: 1) */
|
|
23
|
+
resolution?: number;
|
|
24
|
+
/** Named preset: "default" | "inferno" | "toxic" | "ice" | "plasma" */
|
|
25
|
+
preset?: FirePreset | string;
|
|
26
|
+
}
|
|
27
|
+
export declare const FireEffect: import('react').ForwardRefExoticComponent<FireEffectProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { FireEffect } from './FireEffect';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof FireEffect>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof FireEffect>;
|
|
7
|
+
export declare const Inferno: Story;
|
|
8
|
+
export declare const Toxic: Story;
|
|
9
|
+
export declare const Ice: Story;
|
|
10
|
+
export declare const Plasma: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export type FirePalette = "inferno" | "toxic" | "ice" | "plasma" | "smoke";
|
|
4
|
+
export interface UseFireEffectOptions {
|
|
5
|
+
palette: FirePalette;
|
|
6
|
+
intensity: number;
|
|
7
|
+
windStrength: number;
|
|
8
|
+
windDirection: number;
|
|
9
|
+
spread: number;
|
|
10
|
+
cooling: number;
|
|
11
|
+
noiseStrength: number;
|
|
12
|
+
coolingScale: number;
|
|
13
|
+
resolution: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function useFireEffect(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseFireEffectOptions): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
type FireworksPreset = "default" | "celebration" | "subtle" | "neon" | "golden";
|
|
4
|
+
export interface FireworksProps extends BaseCanvasProps {
|
|
5
|
+
/** Particle burst colors (default: multi-color) */
|
|
6
|
+
colors?: string[];
|
|
7
|
+
/** Particles per explosion (default: 80) */
|
|
8
|
+
particleCount?: number;
|
|
9
|
+
/** Gravity pull per frame (default: 0.08) */
|
|
10
|
+
gravity?: number;
|
|
11
|
+
/** Velocity friction 0–1 (default: 0.97) */
|
|
12
|
+
friction?: number;
|
|
13
|
+
/** Alpha fade per frame (default: 0.015) */
|
|
14
|
+
fadeSpeed?: number;
|
|
15
|
+
/** Particle base size in px (default: 2) */
|
|
16
|
+
particleSize?: number;
|
|
17
|
+
/** Trail history length (default: 6) */
|
|
18
|
+
trailLength?: number;
|
|
19
|
+
/** Explosion spread speed (default: 5) */
|
|
20
|
+
spread?: number;
|
|
21
|
+
/** Auto-launch shells (default: true) */
|
|
22
|
+
autoLaunch?: boolean;
|
|
23
|
+
/** Average ms between auto-launches (default: 1800) */
|
|
24
|
+
autoInterval?: number;
|
|
25
|
+
/** Glow on particles (default: true) */
|
|
26
|
+
glowEffect?: boolean;
|
|
27
|
+
/** Shadow blur for glow (default: 8) */
|
|
28
|
+
glowBlur?: number;
|
|
29
|
+
/** Canvas background (default: "#050010") */
|
|
30
|
+
backgroundColor?: string;
|
|
31
|
+
/** Shell upward speed (default: 12) */
|
|
32
|
+
shellSpeed?: number;
|
|
33
|
+
/** Named preset */
|
|
34
|
+
preset?: FireworksPreset | string;
|
|
35
|
+
}
|
|
36
|
+
export declare const Fireworks: import('react').ForwardRefExoticComponent<FireworksProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface UseFireworksOptions {
|
|
4
|
+
colors: string[];
|
|
5
|
+
particleCount: number;
|
|
6
|
+
gravity: number;
|
|
7
|
+
friction: number;
|
|
8
|
+
fadeSpeed: number;
|
|
9
|
+
particleSize: number;
|
|
10
|
+
trailLength: number;
|
|
11
|
+
spread: number;
|
|
12
|
+
autoLaunch: boolean;
|
|
13
|
+
autoInterval: number;
|
|
14
|
+
glowEffect: boolean;
|
|
15
|
+
glowBlur: number;
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
shellSpeed: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function useFireworks(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseFireworksOptions): {
|
|
20
|
+
launch: (x?: number) => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
type FlowFieldPreset = "default" | "neon" | "ocean" | "lava" | "forest" | "monochrome";
|
|
4
|
+
export interface FlowFieldProps extends BaseCanvasProps {
|
|
5
|
+
/** Number of flow particles (default: 800) */
|
|
6
|
+
particleCount?: number;
|
|
7
|
+
/** Particle stroke colors — one is picked per particle (default: multi-color) */
|
|
8
|
+
colors?: string[];
|
|
9
|
+
/** Flow speed multiplier (default: 1) */
|
|
10
|
+
speed?: number;
|
|
11
|
+
/** Noise sampling scale — lower = larger flow structures (default: 0.004) */
|
|
12
|
+
noiseScale?: number;
|
|
13
|
+
/** Particle trail fade length — lower = longer trails (default: 0.04) */
|
|
14
|
+
trailLength?: number;
|
|
15
|
+
/** Background fade opacity per frame (default: 0.04) */
|
|
16
|
+
fadeStrength?: number;
|
|
17
|
+
/** Stroke line width (default: 1) */
|
|
18
|
+
lineWidth?: number;
|
|
19
|
+
/** Canvas background color (default: "#050010") */
|
|
20
|
+
backgroundColor?: string;
|
|
21
|
+
/** Enable animation (default: true) */
|
|
22
|
+
animated?: boolean;
|
|
23
|
+
/** How fast the noise field evolves (default: 1) */
|
|
24
|
+
timeSpeed?: number;
|
|
25
|
+
/** Add curl noise component for more swirling flow (default: false) */
|
|
26
|
+
curl?: boolean;
|
|
27
|
+
/** Named preset: "default" | "neon" | "ocean" | "lava" | "forest" | "monochrome" */
|
|
28
|
+
preset?: FlowFieldPreset | string;
|
|
29
|
+
}
|
|
30
|
+
export declare const FlowField: import('react').ForwardRefExoticComponent<FlowFieldProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface UseFlowFieldOptions {
|
|
4
|
+
particleCount: number;
|
|
5
|
+
colors: string[];
|
|
6
|
+
speed: number;
|
|
7
|
+
noiseScale: number;
|
|
8
|
+
trailLength: number;
|
|
9
|
+
fadeStrength: number;
|
|
10
|
+
lineWidth: number;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
animated: boolean;
|
|
13
|
+
timeSpeed: number;
|
|
14
|
+
curl: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function useFlowField(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseFlowFieldOptions): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
type FluidPreset = "default" | "ink" | "neon" | "lava" | "ocean" | "smoke";
|
|
4
|
+
export interface FluidSimulationProps extends BaseCanvasProps {
|
|
5
|
+
/** Grid resolution (32–128) — lower is faster (default: 80) */
|
|
6
|
+
resolution?: number;
|
|
7
|
+
/** Fluid viscosity — resistance to flow (default: 0.0001) */
|
|
8
|
+
viscosity?: number;
|
|
9
|
+
/** Ink diffusion rate (default: 0.0001) */
|
|
10
|
+
diffusion?: number;
|
|
11
|
+
/** Density fade per frame 0–1 (default: 0.995) */
|
|
12
|
+
dissipation?: number;
|
|
13
|
+
/** Ink colors painted by mouse and auto-ink (default: multi-color) */
|
|
14
|
+
inkColors?: string[];
|
|
15
|
+
/** Glow on ink (default: true) */
|
|
16
|
+
glowEffect?: boolean;
|
|
17
|
+
/** Shadow blur for glow (default: 0 — handled by blending) */
|
|
18
|
+
glowBlur?: number;
|
|
19
|
+
/** Canvas background color (default: "#050010") */
|
|
20
|
+
backgroundColor?: string;
|
|
21
|
+
/** Auto-inject ink bursts without mouse (default: true) */
|
|
22
|
+
autoInk?: boolean;
|
|
23
|
+
/** Interval between auto-ink bursts in ms (default: 1500) */
|
|
24
|
+
autoInkInterval?: number;
|
|
25
|
+
/** Mouse velocity → velocity force multiplier (default: 5) */
|
|
26
|
+
mouseForce?: number;
|
|
27
|
+
/** Ink splat radius in grid cells (default: 4) */
|
|
28
|
+
inkRadius?: number;
|
|
29
|
+
/** Named preset */
|
|
30
|
+
preset?: FluidPreset | string;
|
|
31
|
+
}
|
|
32
|
+
export declare const FluidSimulation: import('react').ForwardRefExoticComponent<FluidSimulationProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface UseFluidSimulationOptions {
|
|
4
|
+
resolution: number;
|
|
5
|
+
viscosity: number;
|
|
6
|
+
diffusion: number;
|
|
7
|
+
dissipation: number;
|
|
8
|
+
inkColors: string[];
|
|
9
|
+
glowEffect: boolean;
|
|
10
|
+
glowBlur: number;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
autoInk: boolean;
|
|
13
|
+
autoInkInterval: number;
|
|
14
|
+
mouseForce: number;
|
|
15
|
+
inkRadius: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function useFluidSimulation(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseFluidSimulationOptions): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
import { GameOfLifeHandle } from './useGameOfLife';
|
|
3
|
+
|
|
4
|
+
export type { GameOfLifeHandle };
|
|
5
|
+
type GameOfLifePreset = "default" | "neon" | "matrix" | "minimal" | "fire";
|
|
6
|
+
export interface GameOfLifeProps extends BaseCanvasProps {
|
|
7
|
+
/** Cell size in px. (default: 8) */
|
|
8
|
+
cellSize?: number;
|
|
9
|
+
/** Simulation updates per second. (default: 10) */
|
|
10
|
+
speed?: number;
|
|
11
|
+
/** Initial alive cell density 0–1. (default: 0.3) */
|
|
12
|
+
initialDensity?: number;
|
|
13
|
+
/** Color of newly born cells. (default: "#7C3AED") */
|
|
14
|
+
aliveColor?: string;
|
|
15
|
+
/** Color of old cells. (default: "#0891B2") */
|
|
16
|
+
oldColor?: string;
|
|
17
|
+
/** Color of dead cells / background. (default: "#050010") */
|
|
18
|
+
deadColor?: string;
|
|
19
|
+
/** Color cells by generation age. (default: true) */
|
|
20
|
+
showAge?: boolean;
|
|
21
|
+
/** Wrap cells at canvas edges. (default: true) */
|
|
22
|
+
wrapEdges?: boolean;
|
|
23
|
+
/** Click to toggle cells. (default: true) */
|
|
24
|
+
interactive?: boolean;
|
|
25
|
+
/** Canvas background color. (default: "#050010") */
|
|
26
|
+
backgroundColor?: string;
|
|
27
|
+
/** Named preset. */
|
|
28
|
+
preset?: GameOfLifePreset | string;
|
|
29
|
+
}
|
|
30
|
+
export declare const GameOfLife: import('react').ForwardRefExoticComponent<GameOfLifeProps & import('react').RefAttributes<GameOfLifeHandle>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface GameOfLifeHandle {
|
|
4
|
+
randomize: () => void;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
pause: () => void;
|
|
7
|
+
resume: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface UseGameOfLifeOptions {
|
|
10
|
+
cellSize: number;
|
|
11
|
+
speed: number;
|
|
12
|
+
initialDensity: number;
|
|
13
|
+
aliveColor: string;
|
|
14
|
+
oldColor: string;
|
|
15
|
+
deadColor: string;
|
|
16
|
+
showAge: boolean;
|
|
17
|
+
wrapEdges: boolean;
|
|
18
|
+
interactive: boolean;
|
|
19
|
+
backgroundColor: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function useGameOfLife(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseGameOfLifeOptions, handleRef: RefObject<GameOfLifeHandle | null>): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
type GlitchPreset = "default" | "crt" | "cyberpunk" | "subtle" | "corrupt";
|
|
4
|
+
export interface GlitchOverlayProps extends BaseCanvasProps {
|
|
5
|
+
/** Glitch probability 0–1 (default: 0.6) */
|
|
6
|
+
intensity?: number;
|
|
7
|
+
/** Animation speed multiplier (default: 1) */
|
|
8
|
+
speed?: number;
|
|
9
|
+
/** RGB color shift amount in px (default: 8) */
|
|
10
|
+
rgbShift?: number;
|
|
11
|
+
/** Show CRT scanlines (default: true) */
|
|
12
|
+
scanlines?: boolean;
|
|
13
|
+
/** Scanline opacity (default: 0.08) */
|
|
14
|
+
scanlineOpacity?: number;
|
|
15
|
+
/** Px between scanlines (default: 2) */
|
|
16
|
+
scanlineSpacing?: number;
|
|
17
|
+
/** Enable block-slice glitch (default: true) */
|
|
18
|
+
blockGlitch?: boolean;
|
|
19
|
+
/** Number of glitch blocks (default: 4) */
|
|
20
|
+
blockCount?: number;
|
|
21
|
+
/** Film noise opacity (default: 0.02) */
|
|
22
|
+
noiseOpacity?: number;
|
|
23
|
+
/** Screen flicker rate 0–1 (default: 0.02) */
|
|
24
|
+
flickerRate?: number;
|
|
25
|
+
/** Glitch bar color (default: "#7C3AED") */
|
|
26
|
+
color?: string;
|
|
27
|
+
/** Enable animation (default: true) */
|
|
28
|
+
animated?: boolean;
|
|
29
|
+
/** Canvas background (default: "transparent") */
|
|
30
|
+
backgroundColor?: string;
|
|
31
|
+
/** Named preset */
|
|
32
|
+
preset?: GlitchPreset | string;
|
|
33
|
+
}
|
|
34
|
+
export declare const GlitchOverlay: import('react').ForwardRefExoticComponent<GlitchOverlayProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface UseGlitchOverlayOptions {
|
|
4
|
+
intensity: number;
|
|
5
|
+
speed: number;
|
|
6
|
+
rgbShift: number;
|
|
7
|
+
scanlines: boolean;
|
|
8
|
+
scanlineOpacity: number;
|
|
9
|
+
scanlineSpacing: number;
|
|
10
|
+
blockGlitch: boolean;
|
|
11
|
+
blockCount: number;
|
|
12
|
+
noiseOpacity: number;
|
|
13
|
+
flickerRate: number;
|
|
14
|
+
color: string;
|
|
15
|
+
animated: boolean;
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function useGlitchOverlay(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseGlitchOverlayOptions): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
type LightningPreset = "default" | "neon" | "storm" | "plasma" | "subtle";
|
|
4
|
+
export interface LightningProps extends BaseCanvasProps {
|
|
5
|
+
/** Recursion depth for bolt segments. (default: 8) */
|
|
6
|
+
segments?: number;
|
|
7
|
+
/** Midpoint displacement roughness 0–1. (default: 0.5) */
|
|
8
|
+
roughness?: number;
|
|
9
|
+
/** Probability of spawning a branch at each segment. (default: 0.3) */
|
|
10
|
+
branchChance?: number;
|
|
11
|
+
/** Energy multiplier for sub-branches. (default: 0.6) */
|
|
12
|
+
branchDecay?: number;
|
|
13
|
+
/** Number of rapid flicker strikes per event. (default: 3) */
|
|
14
|
+
flickerCount?: number;
|
|
15
|
+
/** Glow shadow blur radius. (default: 20) */
|
|
16
|
+
glowBlur?: number;
|
|
17
|
+
/** Bolt glow color. (default: "#7C3AED") */
|
|
18
|
+
color?: string;
|
|
19
|
+
/** Inner core color. (default: "#ffffff") */
|
|
20
|
+
coreColor?: string;
|
|
21
|
+
/** Canvas background color. (default: "#050010") */
|
|
22
|
+
backgroundColor?: string;
|
|
23
|
+
/** Ms between auto strikes. (default: 2000) */
|
|
24
|
+
autoInterval?: number;
|
|
25
|
+
/** Click to trigger strike at cursor. (default: true) */
|
|
26
|
+
interactive?: boolean;
|
|
27
|
+
/** Strike origin X as fraction of width. (default: 0.5) */
|
|
28
|
+
startX?: number;
|
|
29
|
+
/** Strike origin Y as fraction of height. (default: 0) */
|
|
30
|
+
startY?: number;
|
|
31
|
+
/** Strike end Y as fraction of height. (default: 1) */
|
|
32
|
+
endY?: number;
|
|
33
|
+
/** Named preset. */
|
|
34
|
+
preset?: LightningPreset | string;
|
|
35
|
+
}
|
|
36
|
+
export declare const Lightning: import('react').ForwardRefExoticComponent<LightningProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface UseLightningOptions {
|
|
4
|
+
segments: number;
|
|
5
|
+
roughness: number;
|
|
6
|
+
branchChance: number;
|
|
7
|
+
branchDecay: number;
|
|
8
|
+
flickerCount: number;
|
|
9
|
+
glowBlur: number;
|
|
10
|
+
color: string;
|
|
11
|
+
coreColor: string;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
autoInterval: number;
|
|
14
|
+
interactive: boolean;
|
|
15
|
+
startX: number;
|
|
16
|
+
startY: number;
|
|
17
|
+
endY: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function useLightning(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseLightningOptions): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
import { LiveChartSeries } from './useLiveChart';
|
|
3
|
+
|
|
4
|
+
export type { LiveChartSeries } from './useLiveChart';
|
|
5
|
+
type LiveChartPreset = "default" | "neon" | "minimal" | "ocean" | "fire";
|
|
6
|
+
export interface LiveChartProps extends BaseCanvasProps {
|
|
7
|
+
/** Data series to render */
|
|
8
|
+
series?: LiveChartSeries[];
|
|
9
|
+
/** Max data points kept per series (default: 100) */
|
|
10
|
+
maxPoints?: number;
|
|
11
|
+
/** Enable animation loop (default: true) */
|
|
12
|
+
animated?: boolean;
|
|
13
|
+
/** Line stroke width (default: 2) */
|
|
14
|
+
lineWidth?: number;
|
|
15
|
+
/** Show horizontal grid lines (default: true) */
|
|
16
|
+
showGrid?: boolean;
|
|
17
|
+
/** Grid line color (default: "#ffffff") */
|
|
18
|
+
gridColor?: string;
|
|
19
|
+
/** Grid opacity (default: 0.08) */
|
|
20
|
+
gridOpacity?: number;
|
|
21
|
+
/** Show data point dots (default: false) */
|
|
22
|
+
showDots?: boolean;
|
|
23
|
+
/** Dot radius when shown (default: 3) */
|
|
24
|
+
dotRadius?: number;
|
|
25
|
+
/** Fill area opacity multiplier (default: 1) */
|
|
26
|
+
fillOpacity?: number;
|
|
27
|
+
/** Canvas background color (default: "#050010") */
|
|
28
|
+
backgroundColor?: string;
|
|
29
|
+
/** Inner padding px (default: 20) */
|
|
30
|
+
padding?: number;
|
|
31
|
+
/** Fixed y minimum */
|
|
32
|
+
yMin?: number;
|
|
33
|
+
/** Fixed y maximum */
|
|
34
|
+
yMax?: number;
|
|
35
|
+
/** Smooth curves with quadratic bezier (default: true) */
|
|
36
|
+
smooth?: boolean;
|
|
37
|
+
/** Line glow effect (default: true) */
|
|
38
|
+
glowEffect?: boolean;
|
|
39
|
+
/** Shadow blur for glow (default: 8) */
|
|
40
|
+
glowBlur?: number;
|
|
41
|
+
/** Scroll animation speed (default: 1) */
|
|
42
|
+
scrollSpeed?: number;
|
|
43
|
+
/** Named preset */
|
|
44
|
+
preset?: LiveChartPreset | string;
|
|
45
|
+
}
|
|
46
|
+
export declare const LiveChart: import('react').ForwardRefExoticComponent<LiveChartProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface LiveChartSeries {
|
|
4
|
+
data: number[];
|
|
5
|
+
color: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
filled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface UseLiveChartOptions {
|
|
10
|
+
series: LiveChartSeries[];
|
|
11
|
+
maxPoints: number;
|
|
12
|
+
animated: boolean;
|
|
13
|
+
lineWidth: number;
|
|
14
|
+
showGrid: boolean;
|
|
15
|
+
gridColor: string;
|
|
16
|
+
gridOpacity: number;
|
|
17
|
+
showDots: boolean;
|
|
18
|
+
dotRadius: number;
|
|
19
|
+
fillOpacity: number;
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
padding: number;
|
|
22
|
+
yMin?: number;
|
|
23
|
+
yMax?: number;
|
|
24
|
+
smooth: boolean;
|
|
25
|
+
glowEffect: boolean;
|
|
26
|
+
glowBlur: number;
|
|
27
|
+
scrollSpeed: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function useLiveChart(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseLiveChartOptions): {
|
|
30
|
+
push: (values: number | number[]) => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BaseCanvasProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
type MagneticBlobPreset = "default" | "neon" | "plasma" | "ocean" | "lava" | "minimal";
|
|
4
|
+
export interface MagneticBlobProps extends BaseCanvasProps {
|
|
5
|
+
/** Number of blobs (default: 5) */
|
|
6
|
+
count?: number;
|
|
7
|
+
/** Blob colors (default: purple/cyan/green) */
|
|
8
|
+
colors?: string[];
|
|
9
|
+
/** Base blob radius in px (default: 80) */
|
|
10
|
+
radius?: number;
|
|
11
|
+
/** Wander animation speed (default: 1) */
|
|
12
|
+
speed?: number;
|
|
13
|
+
/** Mouse attraction force (default: 0.08) */
|
|
14
|
+
magnetStrength?: number;
|
|
15
|
+
/** Mouse influence radius in px (default: 150) */
|
|
16
|
+
magnetRadius?: number;
|
|
17
|
+
/** Metaball merge threshold — higher = earlier merge (default: 1.8) */
|
|
18
|
+
threshold?: number;
|
|
19
|
+
/** Glow effect (default: true) */
|
|
20
|
+
glowEffect?: boolean;
|
|
21
|
+
/** Shadow blur for glow (default: 20) */
|
|
22
|
+
glowBlur?: number;
|
|
23
|
+
/** Canvas background (default: "#050010") */
|
|
24
|
+
backgroundColor?: string;
|
|
25
|
+
/** Enable animation (default: true) */
|
|
26
|
+
animated?: boolean;
|
|
27
|
+
/** Blobs follow cursor (default: true) */
|
|
28
|
+
followMouse?: boolean;
|
|
29
|
+
/** Organic wander amplitude 0–1 (default: 0.4) */
|
|
30
|
+
wanderStrength?: number;
|
|
31
|
+
/** Named preset */
|
|
32
|
+
preset?: MagneticBlobPreset | string;
|
|
33
|
+
}
|
|
34
|
+
export declare const MagneticBlob: import('react').ForwardRefExoticComponent<MagneticBlobProps & import('react').RefAttributes<HTMLCanvasElement>>;
|
|
35
|
+
export {};
|