@zakkster/lite-tools 2.0.2 → 2.0.3

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/LiteEngine.d.ts CHANGED
@@ -99,7 +99,7 @@ export { easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, ease
99
99
  export { Tween } from '@zakkster/lite-tween';
100
100
  export { SpringStandalone, SpringPool } from '@zakkster/lite-spring';
101
101
  export { Gradient } from '@zakkster/lite-gradient';
102
- export { Noise } from '@zakkster/lite-noise';
102
+ export { seedNoise, simplex2, simplex3, fbm2, fbm3, curl2 } from '@zakkster/lite-noise';
103
103
  export { Timeline } from '@zakkster/lite-timeline';
104
104
 
105
105
  // Interaction + utility
package/LiteEngine.js CHANGED
@@ -98,7 +98,7 @@ export {
98
98
  export {Tween} from '@zakkster/lite-tween';
99
99
  export {SpringStandalone, SpringPool} from '@zakkster/lite-spring';
100
100
  export {Gradient} from '@zakkster/lite-gradient';
101
- export {Noise} from '@zakkster/lite-noise';
101
+ export {seedNoise, simplex2, simplex3, fbm2, fbm3, curl2} from '@zakkster/lite-noise';
102
102
  export {Timeline} from '@zakkster/lite-timeline';
103
103
 
104
104
  // Interaction + utility
@@ -163,7 +163,7 @@ import {easeOutCubic, easeOutElastic, easeInOutCubic, easeOutBounce, easeOutBack
163
163
  import {Tween} from '@zakkster/lite-tween';
164
164
  import {SpringPool} from '@zakkster/lite-spring';
165
165
  import {Gradient} from '@zakkster/lite-gradient';
166
- import {Noise} from '@zakkster/lite-noise';
166
+ import {seedNoise, fbm2} from '@zakkster/lite-noise';
167
167
  import {Timeline} from '@zakkster/lite-timeline';
168
168
  import {GestureRecognizer} from '@zakkster/lite-gesture';
169
169
  import {confetti as confettiFn} from '@zakkster/lite-confetti';
@@ -1015,7 +1015,7 @@ export const Recipes = {
1015
1015
  const {seed = 42, cellSize = 8, scale = 0.02} = options;
1016
1016
  const ctx = canvas.getContext('2d');
1017
1017
  const rng = new Random(seed);
1018
- const noise = new Noise(seed);
1018
+ seedNoise(seed);
1019
1019
  const cam = new Camera({smoothing: 0.08, deadzone: 40});
1020
1020
  const gradient = new Gradient([
1021
1021
  {l: 0.2, c: 0.15, h: 220}, // deep water
@@ -1040,7 +1040,7 @@ export const Recipes = {
1040
1040
  for (let c = 0; c < cols; c++) {
1041
1041
  const wx = (offX + c) * scale;
1042
1042
  const wy = (offY + r) * scale;
1043
- const n = noise.fbm2(wx, wy, 5, 2.0, 0.5) * 0.5 + 0.5;
1043
+ const n = fbm2(wx, wy, 5, 2.0, 0.5) * 0.5 + 0.5;
1044
1044
  const color = gradient.at(clamp(n, 0, 1));
1045
1045
  ctx.fillStyle = toCssOklch(color);
1046
1046
  ctx.fillRect((c - (camX / cellSize - offX)) * cellSize, (r - (camY / cellSize - offY)) * cellSize, cellSize + 1, cellSize + 1);
@@ -1054,7 +1054,7 @@ export const Recipes = {
1054
1054
  target = {x, y};
1055
1055
  },
1056
1056
  reseed(s) {
1057
- noise.seed(s);
1057
+ seedNoise(s);
1058
1058
  },
1059
1059
  destroy() {
1060
1060
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zakkster/lite-tools",
3
3
  "author": "Zahary Shinikchiev <shinikchiev@yahoo.com>",
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
5
5
  "sideEffects": false,
6
6
  "description": "The standard library for high-performance web presentation — 45+ micro-libraries, 24 recipes, zero-GC, deterministic, tree-shakeable.",
7
7
  "type": "module",