git-hash-art 0.0.4 → 0.2.0
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/.kiro/steering/product.md +16 -0
- package/.kiro/steering/structure.md +40 -0
- package/.kiro/steering/tech.md +24 -0
- package/CHANGELOG.md +18 -1
- package/README.md +165 -57
- package/dist/browser.js +1183 -0
- package/dist/browser.js.map +1 -0
- package/dist/main.js +424 -330
- package/dist/main.js.map +1 -1
- package/dist/module.js +417 -326
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +2 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +47 -3
- package/src/__tests__/compatibility.test.ts +42 -0
- package/src/__tests__/generation.test.ts +58 -0
- package/src/__tests__/render.test.ts +81 -0
- package/src/__tests__/shapes.test.ts +71 -0
- package/src/browser.ts +105 -0
- package/src/index.ts +39 -200
- package/src/lib/canvas/colors.ts +90 -66
- package/src/lib/canvas/draw.ts +38 -7
- package/src/lib/canvas/shapes/basic.ts +1 -1
- package/src/lib/canvas/shapes/complex.ts +4 -1
- package/src/lib/render.ts +152 -0
- package/src/lib/utils.ts +33 -6
- package/src/types.ts +35 -0
package/dist/module.js
CHANGED
|
@@ -1,34 +1,198 @@
|
|
|
1
|
-
import {createCanvas as $
|
|
2
|
-
import $
|
|
3
|
-
import $
|
|
4
|
-
import $
|
|
5
|
-
|
|
1
|
+
import {createCanvas as $4RUNL$createCanvas} from "@napi-rs/canvas";
|
|
2
|
+
import {existsSync as $4RUNL$existsSync, mkdirSync as $4RUNL$mkdirSync, writeFileSync as $4RUNL$writeFileSync} from "fs";
|
|
3
|
+
import {join as $4RUNL$join} from "path";
|
|
4
|
+
import $4RUNL$colorscheme from "color-scheme";
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Pure rendering logic — environment-agnostic.
|
|
11
|
+
*
|
|
12
|
+
* This module only uses the standard CanvasRenderingContext2D API,
|
|
13
|
+
* so it works identically in Node (@napi-rs/canvas) and browsers
|
|
14
|
+
* (HTMLCanvasElement).
|
|
15
|
+
*/
|
|
10
16
|
// declare module 'color-scheme';
|
|
11
17
|
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
function $461134e0b6ce0619$export$39a95c82b20fdf81(gitHash) {
|
|
20
|
+
return parseInt(gitHash.slice(0, 8), 16);
|
|
21
|
+
}
|
|
22
|
+
function $461134e0b6ce0619$export$eaf9227667332084(seed) {
|
|
23
|
+
let s = seed | 0;
|
|
24
|
+
return ()=>{
|
|
25
|
+
s = s + 0x6d2b79f5 | 0;
|
|
26
|
+
let t = Math.imul(s ^ s >>> 15, 1 | s);
|
|
27
|
+
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
28
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function $461134e0b6ce0619$export$e9cc707de01b7042(hash, offset = 0) {
|
|
32
|
+
let h = 0;
|
|
33
|
+
for(let i = 0; i < hash.length; i++)h = Math.imul(31, h) + hash.charCodeAt(i) | 0;
|
|
34
|
+
return h + offset | 0;
|
|
35
|
+
}
|
|
36
|
+
function $461134e0b6ce0619$export$6b193cae730c547a(hash, index, min, max) {
|
|
37
|
+
const rng = $461134e0b6ce0619$export$eaf9227667332084($461134e0b6ce0619$export$e9cc707de01b7042(hash, index));
|
|
38
|
+
return min + rng() * (max - min);
|
|
39
|
+
}
|
|
40
|
+
const $461134e0b6ce0619$export$bb9e4790bc99ae59 = {
|
|
41
|
+
GOLDEN_RATIO: 1.618034,
|
|
42
|
+
SQUARE_ROOT_2: Math.sqrt(2),
|
|
43
|
+
SQUARE_ROOT_3: Math.sqrt(3),
|
|
44
|
+
SQUARE_ROOT_5: Math.sqrt(5),
|
|
45
|
+
PI: Math.PI,
|
|
46
|
+
PHI: (1 + Math.sqrt(5)) / 2
|
|
47
|
+
};
|
|
48
|
+
class $461134e0b6ce0619$export$da2372f11bc66b3f {
|
|
49
|
+
static getProportionalSize(baseSize, proportion) {
|
|
50
|
+
return baseSize * proportion;
|
|
51
|
+
}
|
|
52
|
+
static centerPattern(ctx, width, height) {
|
|
53
|
+
ctx.translate(width / 2, height / 2);
|
|
54
|
+
}
|
|
55
|
+
// Combines sacred geometry patterns with proper proportions
|
|
56
|
+
static layerPatterns(ctx, patterns, config) {
|
|
57
|
+
const { baseSize: baseSize, baseOpacity: baseOpacity = 0.6, opacityReduction: opacityReduction = 0.1, rotationOffset: rotationOffset = 0, proportionType: proportionType = "GOLDEN_RATIO" } = config;
|
|
58
|
+
patterns.forEach((pattern, index)=>{
|
|
59
|
+
const size = this.getProportionalSize(baseSize, Math.pow($461134e0b6ce0619$export$bb9e4790bc99ae59[proportionType], index));
|
|
60
|
+
const opacity = Math.max(0.1, baseOpacity - index * opacityReduction);
|
|
61
|
+
const rotation = rotationOffset * index;
|
|
62
|
+
ctx.save();
|
|
63
|
+
ctx.globalAlpha = opacity;
|
|
64
|
+
ctx.rotate(rotation * Math.PI / 180);
|
|
65
|
+
shapes[pattern.type](ctx, size, pattern.config);
|
|
66
|
+
ctx.restore();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
function $9d614e7d77fc2947$export$f116a24fd288e742(gitHash) {
|
|
73
|
+
const seed = (0, $461134e0b6ce0619$export$39a95c82b20fdf81)(gitHash);
|
|
74
|
+
const scheme = new (0, $4RUNL$colorscheme)();
|
|
75
|
+
scheme.from_hue(seed % 360).scheme("analogic").variation("soft");
|
|
76
|
+
let colors = scheme.colors().map((hex)=>`#${hex}`);
|
|
77
|
+
const contrastingHue = (seed + 180) % 360;
|
|
78
|
+
const contrastingScheme = new (0, $4RUNL$colorscheme)();
|
|
79
|
+
contrastingScheme.from_hue(contrastingHue).scheme("mono").variation("soft");
|
|
80
|
+
colors.push(`#${contrastingScheme.colors()[0]}`);
|
|
81
|
+
return colors;
|
|
82
|
+
}
|
|
83
|
+
class $9d614e7d77fc2947$export$ab958c550f521376 {
|
|
84
|
+
seed;
|
|
85
|
+
baseScheme;
|
|
86
|
+
complementaryScheme;
|
|
87
|
+
triadicScheme;
|
|
88
|
+
metallic;
|
|
89
|
+
constructor(gitHash){
|
|
90
|
+
this.seed = (0, $461134e0b6ce0619$export$39a95c82b20fdf81)(gitHash);
|
|
91
|
+
this.baseScheme = this.generateBaseScheme();
|
|
92
|
+
this.complementaryScheme = this.generateComplementaryScheme();
|
|
93
|
+
this.triadicScheme = this.generateTriadicScheme();
|
|
94
|
+
this.metallic = this.generateMetallicColors();
|
|
95
|
+
}
|
|
96
|
+
generateBaseScheme() {
|
|
97
|
+
const scheme = new (0, $4RUNL$colorscheme)();
|
|
98
|
+
return scheme.from_hue(this.seed % 360).scheme("analogic").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
99
|
+
}
|
|
100
|
+
generateComplementaryScheme() {
|
|
101
|
+
const complementaryHue = (this.seed + 180) % 360;
|
|
102
|
+
const scheme = new (0, $4RUNL$colorscheme)();
|
|
103
|
+
return scheme.from_hue(complementaryHue).scheme("mono").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
104
|
+
}
|
|
105
|
+
generateTriadicScheme() {
|
|
106
|
+
const triadicHue = (this.seed + 120) % 360;
|
|
107
|
+
const scheme = new (0, $4RUNL$colorscheme)();
|
|
108
|
+
return scheme.from_hue(triadicHue).scheme("triade").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
109
|
+
}
|
|
110
|
+
generateMetallicColors() {
|
|
111
|
+
return {
|
|
112
|
+
gold: "#FFD700",
|
|
113
|
+
silver: "#C0C0C0",
|
|
114
|
+
copper: "#B87333",
|
|
115
|
+
bronze: "#CD7F32"
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Returns a flat array of hash-derived colors suitable for art generation.
|
|
120
|
+
* Combines base analogic, complementary, and triadic schemes for variety
|
|
121
|
+
* while maintaining color harmony.
|
|
122
|
+
*/ getColors() {
|
|
123
|
+
// Deduplicate and return a rich palette
|
|
124
|
+
const all = [
|
|
125
|
+
...this.baseScheme.slice(0, 4),
|
|
126
|
+
...this.complementaryScheme.slice(0, 2),
|
|
127
|
+
...this.triadicScheme.slice(0, 2)
|
|
128
|
+
];
|
|
129
|
+
return [
|
|
130
|
+
...new Set(all)
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Returns two background colors derived from the hash — darker variants
|
|
135
|
+
* of the base scheme for gradient backgrounds.
|
|
136
|
+
*/ getBackgroundColors() {
|
|
137
|
+
return [
|
|
138
|
+
this.darken(this.baseScheme[0], 0.65),
|
|
139
|
+
this.darken(this.baseScheme[1], 0.55)
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Simple hex color darkening by a factor (0 = black, 1 = unchanged).
|
|
144
|
+
*/ darken(hex, factor) {
|
|
145
|
+
const c = hex.replace("#", "");
|
|
146
|
+
const r = Math.round(parseInt(c.substring(0, 2), 16) * factor);
|
|
147
|
+
const g = Math.round(parseInt(c.substring(2, 4), 16) * factor);
|
|
148
|
+
const b = Math.round(parseInt(c.substring(4, 6), 16) * factor);
|
|
149
|
+
return `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// ── Standalone color utilities ──────────────────────────────────────
|
|
153
|
+
/** Parse a hex color (#RRGGBB) into [r, g, b] 0-255. */ function $9d614e7d77fc2947$var$hexToRgb(hex) {
|
|
154
|
+
const c = hex.replace("#", "");
|
|
155
|
+
return [
|
|
156
|
+
parseInt(c.substring(0, 2), 16),
|
|
157
|
+
parseInt(c.substring(2, 4), 16),
|
|
158
|
+
parseInt(c.substring(4, 6), 16)
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
/** Format [r, g, b] back to #RRGGBB. */ function $9d614e7d77fc2947$var$rgbToHex(r, g, b) {
|
|
162
|
+
const clamp = (v)=>Math.max(0, Math.min(255, Math.round(v)));
|
|
163
|
+
return `#${clamp(r).toString(16).padStart(2, "0")}${clamp(g).toString(16).padStart(2, "0")}${clamp(b).toString(16).padStart(2, "0")}`;
|
|
164
|
+
}
|
|
165
|
+
function $9d614e7d77fc2947$export$f2121afcad3d553f(hex, alpha) {
|
|
166
|
+
const [r, g, b] = $9d614e7d77fc2947$var$hexToRgb(hex);
|
|
167
|
+
return `rgba(${r},${g},${b},${alpha.toFixed(3)})`;
|
|
168
|
+
}
|
|
169
|
+
function $9d614e7d77fc2947$export$59539d800dbe6858(hex, rng, amount = 0.1) {
|
|
170
|
+
const [r, g, b] = $9d614e7d77fc2947$var$hexToRgb(hex);
|
|
171
|
+
const jit = ()=>(rng() - 0.5) * 2 * amount * 255;
|
|
172
|
+
return $9d614e7d77fc2947$var$rgbToHex(r + jit(), g + jit(), b + jit());
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
const $f225038c018b3815$export$8daab6f91f7ff730 = (ctx, size)=>{
|
|
14
178
|
ctx.beginPath();
|
|
15
179
|
ctx.arc(0, 0, size / 2, 0, Math.PI * 2);
|
|
16
180
|
};
|
|
17
|
-
const $
|
|
181
|
+
const $f225038c018b3815$export$9340b6a85ea854b9 = (ctx, size)=>{
|
|
18
182
|
ctx.beginPath();
|
|
19
183
|
ctx.rect(-size / 2, -size / 2, size, size);
|
|
20
184
|
};
|
|
21
|
-
const $
|
|
185
|
+
const $f225038c018b3815$export$e6b70c7883316010 = (ctx, size)=>{
|
|
22
186
|
ctx.beginPath();
|
|
23
187
|
ctx.moveTo(0, -size / 2);
|
|
24
188
|
ctx.lineTo(-size / 2, size / 2);
|
|
25
189
|
ctx.lineTo(size / 2, size / 2);
|
|
26
190
|
ctx.closePath();
|
|
27
191
|
};
|
|
28
|
-
const $
|
|
192
|
+
const $f225038c018b3815$export$252d2895fb67397b = (ctx, size)=>{
|
|
29
193
|
ctx.beginPath();
|
|
30
194
|
for(let i = 0; i < 6; i++){
|
|
31
|
-
const angle = Math.PI /
|
|
195
|
+
const angle = Math.PI * 2 / 6 * i;
|
|
32
196
|
const x = size / 2 * Math.cos(angle);
|
|
33
197
|
const y = size / 2 * Math.sin(angle);
|
|
34
198
|
if (i === 0) ctx.moveTo(x, y);
|
|
@@ -36,7 +200,7 @@ const $44f5b87a40c9680b$export$252d2895fb67397b = (ctx, size)=>{
|
|
|
36
200
|
}
|
|
37
201
|
ctx.closePath();
|
|
38
202
|
};
|
|
39
|
-
const $
|
|
203
|
+
const $f225038c018b3815$export$ca57b923902a3c0 = (ctx, size)=>{
|
|
40
204
|
ctx.beginPath();
|
|
41
205
|
for(let i = 0; i < 10; i++){
|
|
42
206
|
const angle = Math.PI / 5 + Math.PI / 5 * i * 3;
|
|
@@ -48,7 +212,7 @@ const $44f5b87a40c9680b$export$ca57b923902a3c0 = (ctx, size)=>{
|
|
|
48
212
|
}
|
|
49
213
|
ctx.closePath();
|
|
50
214
|
};
|
|
51
|
-
const $
|
|
215
|
+
const $f225038c018b3815$export$cf8f2f05ac4f561f = (ctx, size)=>{
|
|
52
216
|
ctx.beginPath();
|
|
53
217
|
for(let i = 0; i < 10; i++){
|
|
54
218
|
const angle = Math.PI / 30 + Math.PI / 30 * i * 8;
|
|
@@ -60,13 +224,13 @@ const $44f5b87a40c9680b$export$cf8f2f05ac4f561f = (ctx, size)=>{
|
|
|
60
224
|
}
|
|
61
225
|
ctx.closePath();
|
|
62
226
|
};
|
|
63
|
-
const $
|
|
227
|
+
const $f225038c018b3815$export$1ed0c0bc398b6246 = (ctx, size)=>{
|
|
64
228
|
ctx.beginPath();
|
|
65
229
|
ctx.moveTo(0, size / 4);
|
|
66
230
|
ctx.quadraticCurveTo(size / 2, size / 4, 0, -size / 4);
|
|
67
231
|
ctx.quadraticCurveTo(-size / 2, size / 4, 0, size / 4);
|
|
68
232
|
};
|
|
69
|
-
const $
|
|
233
|
+
const $f225038c018b3815$export$57ec12daf141ce6 = (ctx, size)=>{
|
|
70
234
|
ctx.beginPath();
|
|
71
235
|
ctx.moveTo(0, -size / 2);
|
|
72
236
|
ctx.lineTo(size / 2, 0);
|
|
@@ -74,7 +238,7 @@ const $44f5b87a40c9680b$export$57ec12daf141ce6 = (ctx, size)=>{
|
|
|
74
238
|
ctx.lineTo(-size / 2, 0);
|
|
75
239
|
ctx.closePath();
|
|
76
240
|
};
|
|
77
|
-
const $
|
|
241
|
+
const $f225038c018b3815$export$39f25a4fc5491539 = (ctx, size)=>{
|
|
78
242
|
ctx.beginPath();
|
|
79
243
|
ctx.moveTo(-size / 2, -size / 2);
|
|
80
244
|
ctx.lineTo(size / 2, -size / 2);
|
|
@@ -82,21 +246,21 @@ const $44f5b87a40c9680b$export$39f25a4fc5491539 = (ctx, size)=>{
|
|
|
82
246
|
ctx.lineTo(-size / 2, size / 2);
|
|
83
247
|
ctx.closePath();
|
|
84
248
|
};
|
|
85
|
-
const $
|
|
86
|
-
circle: $
|
|
87
|
-
square: $
|
|
88
|
-
triangle: $
|
|
89
|
-
hexagon: $
|
|
90
|
-
star: $
|
|
91
|
-
"jacked-star": $
|
|
92
|
-
heart: $
|
|
93
|
-
diamond: $
|
|
94
|
-
cube: $
|
|
249
|
+
const $f225038c018b3815$export$492753207a5258e1 = {
|
|
250
|
+
circle: $f225038c018b3815$export$8daab6f91f7ff730,
|
|
251
|
+
square: $f225038c018b3815$export$9340b6a85ea854b9,
|
|
252
|
+
triangle: $f225038c018b3815$export$e6b70c7883316010,
|
|
253
|
+
hexagon: $f225038c018b3815$export$252d2895fb67397b,
|
|
254
|
+
star: $f225038c018b3815$export$ca57b923902a3c0,
|
|
255
|
+
"jacked-star": $f225038c018b3815$export$cf8f2f05ac4f561f,
|
|
256
|
+
heart: $f225038c018b3815$export$1ed0c0bc398b6246,
|
|
257
|
+
diamond: $f225038c018b3815$export$57ec12daf141ce6,
|
|
258
|
+
cube: $f225038c018b3815$export$39f25a4fc5491539
|
|
95
259
|
};
|
|
96
260
|
|
|
97
261
|
|
|
98
262
|
// Define interfaces for our configurations
|
|
99
|
-
const $
|
|
263
|
+
const $4e82a5352fbc7b27$export$9265403940be6b4 = {
|
|
100
264
|
// Standard sizes with different hashes
|
|
101
265
|
react: {
|
|
102
266
|
hash: "46192e59d42f741c761cbea79462a8b3815dd905",
|
|
@@ -186,7 +350,7 @@ const $e0ea14d2e2f06463$export$9265403940be6b4 = {
|
|
|
186
350
|
maxShapeSize: 250
|
|
187
351
|
}
|
|
188
352
|
};
|
|
189
|
-
const $
|
|
353
|
+
const $4e82a5352fbc7b27$export$3572305709b6b48c = {
|
|
190
354
|
strokeStyle: "#000000",
|
|
191
355
|
fillStyle: "transparent",
|
|
192
356
|
lineWidth: 1,
|
|
@@ -194,12 +358,12 @@ const $e0ea14d2e2f06463$export$3572305709b6b48c = {
|
|
|
194
358
|
iterations: 1,
|
|
195
359
|
animate: false
|
|
196
360
|
};
|
|
197
|
-
const $
|
|
361
|
+
const $4e82a5352fbc7b27$export$a4ca1369b6d2c19e = {
|
|
198
362
|
BASIC: "basic",
|
|
199
363
|
DETAILED: "detailed",
|
|
200
364
|
ANIMATED: "animated"
|
|
201
365
|
};
|
|
202
|
-
const $
|
|
366
|
+
const $4e82a5352fbc7b27$export$bb9e4790bc99ae59 = {
|
|
203
367
|
GOLDEN_RATIO: 1.618034,
|
|
204
368
|
SQUARE_ROOT_2: Math.sqrt(2),
|
|
205
369
|
SQUARE_ROOT_3: Math.sqrt(3),
|
|
@@ -207,7 +371,7 @@ const $e0ea14d2e2f06463$export$bb9e4790bc99ae59 = {
|
|
|
207
371
|
PI: Math.PI,
|
|
208
372
|
PHI: (1 + Math.sqrt(5)) / 2
|
|
209
373
|
};
|
|
210
|
-
const $
|
|
374
|
+
const $4e82a5352fbc7b27$export$c36defeab44ba3b3 = {
|
|
211
375
|
flowerOfLifeMandala: (size)=>[
|
|
212
376
|
// { type: "flowerOfLife", config: { size } },
|
|
213
377
|
{
|
|
@@ -264,25 +428,25 @@ const $e0ea14d2e2f06463$export$c36defeab44ba3b3 = {
|
|
|
264
428
|
};
|
|
265
429
|
|
|
266
430
|
|
|
267
|
-
const $
|
|
268
|
-
const $
|
|
431
|
+
const $79312e33271883e9$export$e6bfdeff8bfc94f9 = (degrees)=>degrees * Math.PI / 180;
|
|
432
|
+
const $79312e33271883e9$export$e46c5570db033611 = (ctx, size, config)=>{
|
|
269
433
|
ctx.save();
|
|
270
434
|
ctx.translate(0, 0);
|
|
271
|
-
if (config.rotation) ctx.rotate($
|
|
435
|
+
if (config.rotation) ctx.rotate($79312e33271883e9$export$e6bfdeff8bfc94f9(config.rotation));
|
|
272
436
|
ctx.lineWidth = config.lineWidth;
|
|
273
437
|
ctx.strokeStyle = config.strokeStyle;
|
|
274
438
|
ctx.fillStyle = config.fillStyle;
|
|
275
439
|
};
|
|
276
|
-
const $
|
|
440
|
+
const $79312e33271883e9$export$68ae68d395d27fd1 = (ctx)=>{
|
|
277
441
|
ctx.restore();
|
|
278
442
|
};
|
|
279
|
-
const $
|
|
443
|
+
const $79312e33271883e9$export$70ba51ca253810ef = (type)=>({
|
|
280
444
|
enabled: false,
|
|
281
445
|
duration: 1000,
|
|
282
446
|
easing: "linear",
|
|
283
447
|
type: type
|
|
284
448
|
});
|
|
285
|
-
const $
|
|
449
|
+
const $79312e33271883e9$export$5627764dc1e1d74a = (cx, cy, radius, segments)=>{
|
|
286
450
|
const points = [];
|
|
287
451
|
for(let i = 0; i < segments; i++){
|
|
288
452
|
const angle = i / segments * Math.PI * 2;
|
|
@@ -295,7 +459,7 @@ const $ce2c52df8af02e62$export$5627764dc1e1d74a = (cx, cy, radius, segments)=>{
|
|
|
295
459
|
};
|
|
296
460
|
|
|
297
461
|
|
|
298
|
-
const $
|
|
462
|
+
const $8bde0a7ee87832b5$export$90cc629a1c6121c7 = {
|
|
299
463
|
platonic: {
|
|
300
464
|
tetrahedron: {
|
|
301
465
|
vertices: 4,
|
|
@@ -327,16 +491,18 @@ const $f0f1a7293548e501$export$90cc629a1c6121c7 = {
|
|
|
327
491
|
ratio: 1.618034
|
|
328
492
|
}
|
|
329
493
|
};
|
|
330
|
-
const $
|
|
494
|
+
const $8bde0a7ee87832b5$export$4721fcae39954914 = (ctx, size, config = {})=>{
|
|
331
495
|
const finalConfig = {
|
|
332
|
-
...(0, $
|
|
496
|
+
...(0, $4e82a5352fbc7b27$export$3572305709b6b48c),
|
|
333
497
|
...config
|
|
334
498
|
};
|
|
335
|
-
(0, $
|
|
336
|
-
const
|
|
499
|
+
(0, $79312e33271883e9$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
500
|
+
const solidType = config.type;
|
|
501
|
+
const solidConfig = $8bde0a7ee87832b5$export$90cc629a1c6121c7.platonic[solidType] ?? $8bde0a7ee87832b5$export$90cc629a1c6121c7.platonic.icosahedron;
|
|
502
|
+
const { vertices: vertices } = solidConfig;
|
|
337
503
|
const radius = size / 2;
|
|
338
504
|
// Calculate vertices based on platonic solid type
|
|
339
|
-
const points = (0, $
|
|
505
|
+
const points = (0, $79312e33271883e9$export$5627764dc1e1d74a)(0, 0, radius, vertices);
|
|
340
506
|
ctx.beginPath();
|
|
341
507
|
// Draw edges between vertices
|
|
342
508
|
points.forEach((p1, i)=>{
|
|
@@ -347,15 +513,15 @@ const $f0f1a7293548e501$export$4721fcae39954914 = (ctx, size, config = {})=>{
|
|
|
347
513
|
});
|
|
348
514
|
if (finalConfig.fillStyle !== "transparent") ctx.fill();
|
|
349
515
|
ctx.stroke();
|
|
350
|
-
(0, $
|
|
516
|
+
(0, $79312e33271883e9$export$68ae68d395d27fd1)(ctx);
|
|
351
517
|
};
|
|
352
|
-
const $
|
|
518
|
+
const $8bde0a7ee87832b5$export$4091fa94ab006097 = (ctx, size, config = {})=>{
|
|
353
519
|
const finalConfig = {
|
|
354
|
-
...(0, $
|
|
355
|
-
...$
|
|
520
|
+
...(0, $4e82a5352fbc7b27$export$3572305709b6b48c),
|
|
521
|
+
...$8bde0a7ee87832b5$export$90cc629a1c6121c7.fibonacci,
|
|
356
522
|
...config
|
|
357
523
|
};
|
|
358
|
-
(0, $
|
|
524
|
+
(0, $79312e33271883e9$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
359
525
|
let current = 1;
|
|
360
526
|
let previous = 1;
|
|
361
527
|
let scale = size / Math.pow(finalConfig.growthFactor, finalConfig.iterations);
|
|
@@ -374,14 +540,14 @@ const $f0f1a7293548e501$export$4091fa94ab006097 = (ctx, size, config = {})=>{
|
|
|
374
540
|
ctx.rotate(Math.PI / 2);
|
|
375
541
|
}
|
|
376
542
|
ctx.stroke();
|
|
377
|
-
(0, $
|
|
543
|
+
(0, $79312e33271883e9$export$68ae68d395d27fd1)(ctx);
|
|
378
544
|
};
|
|
379
|
-
const $
|
|
545
|
+
const $8bde0a7ee87832b5$export$c9043b89bcb14ed9 = (ctx, size, config = {})=>{
|
|
380
546
|
const finalConfig = {
|
|
381
|
-
...(0, $
|
|
547
|
+
...(0, $4e82a5352fbc7b27$export$3572305709b6b48c),
|
|
382
548
|
...config
|
|
383
549
|
};
|
|
384
|
-
(0, $
|
|
550
|
+
(0, $79312e33271883e9$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
385
551
|
const gridSize = 8;
|
|
386
552
|
const unit = size / gridSize;
|
|
387
553
|
ctx.beginPath();
|
|
@@ -402,14 +568,14 @@ const $f0f1a7293548e501$export$c9043b89bcb14ed9 = (ctx, size, config = {})=>{
|
|
|
402
568
|
}
|
|
403
569
|
}
|
|
404
570
|
ctx.stroke();
|
|
405
|
-
(0, $
|
|
571
|
+
(0, $79312e33271883e9$export$68ae68d395d27fd1)(ctx);
|
|
406
572
|
};
|
|
407
|
-
const $
|
|
573
|
+
const $8bde0a7ee87832b5$export$16ea6f9310920305 = (ctx, size, config = {})=>{
|
|
408
574
|
const finalConfig = {
|
|
409
|
-
...(0, $
|
|
575
|
+
...(0, $4e82a5352fbc7b27$export$3572305709b6b48c),
|
|
410
576
|
...config
|
|
411
577
|
};
|
|
412
|
-
(0, $
|
|
578
|
+
(0, $79312e33271883e9$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
413
579
|
const gridSize = 4;
|
|
414
580
|
const unit = size / gridSize;
|
|
415
581
|
const drawKnotSegment = (x, y, type)=>{
|
|
@@ -432,19 +598,19 @@ const $f0f1a7293548e501$export$16ea6f9310920305 = (ctx, size, config = {})=>{
|
|
|
432
598
|
const y = (j - gridSize / 2) * unit;
|
|
433
599
|
drawKnotSegment(x, y, (i + j) % 2 === 0 ? "over" : "under");
|
|
434
600
|
}
|
|
435
|
-
(0, $
|
|
601
|
+
(0, $79312e33271883e9$export$68ae68d395d27fd1)(ctx);
|
|
436
602
|
};
|
|
437
|
-
const $
|
|
603
|
+
const $8bde0a7ee87832b5$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
438
604
|
const finalConfig = {
|
|
439
|
-
...(0, $
|
|
605
|
+
...(0, $4e82a5352fbc7b27$export$3572305709b6b48c),
|
|
440
606
|
...config
|
|
441
607
|
};
|
|
442
|
-
(0, $
|
|
608
|
+
(0, $79312e33271883e9$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
443
609
|
const radius = size / 2;
|
|
444
610
|
// Draw two intersecting tetrahedra
|
|
445
611
|
ctx.beginPath();
|
|
446
612
|
// First tetrahedron
|
|
447
|
-
const points1 = (0, $
|
|
613
|
+
const points1 = (0, $79312e33271883e9$export$5627764dc1e1d74a)(0, 0, radius, 3);
|
|
448
614
|
points1.forEach((p1, i)=>{
|
|
449
615
|
points1.slice(i + 1).forEach((p2)=>{
|
|
450
616
|
ctx.moveTo(p1.x, p1.y);
|
|
@@ -453,7 +619,7 @@ const $f0f1a7293548e501$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
|
453
619
|
});
|
|
454
620
|
// Second tetrahedron (rotated)
|
|
455
621
|
ctx.rotate(Math.PI / 6);
|
|
456
|
-
const points2 = (0, $
|
|
622
|
+
const points2 = (0, $79312e33271883e9$export$5627764dc1e1d74a)(0, 0, radius, 3);
|
|
457
623
|
points2.forEach((p1, i)=>{
|
|
458
624
|
points2.slice(i + 1).forEach((p2)=>{
|
|
459
625
|
ctx.moveTo(p1.x, p1.y);
|
|
@@ -462,14 +628,14 @@ const $f0f1a7293548e501$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
|
462
628
|
});
|
|
463
629
|
if (finalConfig.fillStyle !== "transparent") ctx.fill();
|
|
464
630
|
ctx.stroke();
|
|
465
|
-
(0, $
|
|
631
|
+
(0, $79312e33271883e9$export$68ae68d395d27fd1)(ctx);
|
|
466
632
|
};
|
|
467
|
-
const $
|
|
633
|
+
const $8bde0a7ee87832b5$export$97222779ddee1bfe = (ctx, size, config = {})=>{
|
|
468
634
|
const finalConfig = {
|
|
469
|
-
...(0, $
|
|
635
|
+
...(0, $4e82a5352fbc7b27$export$3572305709b6b48c),
|
|
470
636
|
...config
|
|
471
637
|
};
|
|
472
|
-
(0, $
|
|
638
|
+
(0, $79312e33271883e9$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
473
639
|
const numCircles = 8;
|
|
474
640
|
const numPoints = 16;
|
|
475
641
|
const radius = size / 2;
|
|
@@ -487,15 +653,15 @@ const $f0f1a7293548e501$export$97222779ddee1bfe = (ctx, size, config = {})=>{
|
|
|
487
653
|
}
|
|
488
654
|
}
|
|
489
655
|
ctx.stroke();
|
|
490
|
-
(0, $
|
|
656
|
+
(0, $79312e33271883e9$export$68ae68d395d27fd1)(ctx);
|
|
491
657
|
};
|
|
492
|
-
const $
|
|
658
|
+
const $8bde0a7ee87832b5$export$4fab07e71ae4aeeb = (ctx, size, config = {})=>{
|
|
493
659
|
const finalConfig = {
|
|
494
|
-
...(0, $
|
|
660
|
+
...(0, $4e82a5352fbc7b27$export$3572305709b6b48c),
|
|
495
661
|
...config,
|
|
496
662
|
iterations: 5
|
|
497
663
|
};
|
|
498
|
-
(0, $
|
|
664
|
+
(0, $79312e33271883e9$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
499
665
|
const drawBranch = (x, y, length, angle, depth)=>{
|
|
500
666
|
if (depth === 0) return;
|
|
501
667
|
const endX = x + length * Math.cos(angle);
|
|
@@ -508,21 +674,21 @@ const $f0f1a7293548e501$export$4fab07e71ae4aeeb = (ctx, size, config = {})=>{
|
|
|
508
674
|
drawBranch(endX, endY, length * 0.7, angle + Math.PI / 6, depth - 1);
|
|
509
675
|
};
|
|
510
676
|
drawBranch(0, size / 2, size / 4, -Math.PI / 2, finalConfig.iterations);
|
|
511
|
-
(0, $
|
|
677
|
+
(0, $79312e33271883e9$export$68ae68d395d27fd1)(ctx);
|
|
512
678
|
};
|
|
513
|
-
const $
|
|
514
|
-
platonicSolid: $
|
|
515
|
-
fibonacciSpiral: $
|
|
516
|
-
islamicPattern: $
|
|
517
|
-
celticKnot: $
|
|
518
|
-
merkaba: $
|
|
519
|
-
mandala: $
|
|
520
|
-
fractal: $
|
|
679
|
+
const $8bde0a7ee87832b5$export$dbe318a13ce51887 = {
|
|
680
|
+
platonicSolid: $8bde0a7ee87832b5$export$4721fcae39954914,
|
|
681
|
+
fibonacciSpiral: $8bde0a7ee87832b5$export$4091fa94ab006097,
|
|
682
|
+
islamicPattern: $8bde0a7ee87832b5$export$c9043b89bcb14ed9,
|
|
683
|
+
celticKnot: $8bde0a7ee87832b5$export$16ea6f9310920305,
|
|
684
|
+
merkaba: $8bde0a7ee87832b5$export$661ad3ddfb8912ed,
|
|
685
|
+
mandala: $8bde0a7ee87832b5$export$97222779ddee1bfe,
|
|
686
|
+
fractal: $8bde0a7ee87832b5$export$4fab07e71ae4aeeb
|
|
521
687
|
};
|
|
522
688
|
|
|
523
689
|
|
|
524
690
|
|
|
525
|
-
const $
|
|
691
|
+
const $d63629e16208c310$export$3bac12a72d9de58c = (ctx, size)=>{
|
|
526
692
|
const radius = size / 6;
|
|
527
693
|
const centers = [
|
|
528
694
|
{
|
|
@@ -560,7 +726,7 @@ const $77711f013715e6da$export$3bac12a72d9de58c = (ctx, size)=>{
|
|
|
560
726
|
ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
|
|
561
727
|
});
|
|
562
728
|
};
|
|
563
|
-
const $
|
|
729
|
+
const $d63629e16208c310$export$639bf214428ceec2 = (ctx, size)=>{
|
|
564
730
|
const radius = size / 12;
|
|
565
731
|
const spacing = radius * 2.5;
|
|
566
732
|
// Sephirot positions (traditional layout)
|
|
@@ -621,7 +787,7 @@ const $77711f013715e6da$export$639bf214428ceec2 = (ctx, size)=>{
|
|
|
621
787
|
});
|
|
622
788
|
});
|
|
623
789
|
};
|
|
624
|
-
const $
|
|
790
|
+
const $d63629e16208c310$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
625
791
|
const radius = size / 3;
|
|
626
792
|
// Create 13 points - one center and 12 vertices of an icosahedron
|
|
627
793
|
// const phi = (1 + Math.sqrt(5)) / 2; // Golden ratio
|
|
@@ -630,8 +796,8 @@ const $77711f013715e6da$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
|
630
796
|
x: 0,
|
|
631
797
|
y: 0
|
|
632
798
|
},
|
|
633
|
-
...(0, $
|
|
634
|
-
...(0, $
|
|
799
|
+
...(0, $79312e33271883e9$export$5627764dc1e1d74a)(0, 0, radius, 6),
|
|
800
|
+
...(0, $79312e33271883e9$export$5627764dc1e1d74a)(0, 0, radius * 1.5, 6)
|
|
635
801
|
];
|
|
636
802
|
ctx.beginPath();
|
|
637
803
|
// Draw all connecting lines
|
|
@@ -642,7 +808,7 @@ const $77711f013715e6da$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
|
642
808
|
});
|
|
643
809
|
});
|
|
644
810
|
};
|
|
645
|
-
const $
|
|
811
|
+
const $d63629e16208c310$export$f743702d1590aefb = (ctx, size)=>{
|
|
646
812
|
const radius = size / 2;
|
|
647
813
|
ctx.beginPath();
|
|
648
814
|
// Draw outer triangles
|
|
@@ -671,7 +837,7 @@ const $77711f013715e6da$export$f743702d1590aefb = (ctx, size)=>{
|
|
|
671
837
|
ctx.lineTo(0, 0);
|
|
672
838
|
}
|
|
673
839
|
};
|
|
674
|
-
const $
|
|
840
|
+
const $d63629e16208c310$export$980631444e370ab0 = (ctx, size)=>{
|
|
675
841
|
const radius = size / 6;
|
|
676
842
|
const centers = [
|
|
677
843
|
{
|
|
@@ -709,13 +875,13 @@ const $77711f013715e6da$export$980631444e370ab0 = (ctx, size)=>{
|
|
|
709
875
|
ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
|
|
710
876
|
});
|
|
711
877
|
};
|
|
712
|
-
const $
|
|
878
|
+
const $d63629e16208c310$export$eeae7765f05012e2 = (ctx, size)=>{
|
|
713
879
|
const radius = size / 4;
|
|
714
880
|
ctx.beginPath();
|
|
715
881
|
ctx.arc(-radius / 2, 0, radius, 0, Math.PI * 2);
|
|
716
882
|
ctx.arc(radius / 2, 0, radius, 0, Math.PI * 2);
|
|
717
883
|
};
|
|
718
|
-
const $
|
|
884
|
+
const $d63629e16208c310$export$3355220a8108efc3 = (ctx, size)=>{
|
|
719
885
|
const outerRadius = size / 2;
|
|
720
886
|
const innerRadius = size / 4;
|
|
721
887
|
const steps = 36;
|
|
@@ -735,7 +901,7 @@ const $77711f013715e6da$export$3355220a8108efc3 = (ctx, size)=>{
|
|
|
735
901
|
}
|
|
736
902
|
}
|
|
737
903
|
};
|
|
738
|
-
const $
|
|
904
|
+
const $d63629e16208c310$export$31e39e0544d9b1e8 = (ctx, size)=>{
|
|
739
905
|
const radius = size / 8;
|
|
740
906
|
const centers = [
|
|
741
907
|
{
|
|
@@ -773,140 +939,26 @@ const $77711f013715e6da$export$31e39e0544d9b1e8 = (ctx, size)=>{
|
|
|
773
939
|
ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
|
|
774
940
|
});
|
|
775
941
|
};
|
|
776
|
-
const $
|
|
777
|
-
flowerOfLife: $
|
|
778
|
-
treeOfLife: $
|
|
779
|
-
metatronsCube: $
|
|
780
|
-
sriYantra: $
|
|
781
|
-
seedOfLife: $
|
|
782
|
-
vesicaPiscis: $
|
|
783
|
-
torus: $
|
|
784
|
-
eggOfLife: $
|
|
942
|
+
const $d63629e16208c310$export$c2fc138f94dd4b2a = {
|
|
943
|
+
flowerOfLife: $d63629e16208c310$export$3bac12a72d9de58c,
|
|
944
|
+
treeOfLife: $d63629e16208c310$export$639bf214428ceec2,
|
|
945
|
+
metatronsCube: $d63629e16208c310$export$de26673ceb3e04eb,
|
|
946
|
+
sriYantra: $d63629e16208c310$export$f743702d1590aefb,
|
|
947
|
+
seedOfLife: $d63629e16208c310$export$980631444e370ab0,
|
|
948
|
+
vesicaPiscis: $d63629e16208c310$export$eeae7765f05012e2,
|
|
949
|
+
torus: $d63629e16208c310$export$3355220a8108efc3,
|
|
950
|
+
eggOfLife: $d63629e16208c310$export$31e39e0544d9b1e8
|
|
785
951
|
};
|
|
786
952
|
|
|
787
953
|
|
|
788
|
-
const $
|
|
789
|
-
...(0, $
|
|
790
|
-
...(0, $
|
|
791
|
-
...(0, $
|
|
792
|
-
};
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
function $616009579e3d72c5$export$39a95c82b20fdf81(gitHash) {
|
|
796
|
-
return parseInt(gitHash.slice(0, 8), 16);
|
|
797
|
-
}
|
|
798
|
-
function $616009579e3d72c5$export$6b193cae730c547a(hash, index, min, max) {
|
|
799
|
-
const hexPair = hash.substr(index * 2 % hash.length, 2);
|
|
800
|
-
const decimal = parseInt(hexPair, 16);
|
|
801
|
-
return min + decimal / 255 * (max - min);
|
|
802
|
-
}
|
|
803
|
-
const $616009579e3d72c5$export$bb9e4790bc99ae59 = {
|
|
804
|
-
GOLDEN_RATIO: 1.618034,
|
|
805
|
-
SQUARE_ROOT_2: Math.sqrt(2),
|
|
806
|
-
SQUARE_ROOT_3: Math.sqrt(3),
|
|
807
|
-
SQUARE_ROOT_5: Math.sqrt(5),
|
|
808
|
-
PI: Math.PI,
|
|
809
|
-
PHI: (1 + Math.sqrt(5)) / 2
|
|
954
|
+
const $701ba7c7229ef06d$export$4ff7fc6f1af248b5 = {
|
|
955
|
+
...(0, $f225038c018b3815$export$492753207a5258e1),
|
|
956
|
+
...(0, $8bde0a7ee87832b5$export$dbe318a13ce51887),
|
|
957
|
+
...(0, $d63629e16208c310$export$c2fc138f94dd4b2a)
|
|
810
958
|
};
|
|
811
|
-
class $616009579e3d72c5$export$da2372f11bc66b3f {
|
|
812
|
-
static getProportionalSize(baseSize, proportion) {
|
|
813
|
-
return baseSize * proportion;
|
|
814
|
-
}
|
|
815
|
-
static centerPattern(ctx, width, height) {
|
|
816
|
-
ctx.translate(width / 2, height / 2);
|
|
817
|
-
}
|
|
818
|
-
// Combines sacred geometry patterns with proper proportions
|
|
819
|
-
static layerPatterns(ctx, patterns, config) {
|
|
820
|
-
const { baseSize: baseSize, baseOpacity: baseOpacity = 0.6, opacityReduction: opacityReduction = 0.1, rotationOffset: rotationOffset = 0, proportionType: proportionType = "GOLDEN_RATIO" } = config;
|
|
821
|
-
patterns.forEach((pattern, index)=>{
|
|
822
|
-
const size = this.getProportionalSize(baseSize, Math.pow($616009579e3d72c5$export$bb9e4790bc99ae59[proportionType], index));
|
|
823
|
-
const opacity = Math.max(0.1, baseOpacity - index * opacityReduction);
|
|
824
|
-
const rotation = rotationOffset * index;
|
|
825
|
-
ctx.save();
|
|
826
|
-
ctx.globalAlpha = opacity;
|
|
827
|
-
ctx.rotate(rotation * Math.PI / 180);
|
|
828
|
-
(0, $e41b41d8dcf837ad$export$4ff7fc6f1af248b5)[pattern.type](ctx, size, pattern.config);
|
|
829
|
-
ctx.restore();
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
959
|
|
|
834
960
|
|
|
835
|
-
function $
|
|
836
|
-
const seed = (0, $616009579e3d72c5$export$39a95c82b20fdf81)(gitHash);
|
|
837
|
-
const scheme = new (0, $hgUW1$colorscheme)();
|
|
838
|
-
scheme.from_hue(seed % 360).scheme("analogic").variation("soft");
|
|
839
|
-
let colors = scheme.colors().map((hex)=>`#${hex}`);
|
|
840
|
-
const contrastingHue = (seed + 180) % 360;
|
|
841
|
-
const contrastingScheme = new (0, $hgUW1$colorscheme)();
|
|
842
|
-
contrastingScheme.from_hue(contrastingHue).scheme("mono").variation("soft");
|
|
843
|
-
colors.push(`#${contrastingScheme.colors()[0]}`);
|
|
844
|
-
return colors;
|
|
845
|
-
}
|
|
846
|
-
class $b5a262d09b87e373$export$ab958c550f521376 {
|
|
847
|
-
constructor(gitHash){
|
|
848
|
-
this.seed = this.gitHashToSeed(gitHash);
|
|
849
|
-
this.baseScheme = this.generateBaseScheme();
|
|
850
|
-
this.complementaryScheme = this.generateComplementaryScheme();
|
|
851
|
-
this.metallic = this.generateMetallicColors();
|
|
852
|
-
}
|
|
853
|
-
gitHashToSeed(hash) {
|
|
854
|
-
return parseInt(hash.slice(0, 8), 16);
|
|
855
|
-
}
|
|
856
|
-
generateBaseScheme() {
|
|
857
|
-
const scheme = new (0, $hgUW1$colorscheme)();
|
|
858
|
-
scheme;
|
|
859
|
-
return scheme.from_hue(this.seed % 360).scheme("analogic").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
860
|
-
}
|
|
861
|
-
generateComplementaryScheme() {
|
|
862
|
-
const complementaryHue = (this.seed + 180) % 360;
|
|
863
|
-
const scheme = new (0, $hgUW1$colorscheme)();
|
|
864
|
-
return scheme.from_hue(complementaryHue).scheme("mono").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
865
|
-
}
|
|
866
|
-
generateMetallicColors() {
|
|
867
|
-
return {
|
|
868
|
-
gold: "#FFD700",
|
|
869
|
-
silver: "#C0C0C0",
|
|
870
|
-
copper: "#B87333",
|
|
871
|
-
bronze: "#CD7F32"
|
|
872
|
-
};
|
|
873
|
-
}
|
|
874
|
-
getColorPalette(type = "sacred") {
|
|
875
|
-
switch(type){
|
|
876
|
-
case "sacred":
|
|
877
|
-
return {
|
|
878
|
-
primary: this.baseScheme[0],
|
|
879
|
-
secondary: this.baseScheme[1],
|
|
880
|
-
accent: this.complementaryScheme[0],
|
|
881
|
-
metallic: this.metallic.gold
|
|
882
|
-
};
|
|
883
|
-
case "elemental":
|
|
884
|
-
return {
|
|
885
|
-
earth: this.baseScheme[0],
|
|
886
|
-
water: this.baseScheme[1],
|
|
887
|
-
air: this.baseScheme[2],
|
|
888
|
-
fire: this.complementaryScheme[0]
|
|
889
|
-
};
|
|
890
|
-
case "chakra":
|
|
891
|
-
return {
|
|
892
|
-
root: "#FF0000",
|
|
893
|
-
sacral: "#FF7F00",
|
|
894
|
-
solar: "#FFFF00",
|
|
895
|
-
heart: "#00FF00",
|
|
896
|
-
throat: "#0000FF",
|
|
897
|
-
third_eye: "#4B0082",
|
|
898
|
-
crown: "#8F00FF"
|
|
899
|
-
};
|
|
900
|
-
default:
|
|
901
|
-
return this.baseScheme;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
function $e0f99502ff383dd8$export$71b514a25c47df50(ctx, shape, x, y, config) {
|
|
961
|
+
function $9beb8f41637c29fd$export$71b514a25c47df50(ctx, shape, x, y, config) {
|
|
910
962
|
const { fillColor: fillColor, strokeColor: strokeColor, strokeWidth: strokeWidth, size: size, rotation: rotation } = config;
|
|
911
963
|
ctx.save();
|
|
912
964
|
ctx.translate(x, y);
|
|
@@ -914,32 +966,50 @@ function $e0f99502ff383dd8$export$71b514a25c47df50(ctx, shape, x, y, config) {
|
|
|
914
966
|
ctx.fillStyle = fillColor;
|
|
915
967
|
ctx.strokeStyle = strokeColor;
|
|
916
968
|
ctx.lineWidth = strokeWidth;
|
|
917
|
-
const drawFunction = (0, $
|
|
918
|
-
if (drawFunction)
|
|
919
|
-
|
|
920
|
-
|
|
969
|
+
const drawFunction = (0, $701ba7c7229ef06d$export$4ff7fc6f1af248b5)[shape];
|
|
970
|
+
if (drawFunction) {
|
|
971
|
+
drawFunction(ctx, size);
|
|
972
|
+
ctx.fill();
|
|
973
|
+
ctx.stroke();
|
|
974
|
+
}
|
|
921
975
|
ctx.restore();
|
|
922
976
|
}
|
|
923
|
-
function $
|
|
924
|
-
const { fillColor: fillColor, strokeColor: strokeColor, strokeWidth: strokeWidth, size: size, rotation: rotation, patterns: patterns = [], proportionType: proportionType = "GOLDEN_RATIO", baseOpacity: baseOpacity = 0.6, opacityReduction: opacityReduction = 0.1 } = config;
|
|
977
|
+
function $9beb8f41637c29fd$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
978
|
+
const { fillColor: fillColor, strokeColor: strokeColor, strokeWidth: strokeWidth, size: size, rotation: rotation, patterns: patterns = [], proportionType: proportionType = "GOLDEN_RATIO", baseOpacity: baseOpacity = 0.6, opacityReduction: opacityReduction = 0.1, glowRadius: glowRadius = 0, glowColor: glowColor, gradientFillEnd: gradientFillEnd } = config;
|
|
925
979
|
ctx.save();
|
|
926
980
|
ctx.translate(x, y);
|
|
927
981
|
ctx.rotate(rotation * Math.PI / 180);
|
|
928
|
-
//
|
|
929
|
-
|
|
982
|
+
// Glow / shadow effect
|
|
983
|
+
if (glowRadius > 0) {
|
|
984
|
+
ctx.shadowBlur = glowRadius;
|
|
985
|
+
ctx.shadowColor = glowColor || fillColor;
|
|
986
|
+
ctx.shadowOffsetX = 0;
|
|
987
|
+
ctx.shadowOffsetY = 0;
|
|
988
|
+
}
|
|
989
|
+
// Gradient fill or flat fill
|
|
990
|
+
if (gradientFillEnd) {
|
|
991
|
+
const grad = ctx.createRadialGradient(0, 0, 0, 0, 0, size / 2);
|
|
992
|
+
grad.addColorStop(0, fillColor);
|
|
993
|
+
grad.addColorStop(1, gradientFillEnd);
|
|
994
|
+
ctx.fillStyle = grad;
|
|
995
|
+
} else ctx.fillStyle = fillColor;
|
|
930
996
|
ctx.strokeStyle = strokeColor;
|
|
931
997
|
ctx.lineWidth = strokeWidth;
|
|
932
|
-
const drawFunction = (0, $
|
|
933
|
-
if (drawFunction)
|
|
998
|
+
const drawFunction = (0, $701ba7c7229ef06d$export$4ff7fc6f1af248b5)[shape];
|
|
999
|
+
if (drawFunction) {
|
|
1000
|
+
drawFunction(ctx, size);
|
|
1001
|
+
ctx.fill();
|
|
1002
|
+
ctx.stroke();
|
|
1003
|
+
}
|
|
1004
|
+
// Reset shadow so patterns aren't double-glowed
|
|
1005
|
+
if (glowRadius > 0) ctx.shadowBlur = 0;
|
|
934
1006
|
// Layer additional patterns if specified
|
|
935
|
-
if (patterns.length > 0) (0, $
|
|
1007
|
+
if (patterns.length > 0) (0, $461134e0b6ce0619$export$da2372f11bc66b3f).layerPatterns(ctx, patterns, {
|
|
936
1008
|
baseSize: size,
|
|
937
1009
|
baseOpacity: baseOpacity,
|
|
938
1010
|
opacityReduction: opacityReduction,
|
|
939
1011
|
proportionType: proportionType
|
|
940
1012
|
});
|
|
941
|
-
ctx.fill();
|
|
942
|
-
ctx.stroke();
|
|
943
1013
|
ctx.restore();
|
|
944
1014
|
}
|
|
945
1015
|
|
|
@@ -947,133 +1017,154 @@ function $e0f99502ff383dd8$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
947
1017
|
|
|
948
1018
|
|
|
949
1019
|
/**
|
|
950
|
-
*
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
shapesPerLayer: 0
|
|
966
|
-
};
|
|
967
|
-
// Merge provided config with defaults
|
|
1020
|
+
* Configuration options for image generation.
|
|
1021
|
+
*/ const $2bfb6a1ccb7a82ae$export$c2f8e0cc249a8d8f = {
|
|
1022
|
+
width: 2048,
|
|
1023
|
+
height: 2048,
|
|
1024
|
+
gridSize: 5,
|
|
1025
|
+
layers: 4,
|
|
1026
|
+
minShapeSize: 30,
|
|
1027
|
+
maxShapeSize: 400,
|
|
1028
|
+
baseOpacity: 0.7,
|
|
1029
|
+
opacityReduction: 0.12,
|
|
1030
|
+
shapesPerLayer: 0
|
|
1031
|
+
};
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
function $b623126c6e9cbb71$export$29a844702096332e(ctx, gitHash, config = {}) {
|
|
968
1035
|
const finalConfig = {
|
|
969
|
-
...
|
|
1036
|
+
...(0, $2bfb6a1ccb7a82ae$export$c2f8e0cc249a8d8f),
|
|
970
1037
|
...config
|
|
971
1038
|
};
|
|
972
1039
|
const { width: width, height: height, gridSize: gridSize, layers: layers, minShapeSize: minShapeSize, maxShapeSize: maxShapeSize, baseOpacity: baseOpacity, opacityReduction: opacityReduction } = finalConfig;
|
|
973
|
-
// Calculate shapes per layer based on grid size if not provided
|
|
974
1040
|
finalConfig.shapesPerLayer = finalConfig.shapesPerLayer || Math.floor(gridSize * gridSize * 1.5);
|
|
975
|
-
|
|
976
|
-
const
|
|
977
|
-
const
|
|
978
|
-
const
|
|
979
|
-
//
|
|
980
|
-
const
|
|
981
|
-
|
|
982
|
-
|
|
1041
|
+
// --- Color scheme derived from hash ---
|
|
1042
|
+
const colorScheme = new (0, $9d614e7d77fc2947$export$ab958c550f521376)(gitHash);
|
|
1043
|
+
const colors = colorScheme.getColors();
|
|
1044
|
+
const [bgStart, bgEnd] = colorScheme.getBackgroundColors();
|
|
1045
|
+
// --- Radial gradient background for depth ---
|
|
1046
|
+
const cx = width / 2;
|
|
1047
|
+
const cy = height / 2;
|
|
1048
|
+
const bgRadius = Math.hypot(cx, cy);
|
|
1049
|
+
const gradient = ctx.createRadialGradient(cx, cy, 0, cx, cy, bgRadius);
|
|
1050
|
+
gradient.addColorStop(0, bgStart);
|
|
1051
|
+
gradient.addColorStop(1, bgEnd);
|
|
983
1052
|
ctx.fillStyle = gradient;
|
|
984
1053
|
ctx.fillRect(0, 0, width, height);
|
|
985
|
-
const shapeNames = Object.keys((0, $
|
|
986
|
-
const cellWidth = width / gridSize;
|
|
987
|
-
const cellHeight = height / gridSize;
|
|
988
|
-
// Scale shape sizes based on canvas dimensions
|
|
1054
|
+
const shapeNames = Object.keys((0, $701ba7c7229ef06d$export$4ff7fc6f1af248b5));
|
|
989
1055
|
const scaleFactor = Math.min(width, height) / 1024;
|
|
990
1056
|
const adjustedMinSize = minShapeSize * scaleFactor;
|
|
991
1057
|
const adjustedMaxSize = maxShapeSize * scaleFactor;
|
|
1058
|
+
// One master RNG seeded from the full hash — all randomness flows from here
|
|
1059
|
+
const rng = (0, $461134e0b6ce0619$export$eaf9227667332084)((0, $461134e0b6ce0619$export$e9cc707de01b7042)(gitHash));
|
|
1060
|
+
// Track shape positions for organic connecting curves later
|
|
1061
|
+
const shapePositions = [];
|
|
992
1062
|
for(let layer = 0; layer < layers; layer++){
|
|
993
|
-
const numShapes = finalConfig.shapesPerLayer + Math.floor((
|
|
994
|
-
|
|
1063
|
+
const numShapes = finalConfig.shapesPerLayer + Math.floor(rng() * finalConfig.shapesPerLayer * 0.3);
|
|
1064
|
+
// Layer opacity decays gently so all layers remain visible
|
|
1065
|
+
const layerOpacity = Math.max(0.15, baseOpacity - layer * opacityReduction);
|
|
1066
|
+
// Later layers use smaller shapes for depth
|
|
1067
|
+
const layerSizeScale = 1 - layer * 0.15;
|
|
995
1068
|
for(let i = 0; i < numShapes; i++){
|
|
996
|
-
const
|
|
997
|
-
const
|
|
998
|
-
const
|
|
999
|
-
const
|
|
1000
|
-
|
|
1001
|
-
const
|
|
1002
|
-
const
|
|
1003
|
-
const
|
|
1004
|
-
const
|
|
1005
|
-
const
|
|
1006
|
-
const
|
|
1007
|
-
ctx.globalAlpha = layerOpacity;
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
// y,
|
|
1013
|
-
// colors[fillColorIndex],
|
|
1014
|
-
// colors[strokeColorIndex],
|
|
1015
|
-
// 2 * scaleFactor,
|
|
1016
|
-
// size,
|
|
1017
|
-
// rotation
|
|
1018
|
-
// );
|
|
1019
|
-
(0, $e0f99502ff383dd8$export$bb35a6995ddbf32d)(ctx, shape, x, y, {
|
|
1020
|
-
fillColor: Object.values(colors)[fillColorIndex],
|
|
1021
|
-
strokeColor: Object.values(colors)[strokeColorIndex],
|
|
1022
|
-
strokeWidth: 1.5 * scaleFactor,
|
|
1069
|
+
const x = rng() * width;
|
|
1070
|
+
const y = rng() * height;
|
|
1071
|
+
const shapeIdx = Math.floor(rng() * shapeNames.length);
|
|
1072
|
+
const shape = shapeNames[shapeIdx];
|
|
1073
|
+
// Shape size follows a power distribution — many small, few large
|
|
1074
|
+
const sizeT = Math.pow(rng(), 1.8);
|
|
1075
|
+
const size = (adjustedMinSize + sizeT * (adjustedMaxSize - adjustedMinSize)) * layerSizeScale;
|
|
1076
|
+
const rotation = rng() * 360;
|
|
1077
|
+
const fillColor = colors[Math.floor(rng() * colors.length)];
|
|
1078
|
+
const strokeColor = colors[Math.floor(rng() * colors.length)];
|
|
1079
|
+
const strokeWidth = (0.5 + rng() * 2.0) * scaleFactor;
|
|
1080
|
+
ctx.globalAlpha = layerOpacity * (0.5 + rng() * 0.5);
|
|
1081
|
+
(0, $9beb8f41637c29fd$export$bb35a6995ddbf32d)(ctx, shape, x, y, {
|
|
1082
|
+
fillColor: fillColor,
|
|
1083
|
+
strokeColor: strokeColor,
|
|
1084
|
+
strokeWidth: strokeWidth,
|
|
1023
1085
|
size: size,
|
|
1024
1086
|
rotation: rotation,
|
|
1025
|
-
// Optionally add pattern combinations
|
|
1026
|
-
// patterns:
|
|
1027
|
-
// Math.random() > 0.7 ? PatternPresets.cosmicTree(size) : [],
|
|
1028
1087
|
proportionType: "GOLDEN_RATIO"
|
|
1029
1088
|
});
|
|
1089
|
+
shapePositions.push({
|
|
1090
|
+
x: x,
|
|
1091
|
+
y: y
|
|
1092
|
+
});
|
|
1030
1093
|
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
for(let i = 0; i <
|
|
1037
|
-
const
|
|
1038
|
-
const
|
|
1039
|
-
const
|
|
1040
|
-
const
|
|
1094
|
+
}
|
|
1095
|
+
// --- Organic connecting curves between nearby shapes ---
|
|
1096
|
+
if (shapePositions.length > 1) {
|
|
1097
|
+
const numCurves = Math.floor(8 * (width * height) / 1048576);
|
|
1098
|
+
ctx.lineWidth = 0.8 * scaleFactor;
|
|
1099
|
+
for(let i = 0; i < numCurves; i++){
|
|
1100
|
+
const idxA = Math.floor(rng() * shapePositions.length);
|
|
1101
|
+
const offset = 1 + Math.floor(rng() * Math.min(5, shapePositions.length - 1));
|
|
1102
|
+
const idxB = (idxA + offset) % shapePositions.length;
|
|
1103
|
+
const a = shapePositions[idxA];
|
|
1104
|
+
const b = shapePositions[idxB];
|
|
1105
|
+
const mx = (a.x + b.x) / 2;
|
|
1106
|
+
const my = (a.y + b.y) / 2;
|
|
1107
|
+
const dx = b.x - a.x;
|
|
1108
|
+
const dy = b.y - a.y;
|
|
1109
|
+
const dist = Math.hypot(dx, dy);
|
|
1110
|
+
const bulge = (rng() - 0.5) * dist * 0.4;
|
|
1111
|
+
const cpx = mx + -dy / (dist || 1) * bulge;
|
|
1112
|
+
const cpy = my + dx / (dist || 1) * bulge;
|
|
1113
|
+
ctx.globalAlpha = 0.08 + rng() * 0.12;
|
|
1114
|
+
ctx.strokeStyle = colors[Math.floor(rng() * colors.length)];
|
|
1041
1115
|
ctx.beginPath();
|
|
1042
|
-
ctx.moveTo(
|
|
1043
|
-
ctx.
|
|
1116
|
+
ctx.moveTo(a.x, a.y);
|
|
1117
|
+
ctx.quadraticCurveTo(cpx, cpy, b.x, b.y);
|
|
1044
1118
|
ctx.stroke();
|
|
1045
1119
|
}
|
|
1046
1120
|
}
|
|
1121
|
+
ctx.globalAlpha = 1;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Generate an abstract art PNG buffer from a git hash (Node.js only).
|
|
1129
|
+
*
|
|
1130
|
+
* Uses @napi-rs/canvas under the hood to create an off-screen canvas,
|
|
1131
|
+
* renders the hash-derived art, and returns the result as a PNG Buffer.
|
|
1132
|
+
*
|
|
1133
|
+
* @param gitHash - Hex hash string used as the deterministic seed
|
|
1134
|
+
* @param config - Partial generation config (merged with defaults)
|
|
1135
|
+
* @returns PNG buffer of the generated image
|
|
1136
|
+
*/ function $054ab01bb585d84a$export$491525bf12232411(gitHash, config = {}) {
|
|
1137
|
+
const finalConfig = {
|
|
1138
|
+
...(0, $2bfb6a1ccb7a82ae$export$c2f8e0cc249a8d8f),
|
|
1139
|
+
...config
|
|
1140
|
+
};
|
|
1141
|
+
const { width: width, height: height } = finalConfig;
|
|
1142
|
+
const canvas = (0, $4RUNL$createCanvas)(width, height);
|
|
1143
|
+
const ctx = canvas.getContext("2d");
|
|
1144
|
+
(0, $b623126c6e9cbb71$export$29a844702096332e)(ctx, gitHash, finalConfig);
|
|
1047
1145
|
return canvas.toBuffer("image/png");
|
|
1048
1146
|
}
|
|
1049
1147
|
/**
|
|
1050
|
-
* Save the generated image to a file
|
|
1051
|
-
*
|
|
1052
|
-
* @param
|
|
1053
|
-
* @param
|
|
1054
|
-
* @param
|
|
1055
|
-
* @param
|
|
1056
|
-
* @param
|
|
1057
|
-
* @
|
|
1058
|
-
|
|
1059
|
-
|
|
1148
|
+
* Save the generated image to a file (Node.js only).
|
|
1149
|
+
*
|
|
1150
|
+
* @param imageBuffer - The PNG buffer of the generated image
|
|
1151
|
+
* @param outputDir - The directory to save the image
|
|
1152
|
+
* @param gitHash - The git hash used to generate the image
|
|
1153
|
+
* @param label - Optional label for the output filename
|
|
1154
|
+
* @param width - The width of the generated image
|
|
1155
|
+
* @param height - The height of the generated image
|
|
1156
|
+
* @returns Path to the saved image
|
|
1157
|
+
*/ function $054ab01bb585d84a$export$ea0bbc160a51089a(imageBuffer, outputDir, gitHash, label = "", width, height) {
|
|
1158
|
+
if (!$4RUNL$existsSync(outputDir)) $4RUNL$mkdirSync(outputDir, {
|
|
1060
1159
|
recursive: true
|
|
1061
1160
|
});
|
|
1062
1161
|
const filename = label ? `${label}-${width}x${height}-${gitHash.slice(0, 8)}.png` : `${gitHash.slice(0, 8)}-${width}x${height}.png`;
|
|
1063
|
-
const outputPath =
|
|
1064
|
-
|
|
1162
|
+
const outputPath = $4RUNL$join(outputDir, filename);
|
|
1163
|
+
$4RUNL$writeFileSync(outputPath, imageBuffer);
|
|
1065
1164
|
console.log(`Generated: ${outputPath}`);
|
|
1066
1165
|
return outputPath;
|
|
1067
1166
|
}
|
|
1068
|
-
// Usage example:
|
|
1069
|
-
/*
|
|
1070
|
-
import { generateImageFromHash, saveImageToFile } from 'git-hash-art';
|
|
1071
1167
|
|
|
1072
|
-
const gitHash = '1234567890abcdef1234567890abcdef12345678';
|
|
1073
|
-
const imageBuffer = generateImageFromHash(gitHash, { width: 1024, height: 1024 });
|
|
1074
|
-
const savedImagePath = saveImageToFile(imageBuffer, './output', gitHash, 'example', 1024, 1024);
|
|
1075
|
-
console.log(`Image saved to: ${savedImagePath}`);
|
|
1076
|
-
*/
|
|
1077
1168
|
|
|
1078
|
-
export {$
|
|
1169
|
+
export {$054ab01bb585d84a$export$491525bf12232411 as generateImageFromHash, $054ab01bb585d84a$export$ea0bbc160a51089a as saveImageToFile, $b623126c6e9cbb71$export$29a844702096332e as renderHashArt, $4e82a5352fbc7b27$export$9265403940be6b4 as PRESETS, $2bfb6a1ccb7a82ae$export$c2f8e0cc249a8d8f as DEFAULT_CONFIG};
|
|
1079
1170
|
//# sourceMappingURL=module.js.map
|