jaml-ui 0.7.0 → 0.7.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/LICENSE +21 -21
- package/README.md +135 -135
- package/dist/hooks/searchWorkerCode.js +59 -59
- package/dist/ui/footer.js +5 -5
- package/package.json +107 -107
- package/dist/data/balatro-jokers.json +0 -1241
- package/dist/r3f/BalatroJokerMesh3D.d.ts +0 -8
- package/dist/r3f/BalatroJokerMesh3D.js +0 -98
- package/dist/r3f/BalatroJokerPreview3D.d.ts +0 -14
- package/dist/r3f/BalatroJokerPreview3D.js +0 -30
- package/dist/r3f/BalatroPlayingCard3D.d.ts +0 -22
- package/dist/r3f/BalatroPlayingCard3D.js +0 -62
- package/dist/r3f/cardConstants.d.ts +0 -16
- package/dist/r3f/cardConstants.js +0 -14
- package/dist/r3f/compositedAtlas.d.ts +0 -5
- package/dist/r3f/compositedAtlas.js +0 -56
- package/dist/r3f/gridUV.d.ts +0 -22
- package/dist/r3f/gridUV.js +0 -30
- package/dist/r3f/index.d.ts +0 -12
- package/dist/r3f/index.js +0 -13
- package/dist/r3f/jokerRegistry.d.ts +0 -28
- package/dist/r3f/jokerRegistry.js +0 -40
- package/dist/r3f/jokerTilt.d.ts +0 -8
- package/dist/r3f/jokerTilt.js +0 -41
- package/dist/r3f/magneticTilt.d.ts +0 -18
- package/dist/r3f/magneticTilt.js +0 -34
- package/dist/r3f/playingCardTypes.d.ts +0 -24
- package/dist/r3f/playingCardTypes.js +0 -32
- package/dist/r3f/playingCardVisuals.d.ts +0 -7
- package/dist/r3f/playingCardVisuals.js +0 -45
- package/dist/r3f/usePlayingCardTexture.d.ts +0 -7
- package/dist/r3f/usePlayingCardTexture.js +0 -92
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 pifreak
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pifreak
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
# jaml-ui
|
|
2
|
-
|
|
3
|
-
React components, UI tokens, sprites, and utilities for Balatro/JAML apps.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install jaml-ui react react-dom
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Package exports
|
|
12
|
-
|
|
13
|
-
| Entry | Contents |
|
|
14
|
-
|-------|----------|
|
|
15
|
-
| `jaml-ui` | Game card components, JAML IDE, Analyzer Explorer, hooks |
|
|
16
|
-
| `jaml-ui/ui` | Jimbo design system — JimboPanel, JimboButton, JimboModal, tokens |
|
|
17
|
-
| `jaml-ui/core` | Pure asset helpers, sprite metadata, decode utilities (no React) |
|
|
18
|
-
| `jaml-ui/motely` | motely-wasm decode helpers (requires `motely-wasm` peer) |
|
|
19
|
-
| `jaml-ui/r3f` | 3D card component via React Three Fiber (requires r3f peers) |
|
|
20
|
-
|
|
21
|
-
## Quick start
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
import { JamlGameCard, AnalyzerExplorer, JamlIde } from "jaml-ui";
|
|
25
|
-
import { JimboPanel, JimboButton } from "jaml-ui/ui";
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Game card
|
|
29
|
-
|
|
30
|
-
```tsx
|
|
31
|
-
import { JamlGameCard } from "jaml-ui";
|
|
32
|
-
|
|
33
|
-
<JamlGameCard
|
|
34
|
-
type="joker"
|
|
35
|
-
card={{ name: "Blueprint", edition: "Foil", isEternal: true, scale: 1.5 }}
|
|
36
|
-
/>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Jimbo UI (Balatro design system)
|
|
40
|
-
|
|
41
|
-
```tsx
|
|
42
|
-
import { JimboPanel, JimboButton, JimboModal } from "jaml-ui/ui";
|
|
43
|
-
import { JimboColorOption } from "jaml-ui/ui";
|
|
44
|
-
|
|
45
|
-
<JimboPanel sway onBack={() => setOpen(false)}>
|
|
46
|
-
<JimboButton variant="primary" onClick={handleSearch}>Search</JimboButton>
|
|
47
|
-
</JimboPanel>
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Available variants: `primary`, `secondary`, `danger`, `back`, `ghost`
|
|
51
|
-
|
|
52
|
-
### JAML IDE
|
|
53
|
-
|
|
54
|
-
```tsx
|
|
55
|
-
import { JamlIde } from "jaml-ui";
|
|
56
|
-
|
|
57
|
-
<JamlIde
|
|
58
|
-
jaml={jaml}
|
|
59
|
-
onChange={setJaml}
|
|
60
|
-
searchResults={results}
|
|
61
|
-
onSearch={handleSearch}
|
|
62
|
-
isSearching={isSearching}
|
|
63
|
-
/>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Analyzer Explorer
|
|
67
|
-
|
|
68
|
-
```tsx
|
|
69
|
-
import { AnalyzerExplorer } from "jaml-ui";
|
|
70
|
-
|
|
71
|
-
// antes: AnalyzerAnteView[] — stream from motely-wasm createSearchContext
|
|
72
|
-
<AnalyzerExplorer antes={antes} totalAntes={8} highlights={highlights} />
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### JAML Map Preview
|
|
76
|
-
|
|
77
|
-
```tsx
|
|
78
|
-
import { JamlMapPreview } from "jaml-ui";
|
|
79
|
-
|
|
80
|
-
<JamlMapPreview jaml={jaml} />
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Asset handling
|
|
84
|
-
|
|
85
|
-
By default sprites resolve from the package `assets/` directory via `import.meta.url`.
|
|
86
|
-
|
|
87
|
-
Override at app startup:
|
|
88
|
-
|
|
89
|
-
```ts
|
|
90
|
-
import { setJamlAssetBaseUrl, clearJamlAssetBaseUrl } from "jaml-ui";
|
|
91
|
-
|
|
92
|
-
setJamlAssetBaseUrl("/vendor/jaml-ui/"); // custom CDN
|
|
93
|
-
clearJamlAssetBaseUrl(); // back to default
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Core utilities
|
|
97
|
-
|
|
98
|
-
```ts
|
|
99
|
-
import { SPRITE_SHEETS, getSpriteData, resolveJamlAssetUrl } from "jaml-ui/core";
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Motely decode helpers
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
import { decodeMotelyItemName, motelyItemTypeName } from "jaml-ui/motely";
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## 3D card (optional)
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
npm install three @react-three/fiber @react-three/drei @react-spring/three
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
```tsx
|
|
115
|
-
import { Card3D } from "jaml-ui/r3f";
|
|
116
|
-
|
|
117
|
-
<Card3D itemName="Blueprint" />
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## Next.js
|
|
121
|
-
|
|
122
|
-
Import pure helpers from `jaml-ui/core` for server components. For local workspace installs add:
|
|
123
|
-
|
|
124
|
-
```ts
|
|
125
|
-
// next.config.ts
|
|
126
|
-
const nextConfig = { transpilePackages: ["jaml-ui"] };
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## Peer dependencies
|
|
130
|
-
|
|
131
|
-
| Peer | Required for |
|
|
132
|
-
|------|-------------|
|
|
133
|
-
| `react`, `react-dom` | All components |
|
|
134
|
-
| `motely-wasm ^10 \|\| ^11 \|\| ^12` | `jaml-ui/motely`, `AnalyzerExplorer` data |
|
|
135
|
-
| `three`, `@react-three/fiber`, `@react-three/drei`, `@react-spring/three` | `jaml-ui/r3f` only |
|
|
1
|
+
# jaml-ui
|
|
2
|
+
|
|
3
|
+
React components, UI tokens, sprites, and utilities for Balatro/JAML apps.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install jaml-ui react react-dom
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Package exports
|
|
12
|
+
|
|
13
|
+
| Entry | Contents |
|
|
14
|
+
|-------|----------|
|
|
15
|
+
| `jaml-ui` | Game card components, JAML IDE, Analyzer Explorer, hooks |
|
|
16
|
+
| `jaml-ui/ui` | Jimbo design system — JimboPanel, JimboButton, JimboModal, tokens |
|
|
17
|
+
| `jaml-ui/core` | Pure asset helpers, sprite metadata, decode utilities (no React) |
|
|
18
|
+
| `jaml-ui/motely` | motely-wasm decode helpers (requires `motely-wasm` peer) |
|
|
19
|
+
| `jaml-ui/r3f` | 3D card component via React Three Fiber (requires r3f peers) |
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { JamlGameCard, AnalyzerExplorer, JamlIde } from "jaml-ui";
|
|
25
|
+
import { JimboPanel, JimboButton } from "jaml-ui/ui";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Game card
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { JamlGameCard } from "jaml-ui";
|
|
32
|
+
|
|
33
|
+
<JamlGameCard
|
|
34
|
+
type="joker"
|
|
35
|
+
card={{ name: "Blueprint", edition: "Foil", isEternal: true, scale: 1.5 }}
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Jimbo UI (Balatro design system)
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { JimboPanel, JimboButton, JimboModal } from "jaml-ui/ui";
|
|
43
|
+
import { JimboColorOption } from "jaml-ui/ui";
|
|
44
|
+
|
|
45
|
+
<JimboPanel sway onBack={() => setOpen(false)}>
|
|
46
|
+
<JimboButton variant="primary" onClick={handleSearch}>Search</JimboButton>
|
|
47
|
+
</JimboPanel>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Available variants: `primary`, `secondary`, `danger`, `back`, `ghost`
|
|
51
|
+
|
|
52
|
+
### JAML IDE
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { JamlIde } from "jaml-ui";
|
|
56
|
+
|
|
57
|
+
<JamlIde
|
|
58
|
+
jaml={jaml}
|
|
59
|
+
onChange={setJaml}
|
|
60
|
+
searchResults={results}
|
|
61
|
+
onSearch={handleSearch}
|
|
62
|
+
isSearching={isSearching}
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Analyzer Explorer
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { AnalyzerExplorer } from "jaml-ui";
|
|
70
|
+
|
|
71
|
+
// antes: AnalyzerAnteView[] — stream from motely-wasm createSearchContext
|
|
72
|
+
<AnalyzerExplorer antes={antes} totalAntes={8} highlights={highlights} />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### JAML Map Preview
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { JamlMapPreview } from "jaml-ui";
|
|
79
|
+
|
|
80
|
+
<JamlMapPreview jaml={jaml} />
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Asset handling
|
|
84
|
+
|
|
85
|
+
By default sprites resolve from the package `assets/` directory via `import.meta.url`.
|
|
86
|
+
|
|
87
|
+
Override at app startup:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { setJamlAssetBaseUrl, clearJamlAssetBaseUrl } from "jaml-ui";
|
|
91
|
+
|
|
92
|
+
setJamlAssetBaseUrl("/vendor/jaml-ui/"); // custom CDN
|
|
93
|
+
clearJamlAssetBaseUrl(); // back to default
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Core utilities
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import { SPRITE_SHEETS, getSpriteData, resolveJamlAssetUrl } from "jaml-ui/core";
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Motely decode helpers
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { decodeMotelyItemName, motelyItemTypeName } from "jaml-ui/motely";
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 3D card (optional)
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm install three @react-three/fiber @react-three/drei @react-spring/three
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import { Card3D } from "jaml-ui/r3f";
|
|
116
|
+
|
|
117
|
+
<Card3D itemName="Blueprint" />
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Next.js
|
|
121
|
+
|
|
122
|
+
Import pure helpers from `jaml-ui/core` for server components. For local workspace installs add:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
// next.config.ts
|
|
126
|
+
const nextConfig = { transpilePackages: ["jaml-ui"] };
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Peer dependencies
|
|
130
|
+
|
|
131
|
+
| Peer | Required for |
|
|
132
|
+
|------|-------------|
|
|
133
|
+
| `react`, `react-dom` | All components |
|
|
134
|
+
| `motely-wasm ^10 \|\| ^11 \|\| ^12` | `jaml-ui/motely`, `AnalyzerExplorer` data |
|
|
135
|
+
| `three`, `@react-three/fiber`, `@react-three/drei`, `@react-spring/three` | `jaml-ui/r3f` only |
|
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
// Worker code as an inline string — created as a Blob URL at runtime.
|
|
2
2
|
// This avoids bundler/import.meta.url issues when shipped as an npm package.
|
|
3
|
-
export const SEARCH_WORKER_CODE = `
|
|
4
|
-
let MotelyWasm = null;
|
|
5
|
-
let MotelyWasmEvents = null;
|
|
6
|
-
let activeSearch = null;
|
|
7
|
-
|
|
8
|
-
self.addEventListener('message', async function(e) {
|
|
9
|
-
const msg = e.data;
|
|
10
|
-
|
|
11
|
-
if (msg.type === 'init') {
|
|
12
|
-
try {
|
|
13
|
-
const mod = await import(msg.url);
|
|
14
|
-
await mod.default.boot();
|
|
15
|
-
MotelyWasm = mod.MotelyWasm;
|
|
16
|
-
MotelyWasmEvents = mod.MotelyWasmEvents;
|
|
17
|
-
self.postMessage({ type: 'ready' });
|
|
18
|
-
} catch (err) {
|
|
19
|
-
self.postMessage({ type: 'error', message: String(err) });
|
|
20
|
-
}
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (msg.type === 'start') {
|
|
25
|
-
if (!MotelyWasm) { self.postMessage({ type: 'error', message: 'Not initialized' }); return; }
|
|
26
|
-
const validation = MotelyWasm.validateJaml(msg.jaml);
|
|
27
|
-
if (validation !== 'valid') { self.postMessage({ type: 'error', message: validation }); return; }
|
|
28
|
-
|
|
29
|
-
let rId, pId, cId;
|
|
30
|
-
function cleanup() {
|
|
31
|
-
MotelyWasmEvents.onResult.unsubscribeById(rId);
|
|
32
|
-
MotelyWasmEvents.onProgress.unsubscribeById(pId);
|
|
33
|
-
MotelyWasmEvents.onComplete.unsubscribeById(cId);
|
|
34
|
-
activeSearch = null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
rId = MotelyWasmEvents.onResult.subscribe(function(seed, score) {
|
|
38
|
-
self.postMessage({ type: 'result', seed, score });
|
|
39
|
-
});
|
|
40
|
-
pId = MotelyWasmEvents.onProgress.subscribe(function(searched, matching) {
|
|
41
|
-
self.postMessage({ type: 'progress', searched: searched.toString(), matching: matching.toString() });
|
|
42
|
-
});
|
|
43
|
-
cId = MotelyWasmEvents.onComplete.subscribe(function(status, searched, matched) {
|
|
44
|
-
cleanup();
|
|
45
|
-
self.postMessage({ type: 'complete', status, searched: searched.toString(), matched: matched.toString() });
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
activeSearch = MotelyWasm.startRandomSearch(msg.jaml, msg.count);
|
|
50
|
-
} catch (err) {
|
|
51
|
-
cleanup();
|
|
52
|
-
self.postMessage({ type: 'error', message: String(err) });
|
|
53
|
-
}
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (msg.type === 'stop') {
|
|
58
|
-
if (activeSearch) { activeSearch.cancel(); activeSearch = null; }
|
|
59
|
-
self.postMessage({ type: 'cancelled' });
|
|
60
|
-
}
|
|
61
|
-
});
|
|
3
|
+
export const SEARCH_WORKER_CODE = `
|
|
4
|
+
let MotelyWasm = null;
|
|
5
|
+
let MotelyWasmEvents = null;
|
|
6
|
+
let activeSearch = null;
|
|
7
|
+
|
|
8
|
+
self.addEventListener('message', async function(e) {
|
|
9
|
+
const msg = e.data;
|
|
10
|
+
|
|
11
|
+
if (msg.type === 'init') {
|
|
12
|
+
try {
|
|
13
|
+
const mod = await import(msg.url);
|
|
14
|
+
await mod.default.boot();
|
|
15
|
+
MotelyWasm = mod.MotelyWasm;
|
|
16
|
+
MotelyWasmEvents = mod.MotelyWasmEvents;
|
|
17
|
+
self.postMessage({ type: 'ready' });
|
|
18
|
+
} catch (err) {
|
|
19
|
+
self.postMessage({ type: 'error', message: String(err) });
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (msg.type === 'start') {
|
|
25
|
+
if (!MotelyWasm) { self.postMessage({ type: 'error', message: 'Not initialized' }); return; }
|
|
26
|
+
const validation = MotelyWasm.validateJaml(msg.jaml);
|
|
27
|
+
if (validation !== 'valid') { self.postMessage({ type: 'error', message: validation }); return; }
|
|
28
|
+
|
|
29
|
+
let rId, pId, cId;
|
|
30
|
+
function cleanup() {
|
|
31
|
+
MotelyWasmEvents.onResult.unsubscribeById(rId);
|
|
32
|
+
MotelyWasmEvents.onProgress.unsubscribeById(pId);
|
|
33
|
+
MotelyWasmEvents.onComplete.unsubscribeById(cId);
|
|
34
|
+
activeSearch = null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
rId = MotelyWasmEvents.onResult.subscribe(function(seed, score) {
|
|
38
|
+
self.postMessage({ type: 'result', seed, score });
|
|
39
|
+
});
|
|
40
|
+
pId = MotelyWasmEvents.onProgress.subscribe(function(searched, matching) {
|
|
41
|
+
self.postMessage({ type: 'progress', searched: searched.toString(), matching: matching.toString() });
|
|
42
|
+
});
|
|
43
|
+
cId = MotelyWasmEvents.onComplete.subscribe(function(status, searched, matched) {
|
|
44
|
+
cleanup();
|
|
45
|
+
self.postMessage({ type: 'complete', status, searched: searched.toString(), matched: matched.toString() });
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
activeSearch = MotelyWasm.startRandomSearch(msg.jaml, msg.count);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
cleanup();
|
|
52
|
+
self.postMessage({ type: 'error', message: String(err) });
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (msg.type === 'stop') {
|
|
58
|
+
if (activeSearch) { activeSearch.cancel(); activeSearch = null; }
|
|
59
|
+
self.postMessage({ type: 'cancelled' });
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
62
|
`;
|
package/dist/ui/footer.js
CHANGED
|
@@ -9,10 +9,10 @@ const SUITS = [
|
|
|
9
9
|
];
|
|
10
10
|
const CYCLE = '5s';
|
|
11
11
|
export function JimboBalatroFooter({ hidden = false, className = '' }) {
|
|
12
|
-
return (_jsxs("div", { className: ['fixed right-0 bottom-0 left-0 w-screen min-w-full transition-opacity duration-200', hidden ? 'pointer-events-none opacity-0' : 'opacity-100', className].filter(Boolean).join(' '), children: [_jsx("div", { style: { width: '100%', borderTop: '1px solid rgba(255,255,255,0.1)', background: 'rgba(0,0,0,0.9)', padding: '0 1rem 3px', textAlign: 'center' }, children: _jsxs("p", { style: { fontFamily: 'm6x11plus, monospace', fontSize: 'clamp(11px, 0.8vw + 8px, 14px)', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center', gap: '0 0.5rem', color: 'white', margin: 0 }, children: [_jsx("span", { children: "Not affiliated with LocalThunk or PlayStack" }), _jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', gap: '0.25rem' }, children: ["Made with", ' ', _jsx("span", { style: { position: 'relative', display: 'inline-block', width: '1.5em', height: '1em', verticalAlign: 'middle' }, children: SUITS.map(({ char, kf }) => (_jsx("span", { style: { position: 'absolute', inset: 0, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', opacity: 0, animationName: kf, animationDuration: CYCLE, animationDelay: '0s', animationIterationCount: 'infinite', animationTimingFunction: 'ease-out' }, children: char }, char))) }), ' ', "for the", ' ', _jsx("a", { href: "https://playbalatro.com", target: "_blank", rel: "noopener noreferrer", style: { color: JimboColorOption.GOLD, textDecoration: 'none' }, children: "Balatro" }), ' ', "community"] })] }) }), _jsx("style", { children: `
|
|
13
|
-
@keyframes jaml-heart { 0%{opacity:0;transform:scale(1)} 1%{opacity:1;transform:scale(1.45)} 3.5%{opacity:1;transform:scale(1)} 61.5%{opacity:1;transform:scale(1)} 62%{opacity:0} 100%{opacity:0} }
|
|
14
|
-
@keyframes jaml-spade { 0%,61.5%{opacity:0} 62%{opacity:1;transform:scale(1.45)} 64.5%{opacity:1;transform:scale(1)} 71.5%{opacity:1} 72%{opacity:0} 100%{opacity:0} }
|
|
15
|
-
@keyframes jaml-diamond { 0%,71.5%{opacity:0} 72%{opacity:1;transform:scale(1.45)} 74.5%{opacity:1;transform:scale(1)} 81.5%{opacity:1} 82%{opacity:0} 100%{opacity:0} }
|
|
16
|
-
@keyframes jaml-club { 0%,81.5%{opacity:0} 82%{opacity:1;transform:scale(1.45)} 84.5%{opacity:1;transform:scale(1)} 95%{opacity:1} 96%{opacity:0} 100%{opacity:0} }
|
|
12
|
+
return (_jsxs("div", { className: ['fixed right-0 bottom-0 left-0 w-screen min-w-full transition-opacity duration-200', hidden ? 'pointer-events-none opacity-0' : 'opacity-100', className].filter(Boolean).join(' '), children: [_jsx("div", { style: { width: '100%', borderTop: '1px solid rgba(255,255,255,0.1)', background: 'rgba(0,0,0,0.9)', padding: '0 1rem 3px', textAlign: 'center' }, children: _jsxs("p", { style: { fontFamily: 'm6x11plus, monospace', fontSize: 'clamp(11px, 0.8vw + 8px, 14px)', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center', gap: '0 0.5rem', color: 'white', margin: 0 }, children: [_jsx("span", { children: "Not affiliated with LocalThunk or PlayStack" }), _jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', gap: '0.25rem' }, children: ["Made with", ' ', _jsx("span", { style: { position: 'relative', display: 'inline-block', width: '1.5em', height: '1em', verticalAlign: 'middle' }, children: SUITS.map(({ char, kf }) => (_jsx("span", { style: { position: 'absolute', inset: 0, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', opacity: 0, animationName: kf, animationDuration: CYCLE, animationDelay: '0s', animationIterationCount: 'infinite', animationTimingFunction: 'ease-out' }, children: char }, char))) }), ' ', "for the", ' ', _jsx("a", { href: "https://playbalatro.com", target: "_blank", rel: "noopener noreferrer", style: { color: JimboColorOption.GOLD, textDecoration: 'none' }, children: "Balatro" }), ' ', "community"] })] }) }), _jsx("style", { children: `
|
|
13
|
+
@keyframes jaml-heart { 0%{opacity:0;transform:scale(1)} 1%{opacity:1;transform:scale(1.45)} 3.5%{opacity:1;transform:scale(1)} 61.5%{opacity:1;transform:scale(1)} 62%{opacity:0} 100%{opacity:0} }
|
|
14
|
+
@keyframes jaml-spade { 0%,61.5%{opacity:0} 62%{opacity:1;transform:scale(1.45)} 64.5%{opacity:1;transform:scale(1)} 71.5%{opacity:1} 72%{opacity:0} 100%{opacity:0} }
|
|
15
|
+
@keyframes jaml-diamond { 0%,71.5%{opacity:0} 72%{opacity:1;transform:scale(1.45)} 74.5%{opacity:1;transform:scale(1)} 81.5%{opacity:1} 82%{opacity:0} 100%{opacity:0} }
|
|
16
|
+
@keyframes jaml-club { 0%,81.5%{opacity:0} 82%{opacity:1;transform:scale(1.45)} 84.5%{opacity:1;transform:scale(1)} 95%{opacity:1} 96%{opacity:0} 100%{opacity:0} }
|
|
17
17
|
` })] }));
|
|
18
18
|
}
|