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.
Files changed (70) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/README.md +34 -17
  3. package/lib/components/AuroraBorealis/AuroraBorealis.d.ts +5 -3
  4. package/lib/components/AuroraBorealis/useAuroraBorealis.d.ts +14 -3
  5. package/lib/components/ButterflySwarm/useButterflySwarm.d.ts +7 -0
  6. package/lib/components/Candle/Candle.d.ts +35 -0
  7. package/lib/components/Candle/index.d.ts +2 -0
  8. package/lib/components/Candle/useCandle.d.ts +18 -0
  9. package/lib/components/Cat/Cat.d.ts +42 -0
  10. package/lib/components/Cat/index.d.ts +2 -0
  11. package/lib/components/Cat/useCat.d.ts +22 -0
  12. package/lib/components/Eye/Eye.d.ts +46 -0
  13. package/lib/components/Eye/index.d.ts +3 -0
  14. package/lib/components/Eye/useEye.d.ts +29 -0
  15. package/lib/components/Fireworks/Fireworks.d.ts +2 -0
  16. package/lib/components/Fireworks/useFireworks.d.ts +1 -0
  17. package/lib/components/FluidSimulation/useFluidSimulation.d.ts +9 -3
  18. package/lib/components/GameOfLife/GameOfLife.d.ts +2 -2
  19. package/lib/components/GameOfLife/useGameOfLife.d.ts +10 -1
  20. package/lib/components/Hummingbird/Hummingbird.d.ts +43 -0
  21. package/lib/components/Hummingbird/index.d.ts +2 -0
  22. package/lib/components/Hummingbird/useHummingbird.d.ts +35 -0
  23. package/lib/components/Jellyfish/Jellyfish.d.ts +37 -0
  24. package/lib/components/Jellyfish/index.d.ts +2 -0
  25. package/lib/components/Jellyfish/useJellyfish.d.ts +20 -0
  26. package/lib/components/KoiPond/KoiPond.d.ts +2 -2
  27. package/lib/components/KoiPond/useKoiPond.d.ts +10 -3
  28. package/lib/components/Komorebi/Komorebi.d.ts +34 -0
  29. package/lib/components/Komorebi/index.d.ts +2 -0
  30. package/lib/components/Komorebi/useKomorebi.d.ts +22 -0
  31. package/lib/components/Lightning/Lightning.d.ts +1 -1
  32. package/lib/components/Lightning/useLightning.d.ts +7 -0
  33. package/lib/components/Octopus/Octopus.d.ts +44 -0
  34. package/lib/components/Octopus/index.d.ts +2 -0
  35. package/lib/components/Octopus/useOctopus.d.ts +35 -0
  36. package/lib/components/Owl/Owl.d.ts +48 -0
  37. package/lib/components/Owl/index.d.ts +2 -0
  38. package/lib/components/Owl/useOwl.d.ts +29 -0
  39. package/lib/components/Rain/Rain.d.ts +2 -0
  40. package/lib/components/Rain/useRain.d.ts +1 -0
  41. package/lib/components/ReactionDiffusion/ReactionDiffusion.d.ts +1 -1
  42. package/lib/components/ReactionDiffusion/useReactionDiffusion.d.ts +9 -3
  43. package/lib/components/Snail/Snail.d.ts +38 -0
  44. package/lib/components/Snail/index.d.ts +2 -0
  45. package/lib/components/Snail/useSnail.d.ts +21 -0
  46. package/lib/components/SpiderWeb/SpiderWeb.d.ts +4 -0
  47. package/lib/components/SpiderWeb/useSpiderWeb.d.ts +3 -0
  48. package/lib/components/Starfield/useStarfield.d.ts +10 -3
  49. package/lib/components/Sunflowers/Sunflowers.d.ts +36 -0
  50. package/lib/components/Sunflowers/index.d.ts +2 -0
  51. package/lib/components/Sunflowers/useSunflowers.d.ts +23 -0
  52. package/lib/components/TidePool/TidePool.d.ts +32 -0
  53. package/lib/components/TidePool/index.d.ts +2 -0
  54. package/lib/components/TidePool/useTidePool.d.ts +21 -0
  55. package/lib/components/WaveInterference/WaveInterference.d.ts +2 -0
  56. package/lib/components/WaveInterference/useWaveInterference.d.ts +20 -3
  57. package/lib/index.cjs.js +1 -1
  58. package/lib/index.d.ts +22 -6
  59. package/lib/index.es.js +11154 -9467
  60. package/lib/runtime/caustics.d.ts +16 -0
  61. package/package.json +2 -2
  62. package/lib/components/DeepSeaBioluminescence/DeepSeaBioluminescence.d.ts +0 -29
  63. package/lib/components/DeepSeaBioluminescence/index.d.ts +0 -2
  64. package/lib/components/DeepSeaBioluminescence/useDeepSeaBioluminescence.d.ts +0 -18
  65. package/lib/components/FrostGlass/FrostGlass.d.ts +0 -33
  66. package/lib/components/FrostGlass/index.d.ts +0 -2
  67. package/lib/components/FrostGlass/useFrostGlass.d.ts +0 -38
  68. package/lib/components/LSystem/LSystem.d.ts +0 -33
  69. package/lib/components/LSystem/index.d.ts +0 -2
  70. 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
- export declare function useWaveInterference(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseWaveInterferenceOptions): void;
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 {};