git-hash-art 0.0.3 → 0.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/.release-it.json +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/main.js +260 -155
- package/dist/main.js.map +1 -1
- package/dist/module.js +259 -154
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -0
- package/global.d.ts +12 -0
- package/package.json +14 -10
- package/src/{index.js → index.ts} +35 -30
- package/src/lib/canvas/{colors.js → colors.ts} +53 -11
- package/src/lib/canvas/{draw.js → draw.ts} +29 -11
- package/src/lib/canvas/shapes/{basic.js → basic.ts} +14 -12
- package/src/lib/canvas/shapes/{complex.js → complex.ts} +116 -34
- package/src/lib/canvas/shapes/{index.js → index.ts} +7 -1
- package/src/lib/canvas/shapes/sacred.ts +206 -0
- package/src/lib/canvas/shapes/utils.ts +65 -0
- package/src/lib/{constants.js → constants.ts} +32 -5
- package/src/lib/{utils.js → utils.ts} +34 -6
- package/tsconfig.json +16 -0
- package/eslint.config.mjs +0 -29
- package/src/lib/canvas/shapes/sacred.js +0 -173
- package/src/lib/canvas/shapes/utils.js +0 -37
package/dist/module.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import {createCanvas as $
|
|
2
|
-
import $
|
|
3
|
-
import $
|
|
4
|
-
import $
|
|
1
|
+
import {createCanvas as $hgUW1$createCanvas} from "canvas";
|
|
2
|
+
import $hgUW1$fs from "fs";
|
|
3
|
+
import $hgUW1$path from "path";
|
|
4
|
+
import $hgUW1$colorscheme from "color-scheme";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// declare module 'color-scheme';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const $44f5b87a40c9680b$export$8daab6f91f7ff730 = (ctx, size)=>{
|
|
11
14
|
ctx.beginPath();
|
|
12
15
|
ctx.arc(0, 0, size / 2, 0, Math.PI * 2);
|
|
13
16
|
};
|
|
14
|
-
const $
|
|
17
|
+
const $44f5b87a40c9680b$export$9340b6a85ea854b9 = (ctx, size)=>{
|
|
15
18
|
ctx.beginPath();
|
|
16
19
|
ctx.rect(-size / 2, -size / 2, size, size);
|
|
17
20
|
};
|
|
18
|
-
const $
|
|
21
|
+
const $44f5b87a40c9680b$export$e6b70c7883316010 = (ctx, size)=>{
|
|
19
22
|
ctx.beginPath();
|
|
20
23
|
ctx.moveTo(0, -size / 2);
|
|
21
24
|
ctx.lineTo(-size / 2, size / 2);
|
|
22
25
|
ctx.lineTo(size / 2, size / 2);
|
|
23
26
|
ctx.closePath();
|
|
24
27
|
};
|
|
25
|
-
const $
|
|
28
|
+
const $44f5b87a40c9680b$export$252d2895fb67397b = (ctx, size)=>{
|
|
26
29
|
ctx.beginPath();
|
|
27
30
|
for(let i = 0; i < 6; i++){
|
|
28
31
|
const angle = Math.PI / 8 * i;
|
|
@@ -33,7 +36,7 @@ const $e982bdf2d46bd221$export$252d2895fb67397b = (ctx, size)=>{
|
|
|
33
36
|
}
|
|
34
37
|
ctx.closePath();
|
|
35
38
|
};
|
|
36
|
-
const $
|
|
39
|
+
const $44f5b87a40c9680b$export$ca57b923902a3c0 = (ctx, size)=>{
|
|
37
40
|
ctx.beginPath();
|
|
38
41
|
for(let i = 0; i < 10; i++){
|
|
39
42
|
const angle = Math.PI / 5 + Math.PI / 5 * i * 3;
|
|
@@ -45,7 +48,7 @@ const $e982bdf2d46bd221$export$ca57b923902a3c0 = (ctx, size)=>{
|
|
|
45
48
|
}
|
|
46
49
|
ctx.closePath();
|
|
47
50
|
};
|
|
48
|
-
const $
|
|
51
|
+
const $44f5b87a40c9680b$export$cf8f2f05ac4f561f = (ctx, size)=>{
|
|
49
52
|
ctx.beginPath();
|
|
50
53
|
for(let i = 0; i < 10; i++){
|
|
51
54
|
const angle = Math.PI / 30 + Math.PI / 30 * i * 8;
|
|
@@ -57,13 +60,13 @@ const $e982bdf2d46bd221$export$cf8f2f05ac4f561f = (ctx, size)=>{
|
|
|
57
60
|
}
|
|
58
61
|
ctx.closePath();
|
|
59
62
|
};
|
|
60
|
-
const $
|
|
63
|
+
const $44f5b87a40c9680b$export$1ed0c0bc398b6246 = (ctx, size)=>{
|
|
61
64
|
ctx.beginPath();
|
|
62
65
|
ctx.moveTo(0, size / 4);
|
|
63
66
|
ctx.quadraticCurveTo(size / 2, size / 4, 0, -size / 4);
|
|
64
67
|
ctx.quadraticCurveTo(-size / 2, size / 4, 0, size / 4);
|
|
65
68
|
};
|
|
66
|
-
const $
|
|
69
|
+
const $44f5b87a40c9680b$export$57ec12daf141ce6 = (ctx, size)=>{
|
|
67
70
|
ctx.beginPath();
|
|
68
71
|
ctx.moveTo(0, -size / 2);
|
|
69
72
|
ctx.lineTo(size / 2, 0);
|
|
@@ -71,7 +74,7 @@ const $e982bdf2d46bd221$export$57ec12daf141ce6 = (ctx, size)=>{
|
|
|
71
74
|
ctx.lineTo(-size / 2, 0);
|
|
72
75
|
ctx.closePath();
|
|
73
76
|
};
|
|
74
|
-
const $
|
|
77
|
+
const $44f5b87a40c9680b$export$39f25a4fc5491539 = (ctx, size)=>{
|
|
75
78
|
ctx.beginPath();
|
|
76
79
|
ctx.moveTo(-size / 2, -size / 2);
|
|
77
80
|
ctx.lineTo(size / 2, -size / 2);
|
|
@@ -79,20 +82,21 @@ const $e982bdf2d46bd221$export$39f25a4fc5491539 = (ctx, size)=>{
|
|
|
79
82
|
ctx.lineTo(-size / 2, size / 2);
|
|
80
83
|
ctx.closePath();
|
|
81
84
|
};
|
|
82
|
-
const $
|
|
83
|
-
circle: $
|
|
84
|
-
square: $
|
|
85
|
-
triangle: $
|
|
86
|
-
hexagon: $
|
|
87
|
-
star: $
|
|
88
|
-
"jacked-star": $
|
|
89
|
-
heart: $
|
|
90
|
-
diamond: $
|
|
91
|
-
cube: $
|
|
85
|
+
const $44f5b87a40c9680b$export$492753207a5258e1 = {
|
|
86
|
+
circle: $44f5b87a40c9680b$export$8daab6f91f7ff730,
|
|
87
|
+
square: $44f5b87a40c9680b$export$9340b6a85ea854b9,
|
|
88
|
+
triangle: $44f5b87a40c9680b$export$e6b70c7883316010,
|
|
89
|
+
hexagon: $44f5b87a40c9680b$export$252d2895fb67397b,
|
|
90
|
+
star: $44f5b87a40c9680b$export$ca57b923902a3c0,
|
|
91
|
+
"jacked-star": $44f5b87a40c9680b$export$cf8f2f05ac4f561f,
|
|
92
|
+
heart: $44f5b87a40c9680b$export$1ed0c0bc398b6246,
|
|
93
|
+
diamond: $44f5b87a40c9680b$export$57ec12daf141ce6,
|
|
94
|
+
cube: $44f5b87a40c9680b$export$39f25a4fc5491539
|
|
92
95
|
};
|
|
93
96
|
|
|
94
97
|
|
|
95
|
-
|
|
98
|
+
// Define interfaces for our configurations
|
|
99
|
+
const $e0ea14d2e2f06463$export$9265403940be6b4 = {
|
|
96
100
|
// Standard sizes with different hashes
|
|
97
101
|
react: {
|
|
98
102
|
hash: "46192e59d42f741c761cbea79462a8b3815dd905",
|
|
@@ -182,7 +186,7 @@ const $81d7f9c14b75c186$export$9265403940be6b4 = {
|
|
|
182
186
|
maxShapeSize: 250
|
|
183
187
|
}
|
|
184
188
|
};
|
|
185
|
-
const $
|
|
189
|
+
const $e0ea14d2e2f06463$export$3572305709b6b48c = {
|
|
186
190
|
strokeStyle: "#000000",
|
|
187
191
|
fillStyle: "transparent",
|
|
188
192
|
lineWidth: 1,
|
|
@@ -190,12 +194,12 @@ const $81d7f9c14b75c186$export$3572305709b6b48c = {
|
|
|
190
194
|
iterations: 1,
|
|
191
195
|
animate: false
|
|
192
196
|
};
|
|
193
|
-
const $
|
|
197
|
+
const $e0ea14d2e2f06463$export$a4ca1369b6d2c19e = {
|
|
194
198
|
BASIC: "basic",
|
|
195
199
|
DETAILED: "detailed",
|
|
196
200
|
ANIMATED: "animated"
|
|
197
201
|
};
|
|
198
|
-
const $
|
|
202
|
+
const $e0ea14d2e2f06463$export$bb9e4790bc99ae59 = {
|
|
199
203
|
GOLDEN_RATIO: 1.618034,
|
|
200
204
|
SQUARE_ROOT_2: Math.sqrt(2),
|
|
201
205
|
SQUARE_ROOT_3: Math.sqrt(3),
|
|
@@ -203,7 +207,7 @@ const $81d7f9c14b75c186$export$bb9e4790bc99ae59 = {
|
|
|
203
207
|
PI: Math.PI,
|
|
204
208
|
PHI: (1 + Math.sqrt(5)) / 2
|
|
205
209
|
};
|
|
206
|
-
const $
|
|
210
|
+
const $e0ea14d2e2f06463$export$c36defeab44ba3b3 = {
|
|
207
211
|
flowerOfLifeMandala: (size)=>[
|
|
208
212
|
// { type: "flowerOfLife", config: { size } },
|
|
209
213
|
{
|
|
@@ -260,25 +264,25 @@ const $81d7f9c14b75c186$export$c36defeab44ba3b3 = {
|
|
|
260
264
|
};
|
|
261
265
|
|
|
262
266
|
|
|
263
|
-
const $
|
|
264
|
-
const $
|
|
267
|
+
const $ce2c52df8af02e62$export$e6bfdeff8bfc94f9 = (degrees)=>degrees * Math.PI / 180;
|
|
268
|
+
const $ce2c52df8af02e62$export$e46c5570db033611 = (ctx, size, config)=>{
|
|
265
269
|
ctx.save();
|
|
266
270
|
ctx.translate(0, 0);
|
|
267
|
-
if (config.rotation) ctx.rotate($
|
|
271
|
+
if (config.rotation) ctx.rotate($ce2c52df8af02e62$export$e6bfdeff8bfc94f9(config.rotation));
|
|
268
272
|
ctx.lineWidth = config.lineWidth;
|
|
269
273
|
ctx.strokeStyle = config.strokeStyle;
|
|
270
274
|
ctx.fillStyle = config.fillStyle;
|
|
271
275
|
};
|
|
272
|
-
const $
|
|
276
|
+
const $ce2c52df8af02e62$export$68ae68d395d27fd1 = (ctx)=>{
|
|
273
277
|
ctx.restore();
|
|
274
278
|
};
|
|
275
|
-
const $
|
|
279
|
+
const $ce2c52df8af02e62$export$70ba51ca253810ef = (type)=>({
|
|
276
280
|
enabled: false,
|
|
277
281
|
duration: 1000,
|
|
278
282
|
easing: "linear",
|
|
279
283
|
type: type
|
|
280
284
|
});
|
|
281
|
-
const $
|
|
285
|
+
const $ce2c52df8af02e62$export$5627764dc1e1d74a = (cx, cy, radius, segments)=>{
|
|
282
286
|
const points = [];
|
|
283
287
|
for(let i = 0; i < segments; i++){
|
|
284
288
|
const angle = i / segments * Math.PI * 2;
|
|
@@ -291,7 +295,7 @@ const $3607eda4304ea847$export$5627764dc1e1d74a = (cx, cy, radius, segments)=>{
|
|
|
291
295
|
};
|
|
292
296
|
|
|
293
297
|
|
|
294
|
-
const $
|
|
298
|
+
const $f0f1a7293548e501$export$90cc629a1c6121c7 = {
|
|
295
299
|
platonic: {
|
|
296
300
|
tetrahedron: {
|
|
297
301
|
vertices: 4,
|
|
@@ -323,16 +327,16 @@ const $6768203c11c08d59$export$90cc629a1c6121c7 = {
|
|
|
323
327
|
ratio: 1.618034
|
|
324
328
|
}
|
|
325
329
|
};
|
|
326
|
-
const $
|
|
330
|
+
const $f0f1a7293548e501$export$4721fcae39954914 = (ctx, size, config = {})=>{
|
|
327
331
|
const finalConfig = {
|
|
328
|
-
...(0, $
|
|
332
|
+
...(0, $e0ea14d2e2f06463$export$3572305709b6b48c),
|
|
329
333
|
...config
|
|
330
334
|
};
|
|
331
|
-
(0, $
|
|
332
|
-
const { vertices: vertices } = $
|
|
335
|
+
(0, $ce2c52df8af02e62$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
336
|
+
const { vertices: vertices } = $f0f1a7293548e501$export$90cc629a1c6121c7.platonic[config.type];
|
|
333
337
|
const radius = size / 2;
|
|
334
338
|
// Calculate vertices based on platonic solid type
|
|
335
|
-
const points = (0, $
|
|
339
|
+
const points = (0, $ce2c52df8af02e62$export$5627764dc1e1d74a)(0, 0, radius, vertices);
|
|
336
340
|
ctx.beginPath();
|
|
337
341
|
// Draw edges between vertices
|
|
338
342
|
points.forEach((p1, i)=>{
|
|
@@ -343,15 +347,15 @@ const $6768203c11c08d59$export$4721fcae39954914 = (ctx, size, type, config = {})
|
|
|
343
347
|
});
|
|
344
348
|
if (finalConfig.fillStyle !== "transparent") ctx.fill();
|
|
345
349
|
ctx.stroke();
|
|
346
|
-
(0, $
|
|
350
|
+
(0, $ce2c52df8af02e62$export$68ae68d395d27fd1)(ctx);
|
|
347
351
|
};
|
|
348
|
-
const $
|
|
352
|
+
const $f0f1a7293548e501$export$4091fa94ab006097 = (ctx, size, config = {})=>{
|
|
349
353
|
const finalConfig = {
|
|
350
|
-
...(0, $
|
|
351
|
-
...$
|
|
354
|
+
...(0, $e0ea14d2e2f06463$export$3572305709b6b48c),
|
|
355
|
+
...$f0f1a7293548e501$export$90cc629a1c6121c7.fibonacci,
|
|
352
356
|
...config
|
|
353
357
|
};
|
|
354
|
-
(0, $
|
|
358
|
+
(0, $ce2c52df8af02e62$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
355
359
|
let current = 1;
|
|
356
360
|
let previous = 1;
|
|
357
361
|
let scale = size / Math.pow(finalConfig.growthFactor, finalConfig.iterations);
|
|
@@ -370,14 +374,14 @@ const $6768203c11c08d59$export$4091fa94ab006097 = (ctx, size, config = {})=>{
|
|
|
370
374
|
ctx.rotate(Math.PI / 2);
|
|
371
375
|
}
|
|
372
376
|
ctx.stroke();
|
|
373
|
-
(0, $
|
|
377
|
+
(0, $ce2c52df8af02e62$export$68ae68d395d27fd1)(ctx);
|
|
374
378
|
};
|
|
375
|
-
const $
|
|
379
|
+
const $f0f1a7293548e501$export$c9043b89bcb14ed9 = (ctx, size, config = {})=>{
|
|
376
380
|
const finalConfig = {
|
|
377
|
-
...(0, $
|
|
381
|
+
...(0, $e0ea14d2e2f06463$export$3572305709b6b48c),
|
|
378
382
|
...config
|
|
379
383
|
};
|
|
380
|
-
(0, $
|
|
384
|
+
(0, $ce2c52df8af02e62$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
381
385
|
const gridSize = 8;
|
|
382
386
|
const unit = size / gridSize;
|
|
383
387
|
ctx.beginPath();
|
|
@@ -388,24 +392,24 @@ const $6768203c11c08d59$export$c9043b89bcb14ed9 = (ctx, size, config = {})=>{
|
|
|
388
392
|
// Draw star pattern at each intersection
|
|
389
393
|
const radius = unit / 2;
|
|
390
394
|
for(let k = 0; k < 8; k++){
|
|
391
|
-
const angle =
|
|
392
|
-
const x1 = x + Math.cos(angle)
|
|
393
|
-
const y1 = y + Math.sin(angle)
|
|
394
|
-
|
|
395
|
-
|
|
395
|
+
const angle = Math.PI / 4 * k;
|
|
396
|
+
const x1 = x + radius * Math.cos(angle);
|
|
397
|
+
const y1 = y + radius * Math.sin(angle);
|
|
398
|
+
const x2 = x + radius * Math.cos(angle + Math.PI / 4);
|
|
399
|
+
const y2 = y + radius * Math.sin(angle + Math.PI / 4);
|
|
400
|
+
ctx.moveTo(x1, y1);
|
|
401
|
+
ctx.lineTo(x2, y2);
|
|
396
402
|
}
|
|
397
|
-
ctx.closePath();
|
|
398
403
|
}
|
|
399
|
-
if (finalConfig.fillStyle !== "transparent") ctx.fill();
|
|
400
404
|
ctx.stroke();
|
|
401
|
-
(0, $
|
|
405
|
+
(0, $ce2c52df8af02e62$export$68ae68d395d27fd1)(ctx);
|
|
402
406
|
};
|
|
403
|
-
const $
|
|
407
|
+
const $f0f1a7293548e501$export$16ea6f9310920305 = (ctx, size, config = {})=>{
|
|
404
408
|
const finalConfig = {
|
|
405
|
-
...(0, $
|
|
409
|
+
...(0, $e0ea14d2e2f06463$export$3572305709b6b48c),
|
|
406
410
|
...config
|
|
407
411
|
};
|
|
408
|
-
(0, $
|
|
412
|
+
(0, $ce2c52df8af02e62$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
409
413
|
const gridSize = 4;
|
|
410
414
|
const unit = size / gridSize;
|
|
411
415
|
const drawKnotSegment = (x, y, type)=>{
|
|
@@ -428,19 +432,19 @@ const $6768203c11c08d59$export$16ea6f9310920305 = (ctx, size, config = {})=>{
|
|
|
428
432
|
const y = (j - gridSize / 2) * unit;
|
|
429
433
|
drawKnotSegment(x, y, (i + j) % 2 === 0 ? "over" : "under");
|
|
430
434
|
}
|
|
431
|
-
(0, $
|
|
435
|
+
(0, $ce2c52df8af02e62$export$68ae68d395d27fd1)(ctx);
|
|
432
436
|
};
|
|
433
|
-
const $
|
|
437
|
+
const $f0f1a7293548e501$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
434
438
|
const finalConfig = {
|
|
435
|
-
...(0, $
|
|
439
|
+
...(0, $e0ea14d2e2f06463$export$3572305709b6b48c),
|
|
436
440
|
...config
|
|
437
441
|
};
|
|
438
|
-
(0, $
|
|
442
|
+
(0, $ce2c52df8af02e62$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
439
443
|
const radius = size / 2;
|
|
440
444
|
// Draw two intersecting tetrahedra
|
|
441
445
|
ctx.beginPath();
|
|
442
446
|
// First tetrahedron
|
|
443
|
-
const points1 = (0, $
|
|
447
|
+
const points1 = (0, $ce2c52df8af02e62$export$5627764dc1e1d74a)(0, 0, radius, 3);
|
|
444
448
|
points1.forEach((p1, i)=>{
|
|
445
449
|
points1.slice(i + 1).forEach((p2)=>{
|
|
446
450
|
ctx.moveTo(p1.x, p1.y);
|
|
@@ -449,7 +453,7 @@ const $6768203c11c08d59$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
|
449
453
|
});
|
|
450
454
|
// Second tetrahedron (rotated)
|
|
451
455
|
ctx.rotate(Math.PI / 6);
|
|
452
|
-
const points2 = (0, $
|
|
456
|
+
const points2 = (0, $ce2c52df8af02e62$export$5627764dc1e1d74a)(0, 0, radius, 3);
|
|
453
457
|
points2.forEach((p1, i)=>{
|
|
454
458
|
points2.slice(i + 1).forEach((p2)=>{
|
|
455
459
|
ctx.moveTo(p1.x, p1.y);
|
|
@@ -458,19 +462,67 @@ const $6768203c11c08d59$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
|
458
462
|
});
|
|
459
463
|
if (finalConfig.fillStyle !== "transparent") ctx.fill();
|
|
460
464
|
ctx.stroke();
|
|
461
|
-
(0, $
|
|
465
|
+
(0, $ce2c52df8af02e62$export$68ae68d395d27fd1)(ctx);
|
|
466
|
+
};
|
|
467
|
+
const $f0f1a7293548e501$export$97222779ddee1bfe = (ctx, size, config = {})=>{
|
|
468
|
+
const finalConfig = {
|
|
469
|
+
...(0, $e0ea14d2e2f06463$export$3572305709b6b48c),
|
|
470
|
+
...config
|
|
471
|
+
};
|
|
472
|
+
(0, $ce2c52df8af02e62$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
473
|
+
const numCircles = 8;
|
|
474
|
+
const numPoints = 16;
|
|
475
|
+
const radius = size / 2;
|
|
476
|
+
ctx.beginPath();
|
|
477
|
+
for(let i = 1; i <= numCircles; i++){
|
|
478
|
+
const circleRadius = radius / numCircles * i;
|
|
479
|
+
ctx.moveTo(circleRadius, 0);
|
|
480
|
+
ctx.arc(0, 0, circleRadius, 0, Math.PI * 2);
|
|
481
|
+
for(let j = 0; j < numPoints; j++){
|
|
482
|
+
const angle = Math.PI * 2 * j / numPoints;
|
|
483
|
+
const x = circleRadius * Math.cos(angle);
|
|
484
|
+
const y = circleRadius * Math.sin(angle);
|
|
485
|
+
ctx.moveTo(0, 0);
|
|
486
|
+
ctx.lineTo(x, y);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
ctx.stroke();
|
|
490
|
+
(0, $ce2c52df8af02e62$export$68ae68d395d27fd1)(ctx);
|
|
491
|
+
};
|
|
492
|
+
const $f0f1a7293548e501$export$4fab07e71ae4aeeb = (ctx, size, config = {})=>{
|
|
493
|
+
const finalConfig = {
|
|
494
|
+
...(0, $e0ea14d2e2f06463$export$3572305709b6b48c),
|
|
495
|
+
...config,
|
|
496
|
+
iterations: 5
|
|
497
|
+
};
|
|
498
|
+
(0, $ce2c52df8af02e62$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
499
|
+
const drawBranch = (x, y, length, angle, depth)=>{
|
|
500
|
+
if (depth === 0) return;
|
|
501
|
+
const endX = x + length * Math.cos(angle);
|
|
502
|
+
const endY = y + length * Math.sin(angle);
|
|
503
|
+
ctx.beginPath();
|
|
504
|
+
ctx.moveTo(x, y);
|
|
505
|
+
ctx.lineTo(endX, endY);
|
|
506
|
+
ctx.stroke();
|
|
507
|
+
drawBranch(endX, endY, length * 0.7, angle - Math.PI / 6, depth - 1);
|
|
508
|
+
drawBranch(endX, endY, length * 0.7, angle + Math.PI / 6, depth - 1);
|
|
509
|
+
};
|
|
510
|
+
drawBranch(0, size / 2, size / 4, -Math.PI / 2, finalConfig.iterations);
|
|
511
|
+
(0, $ce2c52df8af02e62$export$68ae68d395d27fd1)(ctx);
|
|
462
512
|
};
|
|
463
|
-
const $
|
|
464
|
-
platonicSolid:
|
|
465
|
-
fibonacciSpiral:
|
|
466
|
-
islamicPattern:
|
|
467
|
-
celticKnot:
|
|
468
|
-
merkaba:
|
|
513
|
+
const $f0f1a7293548e501$export$dbe318a13ce51887 = {
|
|
514
|
+
platonicSolid: $f0f1a7293548e501$export$4721fcae39954914,
|
|
515
|
+
fibonacciSpiral: $f0f1a7293548e501$export$4091fa94ab006097,
|
|
516
|
+
islamicPattern: $f0f1a7293548e501$export$c9043b89bcb14ed9,
|
|
517
|
+
celticKnot: $f0f1a7293548e501$export$16ea6f9310920305,
|
|
518
|
+
merkaba: $f0f1a7293548e501$export$661ad3ddfb8912ed,
|
|
519
|
+
mandala: $f0f1a7293548e501$export$97222779ddee1bfe,
|
|
520
|
+
fractal: $f0f1a7293548e501$export$4fab07e71ae4aeeb
|
|
469
521
|
};
|
|
470
522
|
|
|
471
523
|
|
|
472
524
|
|
|
473
|
-
const $
|
|
525
|
+
const $77711f013715e6da$export$3bac12a72d9de58c = (ctx, size)=>{
|
|
474
526
|
const radius = size / 6;
|
|
475
527
|
const centers = [
|
|
476
528
|
{
|
|
@@ -508,7 +560,7 @@ const $4191f40726a1f4db$export$3bac12a72d9de58c = (ctx, size)=>{
|
|
|
508
560
|
ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
|
|
509
561
|
});
|
|
510
562
|
};
|
|
511
|
-
const $
|
|
563
|
+
const $77711f013715e6da$export$639bf214428ceec2 = (ctx, size)=>{
|
|
512
564
|
const radius = size / 12;
|
|
513
565
|
const spacing = radius * 2.5;
|
|
514
566
|
// Sephirot positions (traditional layout)
|
|
@@ -552,7 +604,7 @@ const $4191f40726a1f4db$export$639bf214428ceec2 = (ctx, size)=>{
|
|
|
552
604
|
{
|
|
553
605
|
x: 0,
|
|
554
606
|
y: spacing * 3
|
|
555
|
-
}
|
|
607
|
+
}
|
|
556
608
|
];
|
|
557
609
|
// Draw circles
|
|
558
610
|
ctx.beginPath();
|
|
@@ -569,7 +621,7 @@ const $4191f40726a1f4db$export$639bf214428ceec2 = (ctx, size)=>{
|
|
|
569
621
|
});
|
|
570
622
|
});
|
|
571
623
|
};
|
|
572
|
-
const $
|
|
624
|
+
const $77711f013715e6da$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
573
625
|
const radius = size / 3;
|
|
574
626
|
// Create 13 points - one center and 12 vertices of an icosahedron
|
|
575
627
|
// const phi = (1 + Math.sqrt(5)) / 2; // Golden ratio
|
|
@@ -578,8 +630,8 @@ const $4191f40726a1f4db$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
|
578
630
|
x: 0,
|
|
579
631
|
y: 0
|
|
580
632
|
},
|
|
581
|
-
...(0, $
|
|
582
|
-
...(0, $
|
|
633
|
+
...(0, $ce2c52df8af02e62$export$5627764dc1e1d74a)(0, 0, radius, 6),
|
|
634
|
+
...(0, $ce2c52df8af02e62$export$5627764dc1e1d74a)(0, 0, radius * 1.5, 6)
|
|
583
635
|
];
|
|
584
636
|
ctx.beginPath();
|
|
585
637
|
// Draw all connecting lines
|
|
@@ -590,7 +642,7 @@ const $4191f40726a1f4db$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
|
590
642
|
});
|
|
591
643
|
});
|
|
592
644
|
};
|
|
593
|
-
const $
|
|
645
|
+
const $77711f013715e6da$export$f743702d1590aefb = (ctx, size)=>{
|
|
594
646
|
const radius = size / 2;
|
|
595
647
|
ctx.beginPath();
|
|
596
648
|
// Draw outer triangles
|
|
@@ -619,14 +671,37 @@ const $4191f40726a1f4db$export$f743702d1590aefb = (ctx, size)=>{
|
|
|
619
671
|
ctx.lineTo(0, 0);
|
|
620
672
|
}
|
|
621
673
|
};
|
|
622
|
-
const $
|
|
623
|
-
const radius = size /
|
|
674
|
+
const $77711f013715e6da$export$980631444e370ab0 = (ctx, size)=>{
|
|
675
|
+
const radius = size / 6;
|
|
624
676
|
const centers = [
|
|
625
677
|
{
|
|
626
678
|
x: 0,
|
|
627
679
|
y: 0
|
|
628
680
|
},
|
|
629
|
-
|
|
681
|
+
{
|
|
682
|
+
x: radius * Math.sqrt(3),
|
|
683
|
+
y: 0
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
x: radius * Math.sqrt(3) / 2,
|
|
687
|
+
y: 1.5 * radius
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
x: -radius * Math.sqrt(3) / 2,
|
|
691
|
+
y: 1.5 * radius
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
x: -radius * Math.sqrt(3),
|
|
695
|
+
y: 0
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
x: -radius * Math.sqrt(3) / 2,
|
|
699
|
+
y: -1.5 * radius
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
x: radius * Math.sqrt(3) / 2,
|
|
703
|
+
y: -1.5 * radius
|
|
704
|
+
}
|
|
630
705
|
];
|
|
631
706
|
ctx.beginPath();
|
|
632
707
|
centers.forEach((center)=>{
|
|
@@ -634,14 +709,13 @@ const $4191f40726a1f4db$export$980631444e370ab0 = (ctx, size)=>{
|
|
|
634
709
|
ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
|
|
635
710
|
});
|
|
636
711
|
};
|
|
637
|
-
const $
|
|
638
|
-
const radius = size /
|
|
712
|
+
const $77711f013715e6da$export$eeae7765f05012e2 = (ctx, size)=>{
|
|
713
|
+
const radius = size / 4;
|
|
639
714
|
ctx.beginPath();
|
|
640
|
-
// Draw two overlapping circles
|
|
641
715
|
ctx.arc(-radius / 2, 0, radius, 0, Math.PI * 2);
|
|
642
716
|
ctx.arc(radius / 2, 0, radius, 0, Math.PI * 2);
|
|
643
717
|
};
|
|
644
|
-
const $
|
|
718
|
+
const $77711f013715e6da$export$3355220a8108efc3 = (ctx, size)=>{
|
|
645
719
|
const outerRadius = size / 2;
|
|
646
720
|
const innerRadius = size / 4;
|
|
647
721
|
const steps = 36;
|
|
@@ -661,33 +735,72 @@ const $4191f40726a1f4db$export$3355220a8108efc3 = (ctx, size)=>{
|
|
|
661
735
|
}
|
|
662
736
|
}
|
|
663
737
|
};
|
|
664
|
-
const $
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
738
|
+
const $77711f013715e6da$export$31e39e0544d9b1e8 = (ctx, size)=>{
|
|
739
|
+
const radius = size / 8;
|
|
740
|
+
const centers = [
|
|
741
|
+
{
|
|
742
|
+
x: 0,
|
|
743
|
+
y: 0
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
x: radius * 2,
|
|
747
|
+
y: 0
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
x: radius,
|
|
751
|
+
y: radius * Math.sqrt(3)
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
x: -radius,
|
|
755
|
+
y: radius * Math.sqrt(3)
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
x: -radius * 2,
|
|
759
|
+
y: 0
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
x: -radius,
|
|
763
|
+
y: -radius * Math.sqrt(3)
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
x: radius,
|
|
767
|
+
y: -radius * Math.sqrt(3)
|
|
768
|
+
}
|
|
769
|
+
];
|
|
770
|
+
ctx.beginPath();
|
|
771
|
+
centers.forEach((center)=>{
|
|
772
|
+
ctx.moveTo(center.x + radius, center.y);
|
|
773
|
+
ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
|
|
774
|
+
});
|
|
775
|
+
};
|
|
776
|
+
const $77711f013715e6da$export$c2fc138f94dd4b2a = {
|
|
777
|
+
flowerOfLife: $77711f013715e6da$export$3bac12a72d9de58c,
|
|
778
|
+
treeOfLife: $77711f013715e6da$export$639bf214428ceec2,
|
|
779
|
+
metatronsCube: $77711f013715e6da$export$de26673ceb3e04eb,
|
|
780
|
+
sriYantra: $77711f013715e6da$export$f743702d1590aefb,
|
|
781
|
+
seedOfLife: $77711f013715e6da$export$980631444e370ab0,
|
|
782
|
+
vesicaPiscis: $77711f013715e6da$export$eeae7765f05012e2,
|
|
783
|
+
torus: $77711f013715e6da$export$3355220a8108efc3,
|
|
784
|
+
eggOfLife: $77711f013715e6da$export$31e39e0544d9b1e8
|
|
672
785
|
};
|
|
673
786
|
|
|
674
787
|
|
|
675
|
-
const $
|
|
676
|
-
...(0, $
|
|
677
|
-
...(0, $
|
|
678
|
-
...(0, $
|
|
788
|
+
const $e41b41d8dcf837ad$export$4ff7fc6f1af248b5 = {
|
|
789
|
+
...(0, $44f5b87a40c9680b$export$492753207a5258e1),
|
|
790
|
+
...(0, $f0f1a7293548e501$export$dbe318a13ce51887),
|
|
791
|
+
...(0, $77711f013715e6da$export$c2fc138f94dd4b2a)
|
|
679
792
|
};
|
|
680
793
|
|
|
681
794
|
|
|
682
|
-
function $
|
|
795
|
+
function $616009579e3d72c5$export$39a95c82b20fdf81(gitHash) {
|
|
683
796
|
return parseInt(gitHash.slice(0, 8), 16);
|
|
684
797
|
}
|
|
685
|
-
function $
|
|
798
|
+
function $616009579e3d72c5$export$6b193cae730c547a(hash, index, min, max) {
|
|
686
799
|
const hexPair = hash.substr(index * 2 % hash.length, 2);
|
|
687
800
|
const decimal = parseInt(hexPair, 16);
|
|
688
801
|
return min + decimal / 255 * (max - min);
|
|
689
802
|
}
|
|
690
|
-
const $
|
|
803
|
+
const $616009579e3d72c5$export$bb9e4790bc99ae59 = {
|
|
691
804
|
GOLDEN_RATIO: 1.618034,
|
|
692
805
|
SQUARE_ROOT_2: Math.sqrt(2),
|
|
693
806
|
SQUARE_ROOT_3: Math.sqrt(3),
|
|
@@ -695,7 +808,7 @@ const $7f8638f37c57b389$export$bb9e4790bc99ae59 = {
|
|
|
695
808
|
PI: Math.PI,
|
|
696
809
|
PHI: (1 + Math.sqrt(5)) / 2
|
|
697
810
|
};
|
|
698
|
-
class $
|
|
811
|
+
class $616009579e3d72c5$export$da2372f11bc66b3f {
|
|
699
812
|
static getProportionalSize(baseSize, proportion) {
|
|
700
813
|
return baseSize * proportion;
|
|
701
814
|
}
|
|
@@ -706,31 +819,31 @@ class $7f8638f37c57b389$export$da2372f11bc66b3f {
|
|
|
706
819
|
static layerPatterns(ctx, patterns, config) {
|
|
707
820
|
const { baseSize: baseSize, baseOpacity: baseOpacity = 0.6, opacityReduction: opacityReduction = 0.1, rotationOffset: rotationOffset = 0, proportionType: proportionType = "GOLDEN_RATIO" } = config;
|
|
708
821
|
patterns.forEach((pattern, index)=>{
|
|
709
|
-
const size = this.getProportionalSize(baseSize, Math.pow($
|
|
822
|
+
const size = this.getProportionalSize(baseSize, Math.pow($616009579e3d72c5$export$bb9e4790bc99ae59[proportionType], index));
|
|
710
823
|
const opacity = Math.max(0.1, baseOpacity - index * opacityReduction);
|
|
711
824
|
const rotation = rotationOffset * index;
|
|
712
825
|
ctx.save();
|
|
713
826
|
ctx.globalAlpha = opacity;
|
|
714
827
|
ctx.rotate(rotation * Math.PI / 180);
|
|
715
|
-
(0, $
|
|
828
|
+
(0, $e41b41d8dcf837ad$export$4ff7fc6f1af248b5)[pattern.type](ctx, size, pattern.config);
|
|
716
829
|
ctx.restore();
|
|
717
830
|
});
|
|
718
831
|
}
|
|
719
832
|
}
|
|
720
833
|
|
|
721
834
|
|
|
722
|
-
function $
|
|
723
|
-
const seed = (0, $
|
|
724
|
-
const scheme = new (0, $
|
|
835
|
+
function $b5a262d09b87e373$export$f116a24fd288e742(gitHash) {
|
|
836
|
+
const seed = (0, $616009579e3d72c5$export$39a95c82b20fdf81)(gitHash);
|
|
837
|
+
const scheme = new (0, $hgUW1$colorscheme)();
|
|
725
838
|
scheme.from_hue(seed % 360).scheme("analogic").variation("soft");
|
|
726
839
|
let colors = scheme.colors().map((hex)=>`#${hex}`);
|
|
727
840
|
const contrastingHue = (seed + 180) % 360;
|
|
728
|
-
const contrastingScheme = new (0, $
|
|
841
|
+
const contrastingScheme = new (0, $hgUW1$colorscheme)();
|
|
729
842
|
contrastingScheme.from_hue(contrastingHue).scheme("mono").variation("soft");
|
|
730
843
|
colors.push(`#${contrastingScheme.colors()[0]}`);
|
|
731
844
|
return colors;
|
|
732
845
|
}
|
|
733
|
-
class $
|
|
846
|
+
class $b5a262d09b87e373$export$ab958c550f521376 {
|
|
734
847
|
constructor(gitHash){
|
|
735
848
|
this.seed = this.gitHashToSeed(gitHash);
|
|
736
849
|
this.baseScheme = this.generateBaseScheme();
|
|
@@ -741,12 +854,13 @@ class $8f4da37788745c0d$export$ab958c550f521376 {
|
|
|
741
854
|
return parseInt(hash.slice(0, 8), 16);
|
|
742
855
|
}
|
|
743
856
|
generateBaseScheme() {
|
|
744
|
-
const scheme = new (0, $
|
|
857
|
+
const scheme = new (0, $hgUW1$colorscheme)();
|
|
858
|
+
scheme;
|
|
745
859
|
return scheme.from_hue(this.seed % 360).scheme("analogic").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
746
860
|
}
|
|
747
861
|
generateComplementaryScheme() {
|
|
748
862
|
const complementaryHue = (this.seed + 180) % 360;
|
|
749
|
-
const scheme = new (0, $
|
|
863
|
+
const scheme = new (0, $hgUW1$colorscheme)();
|
|
750
864
|
return scheme.from_hue(complementaryHue).scheme("mono").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
751
865
|
}
|
|
752
866
|
generateMetallicColors() {
|
|
@@ -792,20 +906,21 @@ class $8f4da37788745c0d$export$ab958c550f521376 {
|
|
|
792
906
|
|
|
793
907
|
|
|
794
908
|
|
|
795
|
-
function $
|
|
909
|
+
function $e0f99502ff383dd8$export$71b514a25c47df50(ctx, shape, x, y, config) {
|
|
910
|
+
const { fillColor: fillColor, strokeColor: strokeColor, strokeWidth: strokeWidth, size: size, rotation: rotation } = config;
|
|
796
911
|
ctx.save();
|
|
797
912
|
ctx.translate(x, y);
|
|
798
913
|
ctx.rotate(rotation * Math.PI / 180);
|
|
799
914
|
ctx.fillStyle = fillColor;
|
|
800
915
|
ctx.strokeStyle = strokeColor;
|
|
801
916
|
ctx.lineWidth = strokeWidth;
|
|
802
|
-
const drawFunction = (0, $
|
|
917
|
+
const drawFunction = (0, $e41b41d8dcf837ad$export$4ff7fc6f1af248b5)[shape];
|
|
803
918
|
if (drawFunction) drawFunction(ctx, size);
|
|
804
919
|
ctx.fill();
|
|
805
920
|
ctx.stroke();
|
|
806
921
|
ctx.restore();
|
|
807
922
|
}
|
|
808
|
-
function $
|
|
923
|
+
function $e0f99502ff383dd8$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
809
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;
|
|
810
925
|
ctx.save();
|
|
811
926
|
ctx.translate(x, y);
|
|
@@ -814,10 +929,10 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
814
929
|
ctx.fillStyle = fillColor;
|
|
815
930
|
ctx.strokeStyle = strokeColor;
|
|
816
931
|
ctx.lineWidth = strokeWidth;
|
|
817
|
-
const drawFunction = (0, $
|
|
932
|
+
const drawFunction = (0, $e41b41d8dcf837ad$export$4ff7fc6f1af248b5)[shape];
|
|
818
933
|
if (drawFunction) drawFunction(ctx, size);
|
|
819
934
|
// Layer additional patterns if specified
|
|
820
|
-
if (patterns.length > 0) (0, $
|
|
935
|
+
if (patterns.length > 0) (0, $616009579e3d72c5$export$da2372f11bc66b3f).layerPatterns(ctx, patterns, {
|
|
821
936
|
baseSize: size,
|
|
822
937
|
baseOpacity: baseOpacity,
|
|
823
938
|
opacityReduction: opacityReduction,
|
|
@@ -832,22 +947,11 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
832
947
|
|
|
833
948
|
|
|
834
949
|
/**
|
|
835
|
-
* @typedef {Object} ArtConfig
|
|
836
|
-
* @property {number} width - Canvas width in pixels
|
|
837
|
-
* @property {number} height - Canvas height in pixels
|
|
838
|
-
* @property {number} [gridSize=4] - Number of grid cells (gridSize x gridSize)
|
|
839
|
-
* @property {number} [layers=5] - Number of layers to generate
|
|
840
|
-
* @property {number} [shapesPerLayer] - Base number of shapes per layer (defaults to grid cells * 1.5)
|
|
841
|
-
* @property {number} [minShapeSize=20] - Minimum shape size
|
|
842
|
-
* @property {number} [maxShapeSize=180] - Maximum shape size
|
|
843
|
-
* @property {number} [baseOpacity=0.6] - Starting opacity for first layer
|
|
844
|
-
* @property {number} [opacityReduction=0.1] - How much to reduce opacity per layer
|
|
845
|
-
*/ /**
|
|
846
950
|
* Generate an abstract art image from a git hash with custom configuration
|
|
847
951
|
* @param {string} gitHash - The git hash to use as a seed
|
|
848
952
|
* @param {ArtConfig} [config={}] - Configuration options
|
|
849
953
|
* @returns {Buffer} PNG buffer of the generated image
|
|
850
|
-
*/ function $
|
|
954
|
+
*/ function $149c1bd638913645$export$491525bf12232411(gitHash, config = {}) {
|
|
851
955
|
// Default configuration
|
|
852
956
|
const defaultConfig = {
|
|
853
957
|
width: 2048,
|
|
@@ -857,7 +961,8 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
857
961
|
minShapeSize: 20,
|
|
858
962
|
maxShapeSize: 600,
|
|
859
963
|
baseOpacity: 0.8,
|
|
860
|
-
opacityReduction: 0.4
|
|
964
|
+
opacityReduction: 0.4,
|
|
965
|
+
shapesPerLayer: 0
|
|
861
966
|
};
|
|
862
967
|
// Merge provided config with defaults
|
|
863
968
|
const finalConfig = {
|
|
@@ -867,9 +972,9 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
867
972
|
const { width: width, height: height, gridSize: gridSize, layers: layers, minShapeSize: minShapeSize, maxShapeSize: maxShapeSize, baseOpacity: baseOpacity, opacityReduction: opacityReduction } = finalConfig;
|
|
868
973
|
// Calculate shapes per layer based on grid size if not provided
|
|
869
974
|
finalConfig.shapesPerLayer = finalConfig.shapesPerLayer || Math.floor(gridSize * gridSize * 1.5);
|
|
870
|
-
const canvas = (0, $
|
|
975
|
+
const canvas = (0, $hgUW1$createCanvas)(width, height);
|
|
871
976
|
const ctx = canvas.getContext("2d");
|
|
872
|
-
const colorScheme = new (0, $
|
|
977
|
+
const colorScheme = new (0, $b5a262d09b87e373$export$ab958c550f521376)(gitHash);
|
|
873
978
|
const colors = colorScheme.getColorPalette("chakra");
|
|
874
979
|
// Create a gradient background
|
|
875
980
|
const gradient = ctx.createLinearGradient(0, 0, width, height);
|
|
@@ -877,7 +982,7 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
877
982
|
gradient.addColorStop(1, colorScheme.baseScheme[1]);
|
|
878
983
|
ctx.fillStyle = gradient;
|
|
879
984
|
ctx.fillRect(0, 0, width, height);
|
|
880
|
-
const shapeNames = Object.keys((0, $
|
|
985
|
+
const shapeNames = Object.keys((0, $e41b41d8dcf837ad$export$4ff7fc6f1af248b5));
|
|
881
986
|
const cellWidth = width / gridSize;
|
|
882
987
|
const cellHeight = height / gridSize;
|
|
883
988
|
// Scale shape sizes based on canvas dimensions
|
|
@@ -885,20 +990,20 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
885
990
|
const adjustedMinSize = minShapeSize * scaleFactor;
|
|
886
991
|
const adjustedMaxSize = maxShapeSize * scaleFactor;
|
|
887
992
|
for(let layer = 0; layer < layers; layer++){
|
|
888
|
-
const numShapes = finalConfig.shapesPerLayer + Math.floor((0, $
|
|
993
|
+
const numShapes = finalConfig.shapesPerLayer + Math.floor((0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, layer, 0, finalConfig.shapesPerLayer / 2));
|
|
889
994
|
const layerOpacity = baseOpacity - layer * opacityReduction;
|
|
890
995
|
for(let i = 0; i < numShapes; i++){
|
|
891
996
|
const gridX = Math.floor(i / gridSize);
|
|
892
997
|
const gridY = i % gridSize;
|
|
893
|
-
const cellOffsetX = (0, $
|
|
894
|
-
const cellOffsetY = (0, $
|
|
998
|
+
const cellOffsetX = (0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 2, 0, cellWidth);
|
|
999
|
+
const cellOffsetY = (0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 2 + 1, 0, cellHeight);
|
|
895
1000
|
const x = gridX * cellWidth + cellOffsetX;
|
|
896
1001
|
const y = gridY * cellHeight + cellOffsetY;
|
|
897
|
-
const shape = shapeNames[Math.floor((0, $
|
|
898
|
-
const size = adjustedMinSize + (0, $
|
|
899
|
-
const rotation = (0, $
|
|
900
|
-
const fillColorIndex = Math.floor((0, $
|
|
901
|
-
const strokeColorIndex = Math.floor((0, $
|
|
1002
|
+
const shape = shapeNames[Math.floor((0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 3, 0, shapeNames.length))];
|
|
1003
|
+
const size = adjustedMinSize + (0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 4, 0, adjustedMaxSize - adjustedMinSize);
|
|
1004
|
+
const rotation = (0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 5, 0, 360);
|
|
1005
|
+
const fillColorIndex = Math.floor((0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 6, 0, Object.keys(colors).length));
|
|
1006
|
+
const strokeColorIndex = Math.floor((0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 7, 0, Object.keys(colors).length));
|
|
902
1007
|
ctx.globalAlpha = layerOpacity;
|
|
903
1008
|
// drawShape(
|
|
904
1009
|
// ctx,
|
|
@@ -911,9 +1016,9 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
911
1016
|
// size,
|
|
912
1017
|
// rotation
|
|
913
1018
|
// );
|
|
914
|
-
(0, $
|
|
915
|
-
fillColor: colors[fillColorIndex],
|
|
916
|
-
strokeColor: colors[strokeColorIndex],
|
|
1019
|
+
(0, $e0f99502ff383dd8$export$bb35a6995ddbf32d)(ctx, shape, x, y, {
|
|
1020
|
+
fillColor: Object.values(colors)[fillColorIndex],
|
|
1021
|
+
strokeColor: Object.values(colors)[strokeColorIndex],
|
|
917
1022
|
strokeWidth: 1.5 * scaleFactor,
|
|
918
1023
|
size: size,
|
|
919
1024
|
rotation: rotation,
|
|
@@ -925,14 +1030,14 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
925
1030
|
}
|
|
926
1031
|
// Add connecting lines scaled to canvas size
|
|
927
1032
|
ctx.globalAlpha = 0.2;
|
|
928
|
-
ctx.strokeStyle = colors[colors.length - 1];
|
|
1033
|
+
ctx.strokeStyle = Object.values(colors)[Object.keys(colors).length - 1];
|
|
929
1034
|
ctx.lineWidth = 1 * scaleFactor;
|
|
930
1035
|
const numLines = Math.floor(15 * (width * height) / 1048576);
|
|
931
1036
|
for(let i = 0; i < numLines; i++){
|
|
932
|
-
const x1 = (0, $
|
|
933
|
-
const y1 = (0, $
|
|
934
|
-
const x2 = (0, $
|
|
935
|
-
const y2 = (0, $
|
|
1037
|
+
const x1 = (0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, i * 4, 0, width);
|
|
1038
|
+
const y1 = (0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, i * 4 + 1, 0, height);
|
|
1039
|
+
const x2 = (0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, i * 4 + 2, 0, width);
|
|
1040
|
+
const y2 = (0, $616009579e3d72c5$export$6b193cae730c547a)(gitHash, i * 4 + 3, 0, height);
|
|
936
1041
|
ctx.beginPath();
|
|
937
1042
|
ctx.moveTo(x1, y1);
|
|
938
1043
|
ctx.lineTo(x2, y2);
|
|
@@ -950,13 +1055,13 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
950
1055
|
* @param {number} width - The width of the generated image
|
|
951
1056
|
* @param {number} height - The height of the generated image
|
|
952
1057
|
* @returns {string} Path to the saved image
|
|
953
|
-
*/ function $
|
|
954
|
-
if (!(0, $
|
|
1058
|
+
*/ function $149c1bd638913645$export$ea0bbc160a51089a(imageBuffer, outputDir, gitHash, label = "", width, height) {
|
|
1059
|
+
if (!(0, $hgUW1$fs).existsSync(outputDir)) (0, $hgUW1$fs).mkdirSync(outputDir, {
|
|
955
1060
|
recursive: true
|
|
956
1061
|
});
|
|
957
1062
|
const filename = label ? `${label}-${width}x${height}-${gitHash.slice(0, 8)}.png` : `${gitHash.slice(0, 8)}-${width}x${height}.png`;
|
|
958
|
-
const outputPath = (0, $
|
|
959
|
-
(0, $
|
|
1063
|
+
const outputPath = (0, $hgUW1$path).join(outputDir, filename);
|
|
1064
|
+
(0, $hgUW1$fs).writeFileSync(outputPath, imageBuffer);
|
|
960
1065
|
console.log(`Generated: ${outputPath}`);
|
|
961
1066
|
return outputPath;
|
|
962
1067
|
}
|
|
@@ -970,5 +1075,5 @@ const savedImagePath = saveImageToFile(imageBuffer, './output', gitHash, 'exampl
|
|
|
970
1075
|
console.log(`Image saved to: ${savedImagePath}`);
|
|
971
1076
|
*/
|
|
972
1077
|
|
|
973
|
-
export {$
|
|
1078
|
+
export {$149c1bd638913645$export$491525bf12232411 as generateImageFromHash, $149c1bd638913645$export$ea0bbc160a51089a as saveImageToFile};
|
|
974
1079
|
//# sourceMappingURL=module.js.map
|