@zakkster/lite-tools 2.0.2 → 2.0.4
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 +3 -3
- package/LiteEngine.js +8 -8
- package/README.md +1 -1
- package/package.json +1 -1
package/LiteEngine.d.ts
CHANGED
|
@@ -99,11 +99,11 @@ 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 {
|
|
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
|
|
106
|
-
export {
|
|
106
|
+
export { GestureTracker } from '@zakkster/lite-gesture';
|
|
107
107
|
export { confetti, createConfetti } from '@zakkster/lite-confetti';
|
|
108
108
|
export { createId, createIdGenerator } from '@zakkster/lite-id';
|
|
109
109
|
export { Vec2 } from '@zakkster/lite-vec';
|
|
@@ -154,7 +154,7 @@ import type {RainEngine} from '@zakkster/lite-rain';
|
|
|
154
154
|
import type {SnowEngine} from '@zakkster/lite-snow';
|
|
155
155
|
import type {SparkEngine} from '@zakkster/lite-sparks';
|
|
156
156
|
import type {FireworksEngine} from '@zakkster/lite-fireworks';
|
|
157
|
-
import type {
|
|
157
|
+
import type {GestureTracker} from '@zakkster/lite-gesture';
|
|
158
158
|
import type {Timeline} from '@zakkster/lite-timeline';
|
|
159
159
|
|
|
160
160
|
/** All recipes return at least a destroy() method. */
|
package/LiteEngine.js
CHANGED
|
@@ -98,11 +98,11 @@ 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 {
|
|
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
|
|
105
|
-
export {
|
|
105
|
+
export {GestureTracker} from '@zakkster/lite-gesture';
|
|
106
106
|
export {confetti, createConfetti} from '@zakkster/lite-confetti';
|
|
107
107
|
export {createId, createIdGenerator} from '@zakkster/lite-id';
|
|
108
108
|
export {Vec2} from '@zakkster/lite-vec';
|
|
@@ -163,9 +163,9 @@ 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 {
|
|
166
|
+
import {seedNoise, fbm2} from '@zakkster/lite-noise';
|
|
167
167
|
import {Timeline} from '@zakkster/lite-timeline';
|
|
168
|
-
import {
|
|
168
|
+
import {GestureTracker} from '@zakkster/lite-gesture';
|
|
169
169
|
import {confetti as confettiFn} from '@zakkster/lite-confetti';
|
|
170
170
|
import {createId} from '@zakkster/lite-id';
|
|
171
171
|
import {Vec2} from '@zakkster/lite-vec';
|
|
@@ -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
|
-
|
|
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 =
|
|
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
|
-
|
|
1057
|
+
seedNoise(s);
|
|
1058
1058
|
},
|
|
1059
1059
|
destroy() {
|
|
1060
1060
|
},
|
|
@@ -1284,7 +1284,7 @@ export const Recipes = {
|
|
|
1284
1284
|
}, destroy() {
|
|
1285
1285
|
}
|
|
1286
1286
|
};
|
|
1287
|
-
const gesture = new
|
|
1287
|
+
const gesture = new GestureTracker(el);
|
|
1288
1288
|
let currentIndex = 0, offsetX = 0;
|
|
1289
1289
|
const slideWidth = el.clientWidth || 300;
|
|
1290
1290
|
|
package/README.md
CHANGED
|
@@ -558,7 +558,7 @@ carousel.goTo(2);
|
|
|
558
558
|
console.log(carousel.getCurrentIndex()); // 2
|
|
559
559
|
```
|
|
560
560
|
|
|
561
|
-
**Composes:** `
|
|
561
|
+
**Composes:** `GestureTracker` (pan + panEnd with velocity) + `Timeline` + `easeOutCubic`
|
|
562
562
|
|
|
563
563
|
</details>
|
|
564
564
|
|
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.
|
|
4
|
+
"version": "2.0.4",
|
|
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",
|