@amphore-dev/kinogrida 0.3.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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +202 -0
  3. package/dist/classes/ArcShape.d.ts +26 -0
  4. package/dist/classes/ArcShape.d.ts.map +1 -0
  5. package/dist/classes/ArcShape.js +299 -0
  6. package/dist/classes/ArcShape.js.map +1 -0
  7. package/dist/classes/BaseShape.d.ts +37 -0
  8. package/dist/classes/BaseShape.d.ts.map +1 -0
  9. package/dist/classes/BaseShape.js +146 -0
  10. package/dist/classes/BaseShape.js.map +1 -0
  11. package/dist/classes/Kinogrida.d.ts +32 -0
  12. package/dist/classes/Kinogrida.d.ts.map +1 -0
  13. package/dist/classes/Kinogrida.js +223 -0
  14. package/dist/classes/Kinogrida.js.map +1 -0
  15. package/dist/classes/SquareShape.d.ts +12 -0
  16. package/dist/classes/SquareShape.d.ts.map +1 -0
  17. package/dist/classes/SquareShape.js +125 -0
  18. package/dist/classes/SquareShape.js.map +1 -0
  19. package/dist/classes/index.d.ts +2 -0
  20. package/dist/classes/index.d.ts.map +1 -0
  21. package/dist/classes/index.js +2 -0
  22. package/dist/classes/index.js.map +1 -0
  23. package/dist/constants/CColors.d.ts +8 -0
  24. package/dist/constants/CColors.d.ts.map +1 -0
  25. package/dist/constants/CColors.js +70 -0
  26. package/dist/constants/CColors.js.map +1 -0
  27. package/dist/constants/CShapes.d.ts +7 -0
  28. package/dist/constants/CShapes.d.ts.map +1 -0
  29. package/dist/constants/CShapes.js +7 -0
  30. package/dist/constants/CShapes.js.map +1 -0
  31. package/dist/constants/index.d.ts +3 -0
  32. package/dist/constants/index.d.ts.map +1 -0
  33. package/dist/constants/index.js +3 -0
  34. package/dist/constants/index.js.map +1 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +2 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/types/TGrid.d.ts +28 -0
  40. package/dist/types/TGrid.d.ts.map +1 -0
  41. package/dist/types/TGrid.js +2 -0
  42. package/dist/types/TGrid.js.map +1 -0
  43. package/dist/types/TKinogrida.d.ts +9 -0
  44. package/dist/types/TKinogrida.d.ts.map +1 -0
  45. package/dist/types/TKinogrida.js +2 -0
  46. package/dist/types/TKinogrida.js.map +1 -0
  47. package/dist/types/index.d.ts +2 -0
  48. package/dist/types/index.d.ts.map +1 -0
  49. package/dist/types/index.js +2 -0
  50. package/dist/types/index.js.map +1 -0
  51. package/dist/utils/UColors.d.ts +3 -0
  52. package/dist/utils/UColors.d.ts.map +1 -0
  53. package/dist/utils/UColors.js +12 -0
  54. package/dist/utils/UColors.js.map +1 -0
  55. package/dist/utils/UMath.d.ts +5 -0
  56. package/dist/utils/UMath.d.ts.map +1 -0
  57. package/dist/utils/UMath.js +15 -0
  58. package/dist/utils/UMath.js.map +1 -0
  59. package/dist/utils/UShapes.d.ts +2 -0
  60. package/dist/utils/UShapes.d.ts.map +1 -0
  61. package/dist/utils/UShapes.js +7 -0
  62. package/dist/utils/UShapes.js.map +1 -0
  63. package/dist/utils/index.d.ts +4 -0
  64. package/dist/utils/index.d.ts.map +1 -0
  65. package/dist/utils/index.js +4 -0
  66. package/dist/utils/index.js.map +1 -0
  67. package/package.json +77 -0
@@ -0,0 +1,70 @@
1
+ export const CCOLORS_OCEAN_PALETTE = [
2
+ "#001f3f", // navy
3
+ "#2E86AB", // ocean blue
4
+ "#A23B72", // deep pink
5
+ "#F18F01", // orange
6
+ "#C73E1D", // red
7
+ "#7FDBFF", // aqua
8
+ "#85C1E9", // light blue
9
+ "#48C9B0", // turquoise
10
+ "#52BE80", // emerald
11
+ "#F8C471", // sandy yellow
12
+ ];
13
+ export const CCOLORS_SUNSET_PALETTE = [
14
+ "#FF6B6B", // coral red
15
+ "#FF8E53", // coral orange
16
+ "#FF6B9D", // pink
17
+ "#FFD93D", // golden yellow
18
+ "#6BCF7F", // mint green
19
+ "#4ECDC4", // teal
20
+ "#45B7D1", // sky blue
21
+ "#96CEB4", // sage green
22
+ "#FFEAA7", // cream
23
+ "#DDA0DD", // plum
24
+ ];
25
+ export const CCOLORS_DARK_PALETTE = [
26
+ "#2C3E50", // dark blue-gray
27
+ "#34495E", // dark gray
28
+ "#E74C3C", // red
29
+ "#E67E22", // orange
30
+ "#F39C12", // yellow
31
+ "#27AE60", // green
32
+ "#16A085", // teal
33
+ "#3498DB", // blue
34
+ "#9B59B6", // purple
35
+ "#95A5A6", // light gray
36
+ ];
37
+ export const CCOLORS_CYBERPUNK_PALETTE = [
38
+ "#0F3460", // dark blue
39
+ "#533483", // dark purple
40
+ "#E94560", // neon pink
41
+ "#0F4C75", // steel blue
42
+ "#3282B8", // blue
43
+ "#BBE1FA", // light blue
44
+ "#FF6B6B", // coral
45
+ "#4ECDC4", // turquoise
46
+ "#45B7D1", // sky blue
47
+ "#96CEB4", // mint
48
+ ];
49
+ export const CCOLORS_MONOCHROME_PALETTE = [
50
+ "#000000", // black
51
+ "#333333", // dark gray
52
+ "#666666", // gray
53
+ "#999999", // light gray
54
+ "#CCCCCC", // lighter gray
55
+ "#FFFFFF", // white
56
+ ];
57
+ export const CWATERMELON_PALETTE = [
58
+ "#007A3D", // green
59
+ "#FFFFFF", // white
60
+ "#FF0000", // red
61
+ ];
62
+ export const COLORS_PALETTES = [
63
+ CCOLORS_OCEAN_PALETTE,
64
+ CCOLORS_SUNSET_PALETTE,
65
+ CCOLORS_DARK_PALETTE,
66
+ CCOLORS_CYBERPUNK_PALETTE,
67
+ CCOLORS_MONOCHROME_PALETTE,
68
+ CWATERMELON_PALETTE,
69
+ ];
70
+ //# sourceMappingURL=CColors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CColors.js","sourceRoot":"","sources":["../../src/constants/CColors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,eAAe;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,eAAe;IAC1B,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,gBAAgB;IAC3B,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,OAAO;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,aAAa;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,cAAc;IACzB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,OAAO;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACtC,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,eAAe;IAC1B,SAAS,EAAE,QAAQ;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,MAAM;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,qBAAqB;IACrB,sBAAsB;IACtB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;IAC1B,mBAAmB;CACtB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ArcShape } from "../classes/ArcShape.js";
2
+ import { SquareShape } from "../classes/SquareShape.js";
3
+ export declare const SHAPES_TYPES: {
4
+ readonly arc: typeof ArcShape;
5
+ readonly square: typeof SquareShape;
6
+ };
7
+ //# sourceMappingURL=CShapes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CShapes.d.ts","sourceRoot":"","sources":["../../src/constants/CShapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,eAAO,MAAM,YAAY;;;CAGf,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ArcShape } from "../classes/ArcShape.js";
2
+ import { SquareShape } from "../classes/SquareShape.js";
3
+ export const SHAPES_TYPES = {
4
+ arc: ArcShape,
5
+ square: SquareShape,
6
+ };
7
+ //# sourceMappingURL=CShapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CShapes.js","sourceRoot":"","sources":["../../src/constants/CShapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,WAAW;CACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./CColors.js";
2
+ export * from "./CShapes.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./CColors.js";
2
+ export * from "./CShapes.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./classes/index.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./classes/index.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { BaseShape } from "../classes/BaseShape.js";
2
+ export type TPosition = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export type TGridCell = BaseShape | "locked" | null;
7
+ export type TGrid = TGridCell[][];
8
+ export type TGridConfig = {
9
+ nbrColumns: number;
10
+ nbrRows: number;
11
+ cellSize: number;
12
+ gridMargin: number;
13
+ offsetX: number;
14
+ offsetY: number;
15
+ width: number;
16
+ height: number;
17
+ lineWidth: number;
18
+ debug: boolean;
19
+ context: CanvasRenderingContext2D;
20
+ colors: string[];
21
+ };
22
+ export type TShapeConfig = {
23
+ color: string;
24
+ radiusPercent?: number;
25
+ clockwise?: boolean;
26
+ rotationAmount?: number;
27
+ };
28
+ //# sourceMappingURL=TGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TGrid.d.ts","sourceRoot":"","sources":["../../src/types/TGrid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,MAAM,SAAS,GAAG;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG,SAAS,EAAE,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,wBAAwB,CAAC;IAClC,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TGrid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TGrid.js","sourceRoot":"","sources":["../../src/types/TGrid.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export type TEngineOptions = {
2
+ canvas: HTMLCanvasElement;
3
+ nbrColumns: number;
4
+ nbrRows: number;
5
+ cellSize: number;
6
+ gridMargin: number;
7
+ lineWidth: number;
8
+ };
9
+ //# sourceMappingURL=TKinogrida.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TKinogrida.d.ts","sourceRoot":"","sources":["../../src/types/TKinogrida.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IACzB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TKinogrida.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TKinogrida.js","sourceRoot":"","sources":["../../src/types/TKinogrida.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./TGrid.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./TGrid.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const getRandomColorPalette: () => string[];
2
+ export declare const hexToRGBA: (hex: string, alpha: number) => string;
3
+ //# sourceMappingURL=UColors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UColors.d.ts","sourceRoot":"","sources":["../../src/utils/UColors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,QAAO,MAAM,EAG9C,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,MAKtD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { COLORS_PALETTES } from "../constants/CColors.js";
2
+ export const getRandomColorPalette = () => {
3
+ const randomIndex = Math.floor(Math.random() * COLORS_PALETTES.length);
4
+ return COLORS_PALETTES[randomIndex];
5
+ };
6
+ export const hexToRGBA = (hex, alpha) => {
7
+ const r = parseInt(hex.slice(1, 3), 16);
8
+ const g = parseInt(hex.slice(3, 5), 16);
9
+ const b = parseInt(hex.slice(5, 7), 16);
10
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
11
+ };
12
+ //# sourceMappingURL=UColors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UColors.js","sourceRoot":"","sources":["../../src/utils/UColors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAa,EAAE;IAChD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACvE,OAAO,eAAe,CAAC,WAAW,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,KAAa,EAAU,EAAE;IAC5D,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxC,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC;AAC9C,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const random: (min: number, max: number) => number;
2
+ export declare const randomInt: (min: number, max: number) => number;
3
+ export declare const clamp: (value: number, min: number, max: number) => number;
4
+ export declare const clampAngle: (angle: number) => number;
5
+ //# sourceMappingURL=UMath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UMath.d.ts","sourceRoot":"","sources":["../../src/utils/UMath.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MAEpD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MAE/D,CAAC;AAGF,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAG1C,CAAC"}
@@ -0,0 +1,15 @@
1
+ export const random = (min, max) => {
2
+ return Math.random() * (max - min) + min;
3
+ };
4
+ export const randomInt = (min, max) => {
5
+ return Math.floor(Math.random() * (max - min + 1)) + min;
6
+ };
7
+ export const clamp = (value, min, max) => {
8
+ return Math.max(min, Math.min(max, value));
9
+ };
10
+ // clamp angle between 0 and 2 * PI, if angle is negative, subtract it from 2 * PI
11
+ export const clampAngle = (angle) => {
12
+ const twoPi = Math.PI * 2;
13
+ return ((angle % twoPi) + twoPi) % twoPi;
14
+ };
15
+ //# sourceMappingURL=UMath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UMath.js","sourceRoot":"","sources":["../../src/utils/UMath.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,GAAW,EAAU,EAAE;IACvD,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,GAAW,EAAU,EAAE;IAC1D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1B,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAC7C,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const getRandomShapeType: () => typeof import("../classes/ArcShape.js").ArcShape | typeof import("../classes/SquareShape.js").SquareShape;
2
+ //# sourceMappingURL=UShapes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UShapes.d.ts","sourceRoot":"","sources":["../../src/utils/UShapes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,iHAM9B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { SHAPES_TYPES } from "../constants/index.js";
2
+ export const getRandomShapeType = () => {
3
+ const shapeTypes = Object.keys(SHAPES_TYPES);
4
+ const randomIndex = Math.floor(Math.random() * shapeTypes.length);
5
+ return SHAPES_TYPES[shapeTypes[randomIndex]];
6
+ };
7
+ //# sourceMappingURL=UShapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UShapes.js","sourceRoot":"","sources":["../../src/utils/UShapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAC1B,YAAY,CACkB,CAAC;IACnC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAClE,OAAO,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./UMath.js";
2
+ export * from "./UColors.js";
3
+ export * from "./UShapes.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./UMath.js";
2
+ export * from "./UColors.js";
3
+ export * from "./UShapes.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@amphore-dev/kinogrida",
3
+ "version": "0.3.0",
4
+ "description": "Library for creating animated shape visualizations on canvas.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "keywords": [
20
+ "canvas",
21
+ "animation",
22
+ "visualization",
23
+ "shapes",
24
+ "graphics",
25
+ "javascript",
26
+ "web",
27
+ "art",
28
+ "typescript",
29
+ "library"
30
+ ],
31
+ "bugs": {
32
+ "url": "https://github.com/Amphore-Dev/kinogrida/issues"
33
+ },
34
+ "homepage": "https://amphore-dev.github.io/kinogrida/",
35
+ "author": "Amphore Development Team",
36
+ "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/Amphore-Dev/kinogrida.git"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc && tsc-alias",
43
+ "build:watch": "concurrently \"tsc --watch\" \"tsc-alias --watch\"",
44
+ "dev": "concurrently --names \"Build,Example\" --colors \"blue,green\" \"npm run build:watch\" \"npm run example\"",
45
+ "test": "jest",
46
+ "test:watch": "jest --watch",
47
+ "test:coverage": "jest --coverage",
48
+ "lint": "eslint src",
49
+ "lint:fix": "eslint src --fix",
50
+ "format": "prettier --write .",
51
+ "format:check": "prettier --check .",
52
+ "clean": "rm -rf dist",
53
+ "prepublishOnly": "npm run clean && npm run build",
54
+ "example": "cd example && npm run dev"
55
+ },
56
+ "devDependencies": {
57
+ "@eslint/js": "^10.0.1",
58
+ "@types/jest": "^29.5.5",
59
+ "@types/node": "^25.5.0",
60
+ "@typescript-eslint/eslint-plugin": "^8.58.0",
61
+ "@typescript-eslint/parser": "^8.58.0",
62
+ "concurrently": "^9.2.1",
63
+ "eslint": "^10.1.0",
64
+ "eslint-config-prettier": "^10.1.8",
65
+ "jest": "^29.7.0",
66
+ "jest-environment-jsdom": "^29.7.0",
67
+ "prettier": "^3.8.1",
68
+ "ts-jest": "^29.1.1",
69
+ "ts-node": "^10.9.1",
70
+ "tsc-alias": "^1.8.16",
71
+ "typescript": "^6.0.2",
72
+ "typescript-eslint": "^8.58.0"
73
+ },
74
+ "engines": {
75
+ "node": ">=16.0.0"
76
+ }
77
+ }