git-hash-art 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/main.js +136 -126
- package/dist/main.js.map +1 -1
- package/dist/module.js +974 -0
- package/dist/module.js.map +1 -0
- package/package.json +3 -5
- package/examples/angular-1024x1024-f31a6c3e.png +0 -0
- package/examples/banner-1920x480-d847ffd4.png +0 -0
- package/examples/complex-2048x2048-deadbeef.png +0 -0
- package/examples/instagram-square-1080x1080-ff00ff00.png +0 -0
- package/examples/instagram-story-1080x1920-abc123de.png +0 -0
- package/examples/linkedin-banner-1584x396-bbbbbbbb.png +0 -0
- package/examples/minimal-1024x1024-00000000.png +0 -0
- package/examples/phone-wallpaper-1170x2532-ffffffff.png +0 -0
- package/examples/react-1024x1024-46192e59.png +0 -0
- package/examples/tablet-wallpaper-2048x2732-12345678.png +0 -0
- package/examples/twitter-header-1500x500-77777777.png +0 -0
- package/examples/ultrawide-3440x1440-a3e126e5.png +0 -0
package/dist/main.js
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var $gXNCa$canvas = require("canvas");
|
|
2
|
+
var $gXNCa$fs = require("fs");
|
|
3
|
+
var $gXNCa$path = require("path");
|
|
4
|
+
var $gXNCa$colorscheme = require("color-scheme");
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function $parcel$export(e, n, v, s) {
|
|
12
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$parcel$export(module.exports, "generateImageFromHash", () => $4fa36e821943b400$export$491525bf12232411);
|
|
16
|
+
$parcel$export(module.exports, "saveImageToFile", () => $4fa36e821943b400$export$ea0bbc160a51089a);
|
|
17
|
+
|
|
7
18
|
|
|
8
19
|
|
|
9
20
|
|
|
10
|
-
const $
|
|
21
|
+
const $c771cd4f2f8ecacb$export$8daab6f91f7ff730 = (ctx, size)=>{
|
|
11
22
|
ctx.beginPath();
|
|
12
23
|
ctx.arc(0, 0, size / 2, 0, Math.PI * 2);
|
|
13
24
|
};
|
|
14
|
-
const $
|
|
25
|
+
const $c771cd4f2f8ecacb$export$9340b6a85ea854b9 = (ctx, size)=>{
|
|
15
26
|
ctx.beginPath();
|
|
16
27
|
ctx.rect(-size / 2, -size / 2, size, size);
|
|
17
28
|
};
|
|
18
|
-
const $
|
|
29
|
+
const $c771cd4f2f8ecacb$export$e6b70c7883316010 = (ctx, size)=>{
|
|
19
30
|
ctx.beginPath();
|
|
20
31
|
ctx.moveTo(0, -size / 2);
|
|
21
32
|
ctx.lineTo(-size / 2, size / 2);
|
|
22
33
|
ctx.lineTo(size / 2, size / 2);
|
|
23
34
|
ctx.closePath();
|
|
24
35
|
};
|
|
25
|
-
const $
|
|
36
|
+
const $c771cd4f2f8ecacb$export$252d2895fb67397b = (ctx, size)=>{
|
|
26
37
|
ctx.beginPath();
|
|
27
38
|
for(let i = 0; i < 6; i++){
|
|
28
39
|
const angle = Math.PI / 8 * i;
|
|
@@ -33,7 +44,7 @@ const $e982bdf2d46bd221$export$252d2895fb67397b = (ctx, size)=>{
|
|
|
33
44
|
}
|
|
34
45
|
ctx.closePath();
|
|
35
46
|
};
|
|
36
|
-
const $
|
|
47
|
+
const $c771cd4f2f8ecacb$export$ca57b923902a3c0 = (ctx, size)=>{
|
|
37
48
|
ctx.beginPath();
|
|
38
49
|
for(let i = 0; i < 10; i++){
|
|
39
50
|
const angle = Math.PI / 5 + Math.PI / 5 * i * 3;
|
|
@@ -45,7 +56,7 @@ const $e982bdf2d46bd221$export$ca57b923902a3c0 = (ctx, size)=>{
|
|
|
45
56
|
}
|
|
46
57
|
ctx.closePath();
|
|
47
58
|
};
|
|
48
|
-
const $
|
|
59
|
+
const $c771cd4f2f8ecacb$export$cf8f2f05ac4f561f = (ctx, size)=>{
|
|
49
60
|
ctx.beginPath();
|
|
50
61
|
for(let i = 0; i < 10; i++){
|
|
51
62
|
const angle = Math.PI / 30 + Math.PI / 30 * i * 8;
|
|
@@ -57,13 +68,13 @@ const $e982bdf2d46bd221$export$cf8f2f05ac4f561f = (ctx, size)=>{
|
|
|
57
68
|
}
|
|
58
69
|
ctx.closePath();
|
|
59
70
|
};
|
|
60
|
-
const $
|
|
71
|
+
const $c771cd4f2f8ecacb$export$1ed0c0bc398b6246 = (ctx, size)=>{
|
|
61
72
|
ctx.beginPath();
|
|
62
73
|
ctx.moveTo(0, size / 4);
|
|
63
74
|
ctx.quadraticCurveTo(size / 2, size / 4, 0, -size / 4);
|
|
64
75
|
ctx.quadraticCurveTo(-size / 2, size / 4, 0, size / 4);
|
|
65
76
|
};
|
|
66
|
-
const $
|
|
77
|
+
const $c771cd4f2f8ecacb$export$57ec12daf141ce6 = (ctx, size)=>{
|
|
67
78
|
ctx.beginPath();
|
|
68
79
|
ctx.moveTo(0, -size / 2);
|
|
69
80
|
ctx.lineTo(size / 2, 0);
|
|
@@ -71,7 +82,7 @@ const $e982bdf2d46bd221$export$57ec12daf141ce6 = (ctx, size)=>{
|
|
|
71
82
|
ctx.lineTo(-size / 2, 0);
|
|
72
83
|
ctx.closePath();
|
|
73
84
|
};
|
|
74
|
-
const $
|
|
85
|
+
const $c771cd4f2f8ecacb$export$39f25a4fc5491539 = (ctx, size)=>{
|
|
75
86
|
ctx.beginPath();
|
|
76
87
|
ctx.moveTo(-size / 2, -size / 2);
|
|
77
88
|
ctx.lineTo(size / 2, -size / 2);
|
|
@@ -79,20 +90,20 @@ const $e982bdf2d46bd221$export$39f25a4fc5491539 = (ctx, size)=>{
|
|
|
79
90
|
ctx.lineTo(-size / 2, size / 2);
|
|
80
91
|
ctx.closePath();
|
|
81
92
|
};
|
|
82
|
-
const $
|
|
83
|
-
circle: $
|
|
84
|
-
square: $
|
|
85
|
-
triangle: $
|
|
86
|
-
hexagon: $
|
|
87
|
-
star: $
|
|
88
|
-
"jacked-star": $
|
|
89
|
-
heart: $
|
|
90
|
-
diamond: $
|
|
91
|
-
cube: $
|
|
93
|
+
const $c771cd4f2f8ecacb$export$492753207a5258e1 = {
|
|
94
|
+
circle: $c771cd4f2f8ecacb$export$8daab6f91f7ff730,
|
|
95
|
+
square: $c771cd4f2f8ecacb$export$9340b6a85ea854b9,
|
|
96
|
+
triangle: $c771cd4f2f8ecacb$export$e6b70c7883316010,
|
|
97
|
+
hexagon: $c771cd4f2f8ecacb$export$252d2895fb67397b,
|
|
98
|
+
star: $c771cd4f2f8ecacb$export$ca57b923902a3c0,
|
|
99
|
+
"jacked-star": $c771cd4f2f8ecacb$export$cf8f2f05ac4f561f,
|
|
100
|
+
heart: $c771cd4f2f8ecacb$export$1ed0c0bc398b6246,
|
|
101
|
+
diamond: $c771cd4f2f8ecacb$export$57ec12daf141ce6,
|
|
102
|
+
cube: $c771cd4f2f8ecacb$export$39f25a4fc5491539
|
|
92
103
|
};
|
|
93
104
|
|
|
94
105
|
|
|
95
|
-
const $
|
|
106
|
+
const $d53f79a9c1941d01$export$9265403940be6b4 = {
|
|
96
107
|
// Standard sizes with different hashes
|
|
97
108
|
react: {
|
|
98
109
|
hash: "46192e59d42f741c761cbea79462a8b3815dd905",
|
|
@@ -182,7 +193,7 @@ const $81d7f9c14b75c186$export$9265403940be6b4 = {
|
|
|
182
193
|
maxShapeSize: 250
|
|
183
194
|
}
|
|
184
195
|
};
|
|
185
|
-
const $
|
|
196
|
+
const $d53f79a9c1941d01$export$3572305709b6b48c = {
|
|
186
197
|
strokeStyle: "#000000",
|
|
187
198
|
fillStyle: "transparent",
|
|
188
199
|
lineWidth: 1,
|
|
@@ -190,12 +201,12 @@ const $81d7f9c14b75c186$export$3572305709b6b48c = {
|
|
|
190
201
|
iterations: 1,
|
|
191
202
|
animate: false
|
|
192
203
|
};
|
|
193
|
-
const $
|
|
204
|
+
const $d53f79a9c1941d01$export$a4ca1369b6d2c19e = {
|
|
194
205
|
BASIC: "basic",
|
|
195
206
|
DETAILED: "detailed",
|
|
196
207
|
ANIMATED: "animated"
|
|
197
208
|
};
|
|
198
|
-
const $
|
|
209
|
+
const $d53f79a9c1941d01$export$bb9e4790bc99ae59 = {
|
|
199
210
|
GOLDEN_RATIO: 1.618034,
|
|
200
211
|
SQUARE_ROOT_2: Math.sqrt(2),
|
|
201
212
|
SQUARE_ROOT_3: Math.sqrt(3),
|
|
@@ -203,7 +214,7 @@ const $81d7f9c14b75c186$export$bb9e4790bc99ae59 = {
|
|
|
203
214
|
PI: Math.PI,
|
|
204
215
|
PHI: (1 + Math.sqrt(5)) / 2
|
|
205
216
|
};
|
|
206
|
-
const $
|
|
217
|
+
const $d53f79a9c1941d01$export$c36defeab44ba3b3 = {
|
|
207
218
|
flowerOfLifeMandala: (size)=>[
|
|
208
219
|
// { type: "flowerOfLife", config: { size } },
|
|
209
220
|
{
|
|
@@ -260,25 +271,25 @@ const $81d7f9c14b75c186$export$c36defeab44ba3b3 = {
|
|
|
260
271
|
};
|
|
261
272
|
|
|
262
273
|
|
|
263
|
-
const $
|
|
264
|
-
const $
|
|
274
|
+
const $42d2a3c4a2119a18$export$e6bfdeff8bfc94f9 = (degrees)=>degrees * Math.PI / 180;
|
|
275
|
+
const $42d2a3c4a2119a18$export$e46c5570db033611 = (ctx, size, config)=>{
|
|
265
276
|
ctx.save();
|
|
266
277
|
ctx.translate(0, 0);
|
|
267
|
-
if (config.rotation) ctx.rotate($
|
|
278
|
+
if (config.rotation) ctx.rotate($42d2a3c4a2119a18$export$e6bfdeff8bfc94f9(config.rotation));
|
|
268
279
|
ctx.lineWidth = config.lineWidth;
|
|
269
280
|
ctx.strokeStyle = config.strokeStyle;
|
|
270
281
|
ctx.fillStyle = config.fillStyle;
|
|
271
282
|
};
|
|
272
|
-
const $
|
|
283
|
+
const $42d2a3c4a2119a18$export$68ae68d395d27fd1 = (ctx)=>{
|
|
273
284
|
ctx.restore();
|
|
274
285
|
};
|
|
275
|
-
const $
|
|
286
|
+
const $42d2a3c4a2119a18$export$70ba51ca253810ef = (type)=>({
|
|
276
287
|
enabled: false,
|
|
277
288
|
duration: 1000,
|
|
278
289
|
easing: "linear",
|
|
279
290
|
type: type
|
|
280
291
|
});
|
|
281
|
-
const $
|
|
292
|
+
const $42d2a3c4a2119a18$export$5627764dc1e1d74a = (cx, cy, radius, segments)=>{
|
|
282
293
|
const points = [];
|
|
283
294
|
for(let i = 0; i < segments; i++){
|
|
284
295
|
const angle = i / segments * Math.PI * 2;
|
|
@@ -291,7 +302,7 @@ const $3607eda4304ea847$export$5627764dc1e1d74a = (cx, cy, radius, segments)=>{
|
|
|
291
302
|
};
|
|
292
303
|
|
|
293
304
|
|
|
294
|
-
const $
|
|
305
|
+
const $5c4ee523c150698e$export$90cc629a1c6121c7 = {
|
|
295
306
|
platonic: {
|
|
296
307
|
tetrahedron: {
|
|
297
308
|
vertices: 4,
|
|
@@ -323,16 +334,16 @@ const $6768203c11c08d59$export$90cc629a1c6121c7 = {
|
|
|
323
334
|
ratio: 1.618034
|
|
324
335
|
}
|
|
325
336
|
};
|
|
326
|
-
const $
|
|
337
|
+
const $5c4ee523c150698e$export$4721fcae39954914 = (ctx, size, type, config = {})=>{
|
|
327
338
|
const finalConfig = {
|
|
328
|
-
...(0, $
|
|
339
|
+
...(0, $d53f79a9c1941d01$export$3572305709b6b48c),
|
|
329
340
|
...config
|
|
330
341
|
};
|
|
331
|
-
(0, $
|
|
332
|
-
const { vertices: vertices } = $
|
|
342
|
+
(0, $42d2a3c4a2119a18$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
343
|
+
const { vertices: vertices } = $5c4ee523c150698e$export$90cc629a1c6121c7.platonic[type];
|
|
333
344
|
const radius = size / 2;
|
|
334
345
|
// Calculate vertices based on platonic solid type
|
|
335
|
-
const points = (0, $
|
|
346
|
+
const points = (0, $42d2a3c4a2119a18$export$5627764dc1e1d74a)(0, 0, radius, vertices);
|
|
336
347
|
ctx.beginPath();
|
|
337
348
|
// Draw edges between vertices
|
|
338
349
|
points.forEach((p1, i)=>{
|
|
@@ -343,15 +354,15 @@ const $6768203c11c08d59$export$4721fcae39954914 = (ctx, size, type, config = {})
|
|
|
343
354
|
});
|
|
344
355
|
if (finalConfig.fillStyle !== "transparent") ctx.fill();
|
|
345
356
|
ctx.stroke();
|
|
346
|
-
(0, $
|
|
357
|
+
(0, $42d2a3c4a2119a18$export$68ae68d395d27fd1)(ctx);
|
|
347
358
|
};
|
|
348
|
-
const $
|
|
359
|
+
const $5c4ee523c150698e$export$4091fa94ab006097 = (ctx, size, config = {})=>{
|
|
349
360
|
const finalConfig = {
|
|
350
|
-
...(0, $
|
|
351
|
-
...$
|
|
361
|
+
...(0, $d53f79a9c1941d01$export$3572305709b6b48c),
|
|
362
|
+
...$5c4ee523c150698e$export$90cc629a1c6121c7.fibonacci,
|
|
352
363
|
...config
|
|
353
364
|
};
|
|
354
|
-
(0, $
|
|
365
|
+
(0, $42d2a3c4a2119a18$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
355
366
|
let current = 1;
|
|
356
367
|
let previous = 1;
|
|
357
368
|
let scale = size / Math.pow(finalConfig.growthFactor, finalConfig.iterations);
|
|
@@ -370,14 +381,14 @@ const $6768203c11c08d59$export$4091fa94ab006097 = (ctx, size, config = {})=>{
|
|
|
370
381
|
ctx.rotate(Math.PI / 2);
|
|
371
382
|
}
|
|
372
383
|
ctx.stroke();
|
|
373
|
-
(0, $
|
|
384
|
+
(0, $42d2a3c4a2119a18$export$68ae68d395d27fd1)(ctx);
|
|
374
385
|
};
|
|
375
|
-
const $
|
|
386
|
+
const $5c4ee523c150698e$export$c9043b89bcb14ed9 = (ctx, size, config = {})=>{
|
|
376
387
|
const finalConfig = {
|
|
377
|
-
...(0, $
|
|
388
|
+
...(0, $d53f79a9c1941d01$export$3572305709b6b48c),
|
|
378
389
|
...config
|
|
379
390
|
};
|
|
380
|
-
(0, $
|
|
391
|
+
(0, $42d2a3c4a2119a18$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
381
392
|
const gridSize = 8;
|
|
382
393
|
const unit = size / gridSize;
|
|
383
394
|
ctx.beginPath();
|
|
@@ -398,14 +409,14 @@ const $6768203c11c08d59$export$c9043b89bcb14ed9 = (ctx, size, config = {})=>{
|
|
|
398
409
|
}
|
|
399
410
|
if (finalConfig.fillStyle !== "transparent") ctx.fill();
|
|
400
411
|
ctx.stroke();
|
|
401
|
-
(0, $
|
|
412
|
+
(0, $42d2a3c4a2119a18$export$68ae68d395d27fd1)(ctx);
|
|
402
413
|
};
|
|
403
|
-
const $
|
|
414
|
+
const $5c4ee523c150698e$export$16ea6f9310920305 = (ctx, size, config = {})=>{
|
|
404
415
|
const finalConfig = {
|
|
405
|
-
...(0, $
|
|
416
|
+
...(0, $d53f79a9c1941d01$export$3572305709b6b48c),
|
|
406
417
|
...config
|
|
407
418
|
};
|
|
408
|
-
(0, $
|
|
419
|
+
(0, $42d2a3c4a2119a18$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
409
420
|
const gridSize = 4;
|
|
410
421
|
const unit = size / gridSize;
|
|
411
422
|
const drawKnotSegment = (x, y, type)=>{
|
|
@@ -428,19 +439,19 @@ const $6768203c11c08d59$export$16ea6f9310920305 = (ctx, size, config = {})=>{
|
|
|
428
439
|
const y = (j - gridSize / 2) * unit;
|
|
429
440
|
drawKnotSegment(x, y, (i + j) % 2 === 0 ? "over" : "under");
|
|
430
441
|
}
|
|
431
|
-
(0, $
|
|
442
|
+
(0, $42d2a3c4a2119a18$export$68ae68d395d27fd1)(ctx);
|
|
432
443
|
};
|
|
433
|
-
const $
|
|
444
|
+
const $5c4ee523c150698e$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
434
445
|
const finalConfig = {
|
|
435
|
-
...(0, $
|
|
446
|
+
...(0, $d53f79a9c1941d01$export$3572305709b6b48c),
|
|
436
447
|
...config
|
|
437
448
|
};
|
|
438
|
-
(0, $
|
|
449
|
+
(0, $42d2a3c4a2119a18$export$e46c5570db033611)(ctx, size, finalConfig);
|
|
439
450
|
const radius = size / 2;
|
|
440
451
|
// Draw two intersecting tetrahedra
|
|
441
452
|
ctx.beginPath();
|
|
442
453
|
// First tetrahedron
|
|
443
|
-
const points1 = (0, $
|
|
454
|
+
const points1 = (0, $42d2a3c4a2119a18$export$5627764dc1e1d74a)(0, 0, radius, 3);
|
|
444
455
|
points1.forEach((p1, i)=>{
|
|
445
456
|
points1.slice(i + 1).forEach((p2)=>{
|
|
446
457
|
ctx.moveTo(p1.x, p1.y);
|
|
@@ -449,7 +460,7 @@ const $6768203c11c08d59$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
|
449
460
|
});
|
|
450
461
|
// Second tetrahedron (rotated)
|
|
451
462
|
ctx.rotate(Math.PI / 6);
|
|
452
|
-
const points2 = (0, $
|
|
463
|
+
const points2 = (0, $42d2a3c4a2119a18$export$5627764dc1e1d74a)(0, 0, radius, 3);
|
|
453
464
|
points2.forEach((p1, i)=>{
|
|
454
465
|
points2.slice(i + 1).forEach((p2)=>{
|
|
455
466
|
ctx.moveTo(p1.x, p1.y);
|
|
@@ -458,19 +469,19 @@ const $6768203c11c08d59$export$661ad3ddfb8912ed = (ctx, size, config = {})=>{
|
|
|
458
469
|
});
|
|
459
470
|
if (finalConfig.fillStyle !== "transparent") ctx.fill();
|
|
460
471
|
ctx.stroke();
|
|
461
|
-
(0, $
|
|
472
|
+
(0, $42d2a3c4a2119a18$export$68ae68d395d27fd1)(ctx);
|
|
462
473
|
};
|
|
463
|
-
const $
|
|
464
|
-
platonicSolid: (ctx, size, type = "tetrahedron", config)=>$
|
|
465
|
-
fibonacciSpiral: (ctx, size, config)=>$
|
|
466
|
-
islamicPattern: (ctx, size, config)=>$
|
|
467
|
-
celticKnot: (ctx, size, config)=>$
|
|
468
|
-
merkaba: (ctx, size, config)=>$
|
|
474
|
+
const $5c4ee523c150698e$export$dbe318a13ce51887 = {
|
|
475
|
+
platonicSolid: (ctx, size, type = "tetrahedron", config)=>$5c4ee523c150698e$export$4721fcae39954914(ctx, size, type, config),
|
|
476
|
+
fibonacciSpiral: (ctx, size, config)=>$5c4ee523c150698e$export$4091fa94ab006097(ctx, size, config),
|
|
477
|
+
islamicPattern: (ctx, size, config)=>$5c4ee523c150698e$export$c9043b89bcb14ed9(ctx, size, config),
|
|
478
|
+
celticKnot: (ctx, size, config)=>$5c4ee523c150698e$export$16ea6f9310920305(ctx, size, config),
|
|
479
|
+
merkaba: (ctx, size, config)=>$5c4ee523c150698e$export$661ad3ddfb8912ed(ctx, size, config)
|
|
469
480
|
};
|
|
470
481
|
|
|
471
482
|
|
|
472
483
|
|
|
473
|
-
const $
|
|
484
|
+
const $250b0111f88ffe51$export$3bac12a72d9de58c = (ctx, size)=>{
|
|
474
485
|
const radius = size / 6;
|
|
475
486
|
const centers = [
|
|
476
487
|
{
|
|
@@ -508,7 +519,7 @@ const $4191f40726a1f4db$export$3bac12a72d9de58c = (ctx, size)=>{
|
|
|
508
519
|
ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
|
|
509
520
|
});
|
|
510
521
|
};
|
|
511
|
-
const $
|
|
522
|
+
const $250b0111f88ffe51$export$639bf214428ceec2 = (ctx, size)=>{
|
|
512
523
|
const radius = size / 12;
|
|
513
524
|
const spacing = radius * 2.5;
|
|
514
525
|
// Sephirot positions (traditional layout)
|
|
@@ -569,7 +580,7 @@ const $4191f40726a1f4db$export$639bf214428ceec2 = (ctx, size)=>{
|
|
|
569
580
|
});
|
|
570
581
|
});
|
|
571
582
|
};
|
|
572
|
-
const $
|
|
583
|
+
const $250b0111f88ffe51$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
573
584
|
const radius = size / 3;
|
|
574
585
|
// Create 13 points - one center and 12 vertices of an icosahedron
|
|
575
586
|
// const phi = (1 + Math.sqrt(5)) / 2; // Golden ratio
|
|
@@ -578,8 +589,8 @@ const $4191f40726a1f4db$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
|
578
589
|
x: 0,
|
|
579
590
|
y: 0
|
|
580
591
|
},
|
|
581
|
-
...(0, $
|
|
582
|
-
...(0, $
|
|
592
|
+
...(0, $42d2a3c4a2119a18$export$5627764dc1e1d74a)(0, 0, radius, 6),
|
|
593
|
+
...(0, $42d2a3c4a2119a18$export$5627764dc1e1d74a)(0, 0, radius * 1.5, 6) // Outer hexagon
|
|
583
594
|
];
|
|
584
595
|
ctx.beginPath();
|
|
585
596
|
// Draw all connecting lines
|
|
@@ -590,7 +601,7 @@ const $4191f40726a1f4db$export$de26673ceb3e04eb = (ctx, size)=>{
|
|
|
590
601
|
});
|
|
591
602
|
});
|
|
592
603
|
};
|
|
593
|
-
const $
|
|
604
|
+
const $250b0111f88ffe51$export$f743702d1590aefb = (ctx, size)=>{
|
|
594
605
|
const radius = size / 2;
|
|
595
606
|
ctx.beginPath();
|
|
596
607
|
// Draw outer triangles
|
|
@@ -619,14 +630,14 @@ const $4191f40726a1f4db$export$f743702d1590aefb = (ctx, size)=>{
|
|
|
619
630
|
ctx.lineTo(0, 0);
|
|
620
631
|
}
|
|
621
632
|
};
|
|
622
|
-
const $
|
|
633
|
+
const $250b0111f88ffe51$export$980631444e370ab0 = (ctx, size)=>{
|
|
623
634
|
const radius = size / 4;
|
|
624
635
|
const centers = [
|
|
625
636
|
{
|
|
626
637
|
x: 0,
|
|
627
638
|
y: 0
|
|
628
639
|
},
|
|
629
|
-
...(0, $
|
|
640
|
+
...(0, $42d2a3c4a2119a18$export$5627764dc1e1d74a)(0, 0, radius * 2, 6)
|
|
630
641
|
];
|
|
631
642
|
ctx.beginPath();
|
|
632
643
|
centers.forEach((center)=>{
|
|
@@ -634,14 +645,14 @@ const $4191f40726a1f4db$export$980631444e370ab0 = (ctx, size)=>{
|
|
|
634
645
|
ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
|
|
635
646
|
});
|
|
636
647
|
};
|
|
637
|
-
const $
|
|
648
|
+
const $250b0111f88ffe51$export$eeae7765f05012e2 = (ctx, size)=>{
|
|
638
649
|
const radius = size / 3;
|
|
639
650
|
ctx.beginPath();
|
|
640
651
|
// Draw two overlapping circles
|
|
641
652
|
ctx.arc(-radius / 2, 0, radius, 0, Math.PI * 2);
|
|
642
653
|
ctx.arc(radius / 2, 0, radius, 0, Math.PI * 2);
|
|
643
654
|
};
|
|
644
|
-
const $
|
|
655
|
+
const $250b0111f88ffe51$export$3355220a8108efc3 = (ctx, size)=>{
|
|
645
656
|
const outerRadius = size / 2;
|
|
646
657
|
const innerRadius = size / 4;
|
|
647
658
|
const steps = 36;
|
|
@@ -661,33 +672,33 @@ const $4191f40726a1f4db$export$3355220a8108efc3 = (ctx, size)=>{
|
|
|
661
672
|
}
|
|
662
673
|
}
|
|
663
674
|
};
|
|
664
|
-
const $
|
|
675
|
+
const $250b0111f88ffe51$export$c2fc138f94dd4b2a = {
|
|
665
676
|
// flowerOfLife: drawFlowerOfLife,
|
|
666
677
|
// treeOfLife: drawTreeOfLife,
|
|
667
|
-
metatronsCube: $
|
|
668
|
-
sriYantra: $
|
|
669
|
-
seedOfLife: $
|
|
670
|
-
vesicaPiscis: $
|
|
671
|
-
torus: $
|
|
678
|
+
metatronsCube: $250b0111f88ffe51$export$de26673ceb3e04eb,
|
|
679
|
+
sriYantra: $250b0111f88ffe51$export$f743702d1590aefb,
|
|
680
|
+
seedOfLife: $250b0111f88ffe51$export$980631444e370ab0,
|
|
681
|
+
vesicaPiscis: $250b0111f88ffe51$export$eeae7765f05012e2,
|
|
682
|
+
torus: $250b0111f88ffe51$export$3355220a8108efc3
|
|
672
683
|
};
|
|
673
684
|
|
|
674
685
|
|
|
675
|
-
const $
|
|
676
|
-
...(0, $
|
|
677
|
-
...(0, $
|
|
678
|
-
...(0, $
|
|
686
|
+
const $299e6c12a93ad3c3$export$4ff7fc6f1af248b5 = {
|
|
687
|
+
...(0, $c771cd4f2f8ecacb$export$492753207a5258e1),
|
|
688
|
+
...(0, $5c4ee523c150698e$export$dbe318a13ce51887),
|
|
689
|
+
...(0, $250b0111f88ffe51$export$c2fc138f94dd4b2a)
|
|
679
690
|
};
|
|
680
691
|
|
|
681
692
|
|
|
682
|
-
function $
|
|
693
|
+
function $f391ca372769b92d$export$39a95c82b20fdf81(gitHash) {
|
|
683
694
|
return parseInt(gitHash.slice(0, 8), 16);
|
|
684
695
|
}
|
|
685
|
-
function $
|
|
696
|
+
function $f391ca372769b92d$export$6b193cae730c547a(hash, index, min, max) {
|
|
686
697
|
const hexPair = hash.substr(index * 2 % hash.length, 2);
|
|
687
698
|
const decimal = parseInt(hexPair, 16);
|
|
688
699
|
return min + decimal / 255 * (max - min);
|
|
689
700
|
}
|
|
690
|
-
const $
|
|
701
|
+
const $f391ca372769b92d$export$bb9e4790bc99ae59 = {
|
|
691
702
|
GOLDEN_RATIO: 1.618034,
|
|
692
703
|
SQUARE_ROOT_2: Math.sqrt(2),
|
|
693
704
|
SQUARE_ROOT_3: Math.sqrt(3),
|
|
@@ -695,7 +706,7 @@ const $7f8638f37c57b389$export$bb9e4790bc99ae59 = {
|
|
|
695
706
|
PI: Math.PI,
|
|
696
707
|
PHI: (1 + Math.sqrt(5)) / 2
|
|
697
708
|
};
|
|
698
|
-
class $
|
|
709
|
+
class $f391ca372769b92d$export$da2372f11bc66b3f {
|
|
699
710
|
static getProportionalSize(baseSize, proportion) {
|
|
700
711
|
return baseSize * proportion;
|
|
701
712
|
}
|
|
@@ -706,31 +717,31 @@ class $7f8638f37c57b389$export$da2372f11bc66b3f {
|
|
|
706
717
|
static layerPatterns(ctx, patterns, config) {
|
|
707
718
|
const { baseSize: baseSize, baseOpacity: baseOpacity = 0.6, opacityReduction: opacityReduction = 0.1, rotationOffset: rotationOffset = 0, proportionType: proportionType = "GOLDEN_RATIO" } = config;
|
|
708
719
|
patterns.forEach((pattern, index)=>{
|
|
709
|
-
const size = this.getProportionalSize(baseSize, Math.pow($
|
|
720
|
+
const size = this.getProportionalSize(baseSize, Math.pow($f391ca372769b92d$export$bb9e4790bc99ae59[proportionType], index));
|
|
710
721
|
const opacity = Math.max(0.1, baseOpacity - index * opacityReduction);
|
|
711
722
|
const rotation = rotationOffset * index;
|
|
712
723
|
ctx.save();
|
|
713
724
|
ctx.globalAlpha = opacity;
|
|
714
725
|
ctx.rotate(rotation * Math.PI / 180);
|
|
715
|
-
(0, $
|
|
726
|
+
(0, $299e6c12a93ad3c3$export$4ff7fc6f1af248b5)[pattern.type](ctx, size, pattern.config);
|
|
716
727
|
ctx.restore();
|
|
717
728
|
});
|
|
718
729
|
}
|
|
719
730
|
}
|
|
720
731
|
|
|
721
732
|
|
|
722
|
-
function $
|
|
723
|
-
const seed = (0, $
|
|
724
|
-
const scheme = new (0, $
|
|
733
|
+
function $89ee6ae350f2d46f$export$f116a24fd288e742(gitHash) {
|
|
734
|
+
const seed = (0, $f391ca372769b92d$export$39a95c82b20fdf81)(gitHash);
|
|
735
|
+
const scheme = new (0, ($parcel$interopDefault($gXNCa$colorscheme)))();
|
|
725
736
|
scheme.from_hue(seed % 360).scheme("analogic").variation("soft");
|
|
726
737
|
let colors = scheme.colors().map((hex)=>`#${hex}`);
|
|
727
738
|
const contrastingHue = (seed + 180) % 360;
|
|
728
|
-
const contrastingScheme = new (0, $
|
|
739
|
+
const contrastingScheme = new (0, ($parcel$interopDefault($gXNCa$colorscheme)))();
|
|
729
740
|
contrastingScheme.from_hue(contrastingHue).scheme("mono").variation("soft");
|
|
730
741
|
colors.push(`#${contrastingScheme.colors()[0]}`);
|
|
731
742
|
return colors;
|
|
732
743
|
}
|
|
733
|
-
class $
|
|
744
|
+
class $89ee6ae350f2d46f$export$ab958c550f521376 {
|
|
734
745
|
constructor(gitHash){
|
|
735
746
|
this.seed = this.gitHashToSeed(gitHash);
|
|
736
747
|
this.baseScheme = this.generateBaseScheme();
|
|
@@ -741,12 +752,12 @@ class $8f4da37788745c0d$export$ab958c550f521376 {
|
|
|
741
752
|
return parseInt(hash.slice(0, 8), 16);
|
|
742
753
|
}
|
|
743
754
|
generateBaseScheme() {
|
|
744
|
-
const scheme = new (0, $
|
|
755
|
+
const scheme = new (0, ($parcel$interopDefault($gXNCa$colorscheme)))();
|
|
745
756
|
return scheme.from_hue(this.seed % 360).scheme("analogic").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
746
757
|
}
|
|
747
758
|
generateComplementaryScheme() {
|
|
748
759
|
const complementaryHue = (this.seed + 180) % 360;
|
|
749
|
-
const scheme = new (0, $
|
|
760
|
+
const scheme = new (0, ($parcel$interopDefault($gXNCa$colorscheme)))();
|
|
750
761
|
return scheme.from_hue(complementaryHue).scheme("mono").variation("soft").colors().map((hex)=>`#${hex}`);
|
|
751
762
|
}
|
|
752
763
|
generateMetallicColors() {
|
|
@@ -792,20 +803,20 @@ class $8f4da37788745c0d$export$ab958c550f521376 {
|
|
|
792
803
|
|
|
793
804
|
|
|
794
805
|
|
|
795
|
-
function $
|
|
806
|
+
function $ac20c1c0ccca1e19$export$71b514a25c47df50(ctx, shape, x, y, fillColor, strokeColor, strokeWidth, size, rotation) {
|
|
796
807
|
ctx.save();
|
|
797
808
|
ctx.translate(x, y);
|
|
798
809
|
ctx.rotate(rotation * Math.PI / 180);
|
|
799
810
|
ctx.fillStyle = fillColor;
|
|
800
811
|
ctx.strokeStyle = strokeColor;
|
|
801
812
|
ctx.lineWidth = strokeWidth;
|
|
802
|
-
const drawFunction = (0, $
|
|
813
|
+
const drawFunction = (0, $299e6c12a93ad3c3$export$4ff7fc6f1af248b5)[shape];
|
|
803
814
|
if (drawFunction) drawFunction(ctx, size);
|
|
804
815
|
ctx.fill();
|
|
805
816
|
ctx.stroke();
|
|
806
817
|
ctx.restore();
|
|
807
818
|
}
|
|
808
|
-
function $
|
|
819
|
+
function $ac20c1c0ccca1e19$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
809
820
|
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
821
|
ctx.save();
|
|
811
822
|
ctx.translate(x, y);
|
|
@@ -814,10 +825,10 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
814
825
|
ctx.fillStyle = fillColor;
|
|
815
826
|
ctx.strokeStyle = strokeColor;
|
|
816
827
|
ctx.lineWidth = strokeWidth;
|
|
817
|
-
const drawFunction = (0, $
|
|
828
|
+
const drawFunction = (0, $299e6c12a93ad3c3$export$4ff7fc6f1af248b5)[shape];
|
|
818
829
|
if (drawFunction) drawFunction(ctx, size);
|
|
819
830
|
// Layer additional patterns if specified
|
|
820
|
-
if (patterns.length > 0) (0, $
|
|
831
|
+
if (patterns.length > 0) (0, $f391ca372769b92d$export$da2372f11bc66b3f).layerPatterns(ctx, patterns, {
|
|
821
832
|
baseSize: size,
|
|
822
833
|
baseOpacity: baseOpacity,
|
|
823
834
|
opacityReduction: opacityReduction,
|
|
@@ -847,7 +858,7 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
847
858
|
* @param {string} gitHash - The git hash to use as a seed
|
|
848
859
|
* @param {ArtConfig} [config={}] - Configuration options
|
|
849
860
|
* @returns {Buffer} PNG buffer of the generated image
|
|
850
|
-
*/ function $
|
|
861
|
+
*/ function $4fa36e821943b400$export$491525bf12232411(gitHash, config = {}) {
|
|
851
862
|
// Default configuration
|
|
852
863
|
const defaultConfig = {
|
|
853
864
|
width: 2048,
|
|
@@ -867,9 +878,9 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
867
878
|
const { width: width, height: height, gridSize: gridSize, layers: layers, minShapeSize: minShapeSize, maxShapeSize: maxShapeSize, baseOpacity: baseOpacity, opacityReduction: opacityReduction } = finalConfig;
|
|
868
879
|
// Calculate shapes per layer based on grid size if not provided
|
|
869
880
|
finalConfig.shapesPerLayer = finalConfig.shapesPerLayer || Math.floor(gridSize * gridSize * 1.5);
|
|
870
|
-
const canvas = (0, $
|
|
881
|
+
const canvas = (0, $gXNCa$canvas.createCanvas)(width, height);
|
|
871
882
|
const ctx = canvas.getContext("2d");
|
|
872
|
-
const colorScheme = new (0, $
|
|
883
|
+
const colorScheme = new (0, $89ee6ae350f2d46f$export$ab958c550f521376)(gitHash);
|
|
873
884
|
const colors = colorScheme.getColorPalette("chakra");
|
|
874
885
|
// Create a gradient background
|
|
875
886
|
const gradient = ctx.createLinearGradient(0, 0, width, height);
|
|
@@ -877,7 +888,7 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
877
888
|
gradient.addColorStop(1, colorScheme.baseScheme[1]);
|
|
878
889
|
ctx.fillStyle = gradient;
|
|
879
890
|
ctx.fillRect(0, 0, width, height);
|
|
880
|
-
const shapeNames = Object.keys((0, $
|
|
891
|
+
const shapeNames = Object.keys((0, $299e6c12a93ad3c3$export$4ff7fc6f1af248b5));
|
|
881
892
|
const cellWidth = width / gridSize;
|
|
882
893
|
const cellHeight = height / gridSize;
|
|
883
894
|
// Scale shape sizes based on canvas dimensions
|
|
@@ -885,20 +896,20 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
885
896
|
const adjustedMinSize = minShapeSize * scaleFactor;
|
|
886
897
|
const adjustedMaxSize = maxShapeSize * scaleFactor;
|
|
887
898
|
for(let layer = 0; layer < layers; layer++){
|
|
888
|
-
const numShapes = finalConfig.shapesPerLayer + Math.floor((0, $
|
|
899
|
+
const numShapes = finalConfig.shapesPerLayer + Math.floor((0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, layer, 0, finalConfig.shapesPerLayer / 2));
|
|
889
900
|
const layerOpacity = baseOpacity - layer * opacityReduction;
|
|
890
901
|
for(let i = 0; i < numShapes; i++){
|
|
891
902
|
const gridX = Math.floor(i / gridSize);
|
|
892
903
|
const gridY = i % gridSize;
|
|
893
|
-
const cellOffsetX = (0, $
|
|
894
|
-
const cellOffsetY = (0, $
|
|
904
|
+
const cellOffsetX = (0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 2, 0, cellWidth);
|
|
905
|
+
const cellOffsetY = (0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 2 + 1, 0, cellHeight);
|
|
895
906
|
const x = gridX * cellWidth + cellOffsetX;
|
|
896
907
|
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, $
|
|
908
|
+
const shape = shapeNames[Math.floor((0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 3, 0, shapeNames.length))];
|
|
909
|
+
const size = adjustedMinSize + (0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 4, 0, adjustedMaxSize - adjustedMinSize);
|
|
910
|
+
const rotation = (0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 5, 0, 360);
|
|
911
|
+
const fillColorIndex = Math.floor((0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 6, 0, colors.length));
|
|
912
|
+
const strokeColorIndex = Math.floor((0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, layer * numShapes + i * 7, 0, colors.length));
|
|
902
913
|
ctx.globalAlpha = layerOpacity;
|
|
903
914
|
// drawShape(
|
|
904
915
|
// ctx,
|
|
@@ -911,7 +922,7 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
911
922
|
// size,
|
|
912
923
|
// rotation
|
|
913
924
|
// );
|
|
914
|
-
(0, $
|
|
925
|
+
(0, $ac20c1c0ccca1e19$export$bb35a6995ddbf32d)(ctx, shape, x, y, {
|
|
915
926
|
fillColor: colors[fillColorIndex],
|
|
916
927
|
strokeColor: colors[strokeColorIndex],
|
|
917
928
|
strokeWidth: 1.5 * scaleFactor,
|
|
@@ -929,10 +940,10 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
929
940
|
ctx.lineWidth = 1 * scaleFactor;
|
|
930
941
|
const numLines = Math.floor(15 * (width * height) / 1048576);
|
|
931
942
|
for(let i = 0; i < numLines; i++){
|
|
932
|
-
const x1 = (0, $
|
|
933
|
-
const y1 = (0, $
|
|
934
|
-
const x2 = (0, $
|
|
935
|
-
const y2 = (0, $
|
|
943
|
+
const x1 = (0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, i * 4, 0, width);
|
|
944
|
+
const y1 = (0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, i * 4 + 1, 0, height);
|
|
945
|
+
const x2 = (0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, i * 4 + 2, 0, width);
|
|
946
|
+
const y2 = (0, $f391ca372769b92d$export$6b193cae730c547a)(gitHash, i * 4 + 3, 0, height);
|
|
936
947
|
ctx.beginPath();
|
|
937
948
|
ctx.moveTo(x1, y1);
|
|
938
949
|
ctx.lineTo(x2, y2);
|
|
@@ -950,13 +961,13 @@ function $367ed528f09d76bf$export$bb35a6995ddbf32d(ctx, shape, x, y, config) {
|
|
|
950
961
|
* @param {number} width - The width of the generated image
|
|
951
962
|
* @param {number} height - The height of the generated image
|
|
952
963
|
* @returns {string} Path to the saved image
|
|
953
|
-
*/ function $
|
|
954
|
-
if (!(0, $
|
|
964
|
+
*/ function $4fa36e821943b400$export$ea0bbc160a51089a(imageBuffer, outputDir, gitHash, label = "", width, height) {
|
|
965
|
+
if (!(0, ($parcel$interopDefault($gXNCa$fs))).existsSync(outputDir)) (0, ($parcel$interopDefault($gXNCa$fs))).mkdirSync(outputDir, {
|
|
955
966
|
recursive: true
|
|
956
967
|
});
|
|
957
968
|
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, $
|
|
969
|
+
const outputPath = (0, ($parcel$interopDefault($gXNCa$path))).join(outputDir, filename);
|
|
970
|
+
(0, ($parcel$interopDefault($gXNCa$fs))).writeFileSync(outputPath, imageBuffer);
|
|
960
971
|
console.log(`Generated: ${outputPath}`);
|
|
961
972
|
return outputPath;
|
|
962
973
|
}
|
|
@@ -970,5 +981,4 @@ const savedImagePath = saveImageToFile(imageBuffer, './output', gitHash, 'exampl
|
|
|
970
981
|
console.log(`Image saved to: ${savedImagePath}`);
|
|
971
982
|
*/
|
|
972
983
|
|
|
973
|
-
export {$cf838c15c8b009ba$export$491525bf12232411 as generateImageFromHash, $cf838c15c8b009ba$export$ea0bbc160a51089a as saveImageToFile};
|
|
974
984
|
//# sourceMappingURL=main.js.map
|