own-the-canvas 2.0.0 → 2.0.2
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 +33 -1
- package/README.md +34 -17
- package/lib/components/AuroraBorealis/AuroraBorealis.d.ts +5 -3
- package/lib/components/AuroraBorealis/useAuroraBorealis.d.ts +14 -3
- package/lib/components/ButterflySwarm/useButterflySwarm.d.ts +7 -0
- package/lib/components/Candle/Candle.d.ts +35 -0
- package/lib/components/Candle/index.d.ts +2 -0
- package/lib/components/Candle/useCandle.d.ts +18 -0
- package/lib/components/Cat/Cat.d.ts +42 -0
- package/lib/components/Cat/index.d.ts +2 -0
- package/lib/components/Cat/useCat.d.ts +22 -0
- package/lib/components/Eye/Eye.d.ts +46 -0
- package/lib/components/Eye/index.d.ts +3 -0
- package/lib/components/Eye/useEye.d.ts +29 -0
- package/lib/components/Fireworks/Fireworks.d.ts +2 -0
- package/lib/components/Fireworks/useFireworks.d.ts +1 -0
- package/lib/components/FluidSimulation/useFluidSimulation.d.ts +9 -3
- package/lib/components/GameOfLife/GameOfLife.d.ts +2 -2
- package/lib/components/GameOfLife/useGameOfLife.d.ts +10 -1
- package/lib/components/Hummingbird/Hummingbird.d.ts +43 -0
- package/lib/components/Hummingbird/index.d.ts +2 -0
- package/lib/components/Hummingbird/useHummingbird.d.ts +35 -0
- package/lib/components/Jellyfish/Jellyfish.d.ts +37 -0
- package/lib/components/Jellyfish/index.d.ts +2 -0
- package/lib/components/Jellyfish/useJellyfish.d.ts +20 -0
- package/lib/components/KoiPond/KoiPond.d.ts +2 -2
- package/lib/components/KoiPond/useKoiPond.d.ts +10 -3
- package/lib/components/Komorebi/Komorebi.d.ts +34 -0
- package/lib/components/Komorebi/index.d.ts +2 -0
- package/lib/components/Komorebi/useKomorebi.d.ts +22 -0
- package/lib/components/Lightning/Lightning.d.ts +1 -1
- package/lib/components/Lightning/useLightning.d.ts +7 -0
- package/lib/components/Octopus/Octopus.d.ts +44 -0
- package/lib/components/Octopus/index.d.ts +2 -0
- package/lib/components/Octopus/useOctopus.d.ts +35 -0
- package/lib/components/Owl/Owl.d.ts +48 -0
- package/lib/components/Owl/index.d.ts +2 -0
- package/lib/components/Owl/useOwl.d.ts +29 -0
- package/lib/components/Rain/Rain.d.ts +2 -0
- package/lib/components/Rain/useRain.d.ts +1 -0
- package/lib/components/ReactionDiffusion/ReactionDiffusion.d.ts +1 -1
- package/lib/components/ReactionDiffusion/useReactionDiffusion.d.ts +9 -3
- package/lib/components/Snail/Snail.d.ts +38 -0
- package/lib/components/Snail/index.d.ts +2 -0
- package/lib/components/Snail/useSnail.d.ts +21 -0
- package/lib/components/SpiderWeb/SpiderWeb.d.ts +4 -0
- package/lib/components/SpiderWeb/useSpiderWeb.d.ts +3 -0
- package/lib/components/Starfield/useStarfield.d.ts +10 -3
- package/lib/components/Sunflowers/Sunflowers.d.ts +36 -0
- package/lib/components/Sunflowers/index.d.ts +2 -0
- package/lib/components/Sunflowers/useSunflowers.d.ts +23 -0
- package/lib/components/TidePool/TidePool.d.ts +32 -0
- package/lib/components/TidePool/index.d.ts +2 -0
- package/lib/components/TidePool/useTidePool.d.ts +21 -0
- package/lib/components/WaveInterference/WaveInterference.d.ts +2 -0
- package/lib/components/WaveInterference/useWaveInterference.d.ts +20 -3
- package/lib/index.cjs.js +1 -1
- package/lib/index.d.ts +22 -6
- package/lib/index.es.js +11154 -9467
- package/lib/runtime/caustics.d.ts +16 -0
- package/package.json +2 -2
- package/lib/components/DeepSeaBioluminescence/DeepSeaBioluminescence.d.ts +0 -29
- package/lib/components/DeepSeaBioluminescence/index.d.ts +0 -2
- package/lib/components/DeepSeaBioluminescence/useDeepSeaBioluminescence.d.ts +0 -18
- package/lib/components/FrostGlass/FrostGlass.d.ts +0 -33
- package/lib/components/FrostGlass/index.d.ts +0 -2
- package/lib/components/FrostGlass/useFrostGlass.d.ts +0 -38
- package/lib/components/LSystem/LSystem.d.ts +0 -33
- package/lib/components/LSystem/index.d.ts +0 -2
- package/lib/components/LSystem/useLSystem.d.ts +0 -23
|
@@ -28,6 +28,8 @@ export interface WaveInterferenceProps extends BaseCanvasProps {
|
|
|
28
28
|
resolution?: number;
|
|
29
29
|
/** Enable animation (default: true) */
|
|
30
30
|
animated?: boolean;
|
|
31
|
+
/** Click to add or remove a source, drag to move one; the hovering cursor stirs ripples (default: true) */
|
|
32
|
+
interactive?: boolean;
|
|
31
33
|
/** Amplitude decay with distance (default: 0.003) */
|
|
32
34
|
decay?: number;
|
|
33
35
|
/** Named preset */
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
|
|
3
1
|
export interface UseWaveInterferenceOptions {
|
|
4
2
|
maxSources: number;
|
|
5
3
|
wavelength: number;
|
|
@@ -11,5 +9,24 @@ export interface UseWaveInterferenceOptions {
|
|
|
11
9
|
resolution: number;
|
|
12
10
|
animated: boolean;
|
|
13
11
|
decay: number;
|
|
12
|
+
interactive: boolean;
|
|
14
13
|
}
|
|
15
|
-
|
|
14
|
+
interface WaveSource {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
amp: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Height and slope of the summed waves at (x, y): sources radiate cos(k·r − ωt) damped by
|
|
21
|
+
* exp(−decay·r). Returns [height, dh/dx, dh/dy, envelope], each averaged over the sources.
|
|
22
|
+
*/
|
|
23
|
+
export declare function waveAt(x: number, y: number, src: readonly WaveSource[], k: number, wt: number, decay: number): [number, number, number, number];
|
|
24
|
+
/**
|
|
25
|
+
* Wave interference as a lit water surface. Each source sends out ripples; where they meet,
|
|
26
|
+
* the summed height and slope are shaded with diffuse light and a glossy sky glint, so the
|
|
27
|
+
* bright fringes and the calm nodal lines between them read crisply. Sources bob as glowing
|
|
28
|
+
* points: click empty water to add one, click a source to remove it, drag it to move it, and
|
|
29
|
+
* your hovering finger stirs its own ripples.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useWaveInterference(options: UseWaveInterferenceOptions): import('../../hooks/useCanvasSetup').CanvasSetupResult;
|
|
32
|
+
export {};
|