@zakkster/lite-scratch-fx 1.3.0 → 1.3.1
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 +12 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/src/ScratchRecipes.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.1] - 2026-08-22
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **`PeelRecipe`** -- removed a per-frame forced synchronous layout read. `tick`
|
|
7
|
+
previously read `src.offsetWidth` (a layout property) inside the transform
|
|
8
|
+
template string on every frame, immediately after writing `style.transform` /
|
|
9
|
+
`style.transformOrigin`, forcing a synchronous reflow each frame while a peel
|
|
10
|
+
reveal was active. The source layer's logical width is now captured once in
|
|
11
|
+
`init` (the engine already measures it to size the effect canvas and passes it
|
|
12
|
+
as `w`) and reused, so the per-frame `tick` body is write-only. No visual or
|
|
13
|
+
API change.
|
|
14
|
+
|
|
3
15
|
## [1.3.0] - 2026-08-22
|
|
4
16
|
|
|
5
17
|
Abortable, self-restoring reveals. A reveal can now be cancelled, and the host scratch
|
package/index.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
// Three-place version sync: this constant, package.json "version", and the top
|
|
15
15
|
// CHANGELOG.md heading must always match. /release keeps them locked.
|
|
16
|
-
export const VERSION = '1.3.
|
|
16
|
+
export const VERSION = '1.3.1';
|
|
17
17
|
|
|
18
18
|
export { createScratchController } from './src/ScratchController.js';
|
|
19
19
|
export { default as ScratchController } from './src/ScratchController.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-scratch-fx",
|
|
3
3
|
"author": "Zahary Shinikchiev <shinikchiev@yahoo.com>",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"description": "One-shot scratch-card reveal effects on canvas. A controller scans the still-covered pixels of a scratch layer, spawns particles from them, and delegates physics and rendering to a recipe. 21 themeable recipes (burn, shatter, dissolve, glitch, gold dust, cosmic dust, and more), a registry with a register hook, zero GSAP, a zero-GC hot path, deterministic seeded RNG, and a stage that runs a grid of simultaneous reveals over one shared pool.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
package/src/ScratchRecipes.js
CHANGED
|
@@ -1151,9 +1151,11 @@ export function NeonPulseRecipe({duration = 800, colors, theme} = {}) {
|
|
|
1151
1151
|
// ===========================================================================
|
|
1152
1152
|
|
|
1153
1153
|
export function PeelRecipe({duration = 1000} = {}) {
|
|
1154
|
+
let peelW = 0;
|
|
1154
1155
|
return {
|
|
1155
1156
|
count: 0,
|
|
1156
|
-
init() {
|
|
1157
|
+
init(ctx, capacity, w) {
|
|
1158
|
+
peelW = w > 0 ? w : 0;
|
|
1157
1159
|
},
|
|
1158
1160
|
spawn() {
|
|
1159
1161
|
return {x: 0, y: 0, vx: 0, vy: 0, life: 0};
|
|
@@ -1162,7 +1164,7 @@ export function PeelRecipe({duration = 1000} = {}) {
|
|
|
1162
1164
|
const raw = clamp(elapsed / duration, 0, 1);
|
|
1163
1165
|
const t = easeIn(raw);
|
|
1164
1166
|
src.style.transformOrigin = 'right center';
|
|
1165
|
-
src.style.transform = `perspective(800px) rotateY(${t * 90}deg) rotateX(${t * -20}deg) translateX(${t *
|
|
1167
|
+
src.style.transform = `perspective(800px) rotateY(${t * 90}deg) rotateX(${t * -20}deg) translateX(${t * peelW}px)`;
|
|
1166
1168
|
src.style.opacity = 1 - t;
|
|
1167
1169
|
if (raw >= 1) {
|
|
1168
1170
|
src.style.transform = '';
|