@jjlmoya/utils-games-development 1.66.0 → 1.67.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 (71) hide show
  1. package/package.json +67 -67
  2. package/scripts/postinstall.mjs +27 -27
  3. package/src/category/GamesCategorySEO.astro +19 -19
  4. package/src/category/i18n/de.ts +15 -15
  5. package/src/category/i18n/en.ts +15 -15
  6. package/src/category/i18n/es.ts +15 -15
  7. package/src/category/i18n/fr.ts +15 -15
  8. package/src/category/i18n/id.ts +10 -10
  9. package/src/category/i18n/it.ts +10 -10
  10. package/src/category/i18n/ja.ts +10 -10
  11. package/src/category/i18n/ko.ts +10 -10
  12. package/src/category/i18n/nl.ts +10 -10
  13. package/src/category/i18n/pl.ts +10 -10
  14. package/src/category/i18n/pt.ts +10 -10
  15. package/src/category/i18n/ru.ts +10 -10
  16. package/src/category/i18n/sv.ts +10 -10
  17. package/src/category/i18n/tr.ts +10 -10
  18. package/src/category/i18n/zh.ts +10 -10
  19. package/src/category/seo.astro +15 -15
  20. package/src/components/PreviewNavSidebar.astro +116 -116
  21. package/src/components/PreviewToolbar.astro +143 -143
  22. package/src/data.ts +11 -11
  23. package/src/env.d.ts +5 -5
  24. package/src/index.ts +20 -20
  25. package/src/layouts/PreviewLayout.astro +122 -122
  26. package/src/pages/[locale]/[slug].astro +165 -165
  27. package/src/pages/[locale].astro +250 -250
  28. package/src/pages/index.astro +4 -4
  29. package/src/tests/category_seo_quality.test.ts +74 -0
  30. package/src/tests/diacritics_density.test.ts +118 -118
  31. package/src/tests/faq_count.test.ts +19 -19
  32. package/src/tests/i18n_coverage.test.ts +36 -36
  33. package/src/tests/inverted_punctuation.test.ts +84 -84
  34. package/src/tests/mocks/astro_mock.js +2 -2
  35. package/src/tests/no_en_dash.test.ts +70 -70
  36. package/src/tests/no_h1_in_components.test.ts +48 -48
  37. package/src/tests/pagespeed_best_practices.test.ts +198 -198
  38. package/src/tests/qa-test-helpers.ts +32 -32
  39. package/src/tests/qa_bibliography_links.test.ts +41 -41
  40. package/src/tests/qa_claim_evidence.test.ts +69 -69
  41. package/src/tests/qa_logic_reference_coverage.test.ts +46 -46
  42. package/src/tests/qa_runtime_i18n.test.ts +100 -100
  43. package/src/tests/schemas_fulfillment.test.ts +23 -23
  44. package/src/tests/script_density.test.ts +94 -94
  45. package/src/tests/seo_length.test.ts +23 -23
  46. package/src/tests/slug_language_code_format.test.ts +23 -23
  47. package/src/tests/slug_uniqueness.test.ts +80 -80
  48. package/src/tests/title_quality.test.ts +56 -56
  49. package/src/tool/audioLoopPointFinder/audio-loop-point-finder.css +322 -322
  50. package/src/tool/audioLoopPointFinder/client.ts +262 -262
  51. package/src/tool/hitboxHurtboxAnimator/hitbox-hurtbox-animator.css +614 -614
  52. package/src/tool/saveFileEditor/component.astro +351 -351
  53. package/src/tool/saveFileEditor/game-save-file-editor.css +250 -250
  54. package/src/tool/spriteSheetPacker/app-client.ts +248 -248
  55. package/src/tool/spriteSheetPacker/bibliography.ts +12 -12
  56. package/src/tool/spriteSheetPacker/component.astro +229 -229
  57. package/src/tool/spriteSheetPacker/dropzone-client.ts +55 -55
  58. package/src/tool/spriteSheetPacker/entry.ts +28 -28
  59. package/src/tool/spriteSheetPacker/exporter.ts +116 -116
  60. package/src/tool/spriteSheetPacker/extractor-client.ts +127 -127
  61. package/src/tool/spriteSheetPacker/flipbook-client.ts +60 -60
  62. package/src/tool/spriteSheetPacker/logic.test.ts +155 -155
  63. package/src/tool/spriteSheetPacker/logic.ts +32 -32
  64. package/src/tool/spriteSheetPacker/packer-core.ts +121 -121
  65. package/src/tool/spriteSheetPacker/packer-ui.ts +86 -86
  66. package/src/tool/spriteSheetPacker/sprite-sheet-packer.css +578 -578
  67. package/src/tool/spriteSheetPacker/types.ts +89 -89
  68. package/src/tool/spriteSheetPacker/ui.ts +42 -42
  69. package/src/tool/steamCapsuleGenerator/index.ts +9 -9
  70. package/src/tool/steamCapsuleGenerator/validation.ts +14 -14
  71. package/src/types.ts +72 -72
@@ -1,86 +1,86 @@
1
- import JSZip from 'jszip';
2
-
3
- export interface LoadedImageItem {
4
- file: File;
5
- img: HTMLImageElement;
6
- id: string;
7
- name: string;
8
- }
9
-
10
- export function spawnParticle(x: number, y: number, text: string): void {
11
- const container = document.getElementById('ssp-particle-container');
12
- if (!container) return;
13
-
14
- const el = document.createElement('div');
15
- el.className = 'ssp-particle';
16
- el.textContent = text;
17
- el.style.left = `${x}px`;
18
- el.style.top = `${y}px`;
19
- container.appendChild(el);
20
-
21
- setTimeout(() => el.remove(), 1000);
22
- }
23
-
24
- export function triggerButtonFeedback(btn: HTMLElement | null, text: string, event?: MouseEvent): void {
25
- if (!btn) return;
26
- btn.classList.add('ssp-btn-success');
27
- const originalText = btn.textContent;
28
- btn.textContent = text;
29
-
30
- if (event) {
31
- spawnParticle(event.clientX, event.clientY, text);
32
- }
33
-
34
- setTimeout(() => {
35
- btn.classList.remove('ssp-btn-success');
36
- if (originalText) btn.textContent = originalText;
37
- }, 1800);
38
- }
39
-
40
- export function setupStepper(decId: string, incId: string, inputId: string, callback: () => void): void {
41
- const input = document.getElementById(inputId) as HTMLInputElement | null;
42
- document.getElementById(decId)?.addEventListener('click', () => {
43
- if (!input) return;
44
- const current = parseInt(input.value || '0', 10);
45
- const min = parseInt(input.min || '0', 10);
46
- input.value = Math.max(min, current - 1).toString();
47
- input.dispatchEvent(new Event('input'));
48
- callback();
49
- });
50
- document.getElementById(incId)?.addEventListener('click', () => {
51
- if (!input) return;
52
- const current = parseInt(input.value || '0', 10);
53
- const max = parseInt(input.max || '9999', 10);
54
- input.value = Math.min(max, current + 1).toString();
55
- input.dispatchEvent(new Event('input'));
56
- callback();
57
- });
58
- }
59
-
60
- export function drawEmptyCanvasMessage(canvas: HTMLCanvasElement, text: string): void {
61
- canvas.width = 512;
62
- canvas.height = 512;
63
- const ctx = canvas.getContext('2d');
64
- if (!ctx) return;
65
- ctx.clearRect(0, 0, canvas.width, canvas.height);
66
- ctx.fillStyle = 'rgba(148, 163, 184, 0.4)';
67
- ctx.font = '600 15px sans-serif';
68
- ctx.textAlign = 'center';
69
- ctx.textBaseline = 'middle';
70
- ctx.fillText(text, canvas.width / 2, canvas.height / 2);
71
- }
72
-
73
- export function downloadZipFromCanvas(canvas: HTMLCanvasElement, jsonContent: string): void {
74
- const zip = new JSZip();
75
- canvas.toBlob((blob) => {
76
- if (!blob) return;
77
- zip.file('spritesheet.png', blob);
78
- zip.file('spritesheet.json', jsonContent);
79
- zip.generateAsync({ type: 'blob' }).then((content) => {
80
- const link = document.createElement('a');
81
- link.href = URL.createObjectURL(content);
82
- link.download = 'sprite-sheet-package.zip';
83
- link.click();
84
- });
85
- });
86
- }
1
+ import JSZip from 'jszip';
2
+
3
+ export interface LoadedImageItem {
4
+ file: File;
5
+ img: HTMLImageElement;
6
+ id: string;
7
+ name: string;
8
+ }
9
+
10
+ export function spawnParticle(x: number, y: number, text: string): void {
11
+ const container = document.getElementById('ssp-particle-container');
12
+ if (!container) return;
13
+
14
+ const el = document.createElement('div');
15
+ el.className = 'ssp-particle';
16
+ el.textContent = text;
17
+ el.style.left = `${x}px`;
18
+ el.style.top = `${y}px`;
19
+ container.appendChild(el);
20
+
21
+ setTimeout(() => el.remove(), 1000);
22
+ }
23
+
24
+ export function triggerButtonFeedback(btn: HTMLElement | null, text: string, event?: MouseEvent): void {
25
+ if (!btn) return;
26
+ btn.classList.add('ssp-btn-success');
27
+ const originalText = btn.textContent;
28
+ btn.textContent = text;
29
+
30
+ if (event) {
31
+ spawnParticle(event.clientX, event.clientY, text);
32
+ }
33
+
34
+ setTimeout(() => {
35
+ btn.classList.remove('ssp-btn-success');
36
+ if (originalText) btn.textContent = originalText;
37
+ }, 1800);
38
+ }
39
+
40
+ export function setupStepper(decId: string, incId: string, inputId: string, callback: () => void): void {
41
+ const input = document.getElementById(inputId) as HTMLInputElement | null;
42
+ document.getElementById(decId)?.addEventListener('click', () => {
43
+ if (!input) return;
44
+ const current = parseInt(input.value || '0', 10);
45
+ const min = parseInt(input.min || '0', 10);
46
+ input.value = Math.max(min, current - 1).toString();
47
+ input.dispatchEvent(new Event('input'));
48
+ callback();
49
+ });
50
+ document.getElementById(incId)?.addEventListener('click', () => {
51
+ if (!input) return;
52
+ const current = parseInt(input.value || '0', 10);
53
+ const max = parseInt(input.max || '9999', 10);
54
+ input.value = Math.min(max, current + 1).toString();
55
+ input.dispatchEvent(new Event('input'));
56
+ callback();
57
+ });
58
+ }
59
+
60
+ export function drawEmptyCanvasMessage(canvas: HTMLCanvasElement, text: string): void {
61
+ canvas.width = 512;
62
+ canvas.height = 512;
63
+ const ctx = canvas.getContext('2d');
64
+ if (!ctx) return;
65
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
66
+ ctx.fillStyle = 'rgba(148, 163, 184, 0.4)';
67
+ ctx.font = '600 15px sans-serif';
68
+ ctx.textAlign = 'center';
69
+ ctx.textBaseline = 'middle';
70
+ ctx.fillText(text, canvas.width / 2, canvas.height / 2);
71
+ }
72
+
73
+ export function downloadZipFromCanvas(canvas: HTMLCanvasElement, jsonContent: string): void {
74
+ const zip = new JSZip();
75
+ canvas.toBlob((blob) => {
76
+ if (!blob) return;
77
+ zip.file('spritesheet.png', blob);
78
+ zip.file('spritesheet.json', jsonContent);
79
+ zip.generateAsync({ type: 'blob' }).then((content) => {
80
+ const link = document.createElement('a');
81
+ link.href = URL.createObjectURL(content);
82
+ link.download = 'sprite-sheet-package.zip';
83
+ link.click();
84
+ });
85
+ });
86
+ }