@jjlmoya/utils-diy 1.1.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 (135) hide show
  1. package/package.json +60 -0
  2. package/src/category/i18n/en.ts +110 -0
  3. package/src/category/i18n/es.ts +110 -0
  4. package/src/category/i18n/fr.ts +101 -0
  5. package/src/category/index.ts +25 -0
  6. package/src/category/seo.astro +15 -0
  7. package/src/components/PreviewNavSidebar.astro +116 -0
  8. package/src/components/PreviewToolbar.astro +143 -0
  9. package/src/data.ts +11 -0
  10. package/src/env.d.ts +5 -0
  11. package/src/index.ts +57 -0
  12. package/src/layouts/PreviewLayout.astro +117 -0
  13. package/src/pages/[locale]/[slug].astro +146 -0
  14. package/src/pages/[locale].astro +251 -0
  15. package/src/pages/index.astro +4 -0
  16. package/src/tests/faq_count.test.ts +19 -0
  17. package/src/tests/locale_completeness.test.ts +42 -0
  18. package/src/tests/mocks/astro_mock.js +2 -0
  19. package/src/tests/no_h1_in_components.test.ts +48 -0
  20. package/src/tests/schemas_fulfillment.test.ts +23 -0
  21. package/src/tests/seo_length.test.ts +22 -0
  22. package/src/tests/title_quality.test.ts +55 -0
  23. package/src/tests/tool_validation.test.ts +17 -0
  24. package/src/tool/balusterCalculator/bibliography.astro +14 -0
  25. package/src/tool/balusterCalculator/component.astro +605 -0
  26. package/src/tool/balusterCalculator/i18n/en.ts +264 -0
  27. package/src/tool/balusterCalculator/i18n/es.ts +264 -0
  28. package/src/tool/balusterCalculator/i18n/fr.ts +264 -0
  29. package/src/tool/balusterCalculator/index.ts +33 -0
  30. package/src/tool/balusterCalculator/seo.astro +15 -0
  31. package/src/tool/balusterCalculator/ui.ts +15 -0
  32. package/src/tool/clayCalculator/bibliography.astro +14 -0
  33. package/src/tool/clayCalculator/component.astro +731 -0
  34. package/src/tool/clayCalculator/i18n/en.ts +183 -0
  35. package/src/tool/clayCalculator/i18n/es.ts +183 -0
  36. package/src/tool/clayCalculator/i18n/fr.ts +183 -0
  37. package/src/tool/clayCalculator/index.ts +33 -0
  38. package/src/tool/clayCalculator/seo.astro +15 -0
  39. package/src/tool/clayCalculator/ui.ts +19 -0
  40. package/src/tool/concreteCalculator/bibliography.astro +13 -0
  41. package/src/tool/concreteCalculator/component.astro +1089 -0
  42. package/src/tool/concreteCalculator/i18n/en.ts +201 -0
  43. package/src/tool/concreteCalculator/i18n/es.ts +201 -0
  44. package/src/tool/concreteCalculator/i18n/fr.ts +201 -0
  45. package/src/tool/concreteCalculator/index.ts +28 -0
  46. package/src/tool/concreteCalculator/seo.astro +14 -0
  47. package/src/tool/concreteCalculator/ui.ts +35 -0
  48. package/src/tool/cutOptimizer/bibliography.astro +13 -0
  49. package/src/tool/cutOptimizer/component.astro +825 -0
  50. package/src/tool/cutOptimizer/i18n/en.ts +178 -0
  51. package/src/tool/cutOptimizer/i18n/es.ts +178 -0
  52. package/src/tool/cutOptimizer/i18n/fr.ts +178 -0
  53. package/src/tool/cutOptimizer/index.ts +28 -0
  54. package/src/tool/cutOptimizer/optimizer.ts +199 -0
  55. package/src/tool/cutOptimizer/seo.astro +14 -0
  56. package/src/tool/cutOptimizer/ui.ts +25 -0
  57. package/src/tool/drillCalculator/bibliography.astro +13 -0
  58. package/src/tool/drillCalculator/component.astro +1210 -0
  59. package/src/tool/drillCalculator/engine.ts +63 -0
  60. package/src/tool/drillCalculator/i18n/en.ts +137 -0
  61. package/src/tool/drillCalculator/i18n/es.ts +137 -0
  62. package/src/tool/drillCalculator/i18n/fr.ts +137 -0
  63. package/src/tool/drillCalculator/index.ts +28 -0
  64. package/src/tool/drillCalculator/seo.astro +14 -0
  65. package/src/tool/drillCalculator/ui.ts +41 -0
  66. package/src/tool/drillSharpener/bibliography.astro +13 -0
  67. package/src/tool/drillSharpener/component.astro +712 -0
  68. package/src/tool/drillSharpener/engine.ts +42 -0
  69. package/src/tool/drillSharpener/i18n/en.ts +121 -0
  70. package/src/tool/drillSharpener/i18n/es.ts +121 -0
  71. package/src/tool/drillSharpener/i18n/fr.ts +121 -0
  72. package/src/tool/drillSharpener/index.ts +31 -0
  73. package/src/tool/drillSharpener/seo.astro +14 -0
  74. package/src/tool/drillSharpener/ui.ts +53 -0
  75. package/src/tool/epoxyCalculator/bibliography.astro +14 -0
  76. package/src/tool/epoxyCalculator/component.astro +888 -0
  77. package/src/tool/epoxyCalculator/i18n/en.ts +195 -0
  78. package/src/tool/epoxyCalculator/i18n/es.ts +195 -0
  79. package/src/tool/epoxyCalculator/i18n/fr.ts +195 -0
  80. package/src/tool/epoxyCalculator/index.ts +33 -0
  81. package/src/tool/epoxyCalculator/seo.astro +15 -0
  82. package/src/tool/epoxyCalculator/ui.ts +22 -0
  83. package/src/tool/furnitureFit/bibliography.astro +13 -0
  84. package/src/tool/furnitureFit/component.astro +552 -0
  85. package/src/tool/furnitureFit/engine.ts +51 -0
  86. package/src/tool/furnitureFit/i18n/en.ts +152 -0
  87. package/src/tool/furnitureFit/i18n/es.ts +152 -0
  88. package/src/tool/furnitureFit/i18n/fr.ts +152 -0
  89. package/src/tool/furnitureFit/index.ts +28 -0
  90. package/src/tool/furnitureFit/seo.astro +14 -0
  91. package/src/tool/furnitureFit/ui.ts +21 -0
  92. package/src/tool/mortarCalculator/bibliography.astro +13 -0
  93. package/src/tool/mortarCalculator/component.astro +1139 -0
  94. package/src/tool/mortarCalculator/i18n/en.ts +219 -0
  95. package/src/tool/mortarCalculator/i18n/es.ts +205 -0
  96. package/src/tool/mortarCalculator/i18n/fr.ts +220 -0
  97. package/src/tool/mortarCalculator/index.ts +24 -0
  98. package/src/tool/mortarCalculator/seo.astro +14 -0
  99. package/src/tool/mortarCalculator/ui.ts +37 -0
  100. package/src/tool/passepartoutCalculator/bibliography.astro +13 -0
  101. package/src/tool/passepartoutCalculator/component.astro +741 -0
  102. package/src/tool/passepartoutCalculator/i18n/en.ts +178 -0
  103. package/src/tool/passepartoutCalculator/i18n/es.ts +178 -0
  104. package/src/tool/passepartoutCalculator/i18n/fr.ts +178 -0
  105. package/src/tool/passepartoutCalculator/index.ts +28 -0
  106. package/src/tool/passepartoutCalculator/seo.astro +14 -0
  107. package/src/tool/passepartoutCalculator/ui.ts +17 -0
  108. package/src/tool/stairCalculator/bibliography.astro +52 -0
  109. package/src/tool/stairCalculator/component.astro +766 -0
  110. package/src/tool/stairCalculator/engine.ts +128 -0
  111. package/src/tool/stairCalculator/i18n/en.ts +149 -0
  112. package/src/tool/stairCalculator/i18n/es.ts +149 -0
  113. package/src/tool/stairCalculator/i18n/fr.ts +149 -0
  114. package/src/tool/stairCalculator/index.ts +31 -0
  115. package/src/tool/stairCalculator/seo.astro +211 -0
  116. package/src/tool/stairCalculator/ui.ts +109 -0
  117. package/src/tool/thermalExpansionCalculator/bibliography.astro +13 -0
  118. package/src/tool/thermalExpansionCalculator/component.astro +771 -0
  119. package/src/tool/thermalExpansionCalculator/engine.ts +23 -0
  120. package/src/tool/thermalExpansionCalculator/i18n/en.ts +174 -0
  121. package/src/tool/thermalExpansionCalculator/i18n/es.ts +174 -0
  122. package/src/tool/thermalExpansionCalculator/i18n/fr.ts +174 -0
  123. package/src/tool/thermalExpansionCalculator/index.ts +28 -0
  124. package/src/tool/thermalExpansionCalculator/seo.astro +14 -0
  125. package/src/tool/thermalExpansionCalculator/ui.ts +41 -0
  126. package/src/tool/voltageDropCalculator/bibliography.astro +13 -0
  127. package/src/tool/voltageDropCalculator/component.astro +1022 -0
  128. package/src/tool/voltageDropCalculator/i18n/en.ts +155 -0
  129. package/src/tool/voltageDropCalculator/i18n/es.ts +155 -0
  130. package/src/tool/voltageDropCalculator/i18n/fr.ts +148 -0
  131. package/src/tool/voltageDropCalculator/index.ts +28 -0
  132. package/src/tool/voltageDropCalculator/seo.astro +14 -0
  133. package/src/tool/voltageDropCalculator/ui.ts +22 -0
  134. package/src/tools.ts +16 -0
  135. package/src/types.ts +72 -0
@@ -0,0 +1,264 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { BalusterCalculatorUI } from '../ui';
4
+
5
+ const slug = 'baluster-calculator';
6
+ const title = 'Baluster Calculator: Exact Railing Spacing';
7
+ const description =
8
+ 'Calculate the exact spacing between balusters or pickets for railings, complying with the 4-inch (10 cm) safety rule. Automatic layout plans.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: 'What is the maximum legal distance between balusters?',
13
+ answer:
14
+ 'In most international building codes (IRC in the US, CTE in Spain), the clear space between railing elements must not allow the passage of a 4-inch (10 cm) sphere to prevent childhood accidents.',
15
+ },
16
+ {
17
+ question: 'How is spacing measured: on center or clear span?',
18
+ answer:
19
+ "Our calculator provides both. 'Clear span' is the actual gap between balusters (critical for safety), while 'on-center' distance is used to mark where to drill or fasten each baluster.",
20
+ },
21
+ {
22
+ question: 'What if the spacing does not come out even?',
23
+ answer:
24
+ 'The calculator automatically adjusts the number of balusters so the first and last gap are identical, ensuring visual symmetry and strict compliance with the maximum allowed gap.',
25
+ },
26
+ {
27
+ question: 'Is welding or screwing better for balusters?',
28
+ answer:
29
+ 'It depends on the material. For steel, welding offers maximum structural rigidity. For wood or aluminum, mechanical anchors or through-bolts are used. The railing must withstand a horizontal load of at least 0.8 kN/m.',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Measure the total length',
36
+ text: 'Measure the exact distance between the first and last post where the railing will be installed.',
37
+ },
38
+ {
39
+ name: 'Define the baluster thickness',
40
+ text: 'Measure the width of a single baluster (e.g. 2x2 cm for square tube, or diameter if round).',
41
+ },
42
+ {
43
+ name: 'Set the maximum gap',
44
+ text: 'Enter the desired maximum spacing (10 cm recommended to comply with safety codes).',
45
+ },
46
+ {
47
+ name: 'Get installation marks',
48
+ text: 'Review the list of exact positions for drilling to ensure a symmetric and safe layout.',
49
+ },
50
+ ];
51
+
52
+ const faqSchema: WithContext<FAQPage> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'FAQPage',
55
+ mainEntity: faqData.map((item) => ({
56
+ '@type': 'Question',
57
+ name: item.question,
58
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
59
+ })),
60
+ };
61
+
62
+ const howToSchema: WithContext<HowToThing> = {
63
+ '@context': 'https://schema.org',
64
+ '@type': 'HowTo',
65
+ name: title,
66
+ description,
67
+ step: howToData.map((step, i) => ({
68
+ '@type': 'HowToStep',
69
+ position: i + 1,
70
+ name: step.name,
71
+ text: step.text,
72
+ })),
73
+ };
74
+
75
+ const appSchema: WithContext<SoftwareApplication> = {
76
+ '@context': 'https://schema.org',
77
+ '@type': 'SoftwareApplication',
78
+ name: title,
79
+ description,
80
+ applicationCategory: 'UtilityApplication',
81
+ operatingSystem: 'All',
82
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' },
83
+ inLanguage: 'en',
84
+ };
85
+
86
+ export const content: ToolLocaleContent<BalusterCalculatorUI> = {
87
+ slug,
88
+ title,
89
+ description,
90
+ faqTitle: 'Frequently Asked Questions',
91
+ faq: faqData,
92
+ bibliographyTitle: 'Technical References',
93
+ bibliography: [
94
+ {
95
+ name: 'IRC - International Residential Code (USA)',
96
+ url: 'https://codes.iccsafe.org/content/IRC2021',
97
+ },
98
+ {
99
+ name: 'IBC - International Building Code',
100
+ url: 'https://codes.iccsafe.org/content/IBC2021',
101
+ },
102
+ {
103
+ name: 'CTE - Código Técnico de la Edificación (Spain)',
104
+ url: 'https://www.codigotecnico.org/',
105
+ },
106
+ ],
107
+ howTo: howToData,
108
+ schemas: [faqSchema, howToSchema, appSchema],
109
+ seo: [
110
+ {
111
+ type: 'title',
112
+ text: 'Definitive Guide: How to Calculate Baluster Spacing for Railings',
113
+ level: 2,
114
+ },
115
+ {
116
+ type: 'paragraph',
117
+ html: 'Designing a safe and aesthetically perfect railing is an art that combines mathematical precision with building code compliance. Whether for a terrace, balcony, or interior staircase, correctly calculating balusters (or pickets) is the most critical step of the project. A calculation error not only ruins the visual symmetry but can make your structure illegal and unsafe.',
118
+ },
119
+ {
120
+ type: 'card',
121
+ icon: 'mdi:alert-circle-outline',
122
+ title: 'Why is this calculation so important?',
123
+ html: '<p>It\'s not just about "filling the gap." It\'s about complying with the <strong>4-Inch Sphere Rule (10 cm)</strong>, an international safety standard designed to prevent childhood accidents.</p>',
124
+ },
125
+ {
126
+ type: 'title',
127
+ text: '1. Safety Code: The 10 cm Sphere Rule',
128
+ level: 3,
129
+ },
130
+ {
131
+ type: 'paragraph',
132
+ html: 'Before cutting the first piece of wood or metal, you must understand the "why" behind the math. The International Residential Code (IRC) in the United States, as well as the CTE (Código Técnico de la Edificación) in Spain, establishes a clear rule: <em>"The clear space between vertical elements must not allow passage of a sphere 4 inches (10 cm) in diameter."</em>',
133
+ },
134
+ {
135
+ type: 'paragraph',
136
+ html: "This measurement is not arbitrary. It is the average diameter of a young child's head (generally under 1 year old). If a child can fit their body through but their head gets stuck, the risk of suffocation is extremely high. If they can fit their head through, they can fall into the void. Therefore, the goal of our <strong>Baluster Calculator</strong> is not just aesthetic — it saves lives.",
137
+ },
138
+ {
139
+ type: 'title',
140
+ text: '2. The Math Problem: The Fencepost Error',
141
+ level: 3,
142
+ },
143
+ {
144
+ type: 'paragraph',
145
+ html: 'In programming and construction, there is a classic problem called the <em>"Fencepost Error"</em>. If you want to build a 10-meter fence with posts every meter, how many posts do you need? The intuitive answer is 10, but the correct answer is 11.',
146
+ },
147
+ {
148
+ type: 'paragraph',
149
+ html: 'With balusters something similar occurs, but more complex, because the width of the baluster itself occupies space. The formula used by our tool solves this system of equations for you:',
150
+ },
151
+ {
152
+ type: 'grid',
153
+ columns: [
154
+ {
155
+ type: 'card',
156
+ icon: 'mdi:calculator',
157
+ title: 'Step A: Count Gaps',
158
+ html: '<p class="bc-formula">n = (L - g_max) / (w + g_max)</p><p>First we determine how many balusters theoretically fit using the maximum allowed space. We round this number up to ensure the resulting gaps are <em>smaller</em> than the maximum.</p>',
159
+ },
160
+ {
161
+ type: 'card',
162
+ icon: 'mdi:function-variant',
163
+ title: 'Step B: Recalculate Exact Gap',
164
+ html: '<p class="bc-formula">g = (L - n × w) / (n + 1)</p><p>Once we know the exact number of balusters (n), we calculate how much space "remains" after subtracting all the wood width, and divide it equally among the gaps (n+1).</p>',
165
+ },
166
+ ],
167
+ },
168
+ {
169
+ type: 'title',
170
+ text: '3. Step-by-Step Installation Guide',
171
+ level: 3,
172
+ },
173
+ {
174
+ type: 'paragraph',
175
+ html: 'Having the numbers is only half the battle. Here we explain how to transfer those figures from paper (or screen) to the reality of your project.',
176
+ },
177
+ {
178
+ type: 'title',
179
+ text: 'Step 1: Precision Measurement',
180
+ level: 3,
181
+ },
182
+ {
183
+ type: 'paragraph',
184
+ html: 'Measure the <strong>internal</strong> distance between post and post. Do not measure from the center of the post. You need to know the exact clear span you will fill (L). If your railing has several sections, measure each one individually; buildings are rarely perfectly square and a 0.5 cm error can ruin the symmetry.',
185
+ },
186
+ {
187
+ type: 'title',
188
+ text: 'Step 2: Find the Center',
189
+ level: 3,
190
+ },
191
+ {
192
+ type: 'paragraph',
193
+ html: 'The number one beginner mistake is starting to place balusters from one end toward the other. This almost always results in a final gap of an odd size, breaking visual harmony.<ul><li>Mark the <strong>exact center</strong> of the railing (L / 2).</li><li>Decide whether you want a <em>baluster</em> or a <em>gap</em> at the center.</li><li>If you want a baluster at center: mark half the baluster width on each side of your center mark.</li><li>If you want a gap at center: mark half the gap distance (g / 2) on each side.</li></ul>',
194
+ },
195
+ {
196
+ type: 'title',
197
+ text: 'Step 3: Make a Spacer Block',
198
+ level: 3,
199
+ },
200
+ {
201
+ type: 'paragraph',
202
+ html: 'Do not use the tape measure for each baluster. Cumulative human error will cause the last baluster to be off by several centimeters. The professional approach is to cut a block of wood with the exact gap measurement (g) from our calculator.',
203
+ },
204
+ {
205
+ type: 'paragraph',
206
+ html: 'Use this block as a physical template. Place a baluster, put the block, place the next baluster tight against the block, and fasten it. This guarantees millimeter-level consistency.',
207
+ },
208
+ {
209
+ type: 'title',
210
+ text: '4. Materials and Tools Needed',
211
+ level: 3,
212
+ },
213
+ {
214
+ type: 'card',
215
+ icon: 'mdi:tools',
216
+ title: 'Equipment for a professional finish',
217
+ html: '<ul><li>High-precision tape measure</li><li>Carpenter pencil</li><li>Bubble level (for verticality)</li><li>Miter saw (for clean cuts)</li><li>Drill and wood screws</li><li>Spacer blocks (made to measure)</li></ul>',
218
+ },
219
+ {
220
+ type: 'title',
221
+ text: '5. Additional Technical Questions',
222
+ level: 3,
223
+ },
224
+ {
225
+ type: 'card',
226
+ icon: 'mdi:help-circle-outline',
227
+ title: 'What if the last gap does not fit?',
228
+ html: "<p>If you've used our calculator, this shouldn't happen. However, in the real world, wood warps and posts aren't always straight. If at the end you're off by 1-2 mm, it's imperceptible. If you're off by 1 cm, check your spacer blocks — you've probably been losing mm at each step.</p>",
229
+ },
230
+ {
231
+ type: 'card',
232
+ icon: 'mdi:shield-check-outline',
233
+ title: 'Can I space balusters further apart if I have no children?',
234
+ html: '<p>Legally, no. Building codes apply to the dwelling, not the current occupants. If you ever sell the house, a non-compliant railing will be a problem during inspection. Also, visitors (nephews, grandchildren) may be at risk.</p>',
235
+ },
236
+ {
237
+ type: 'card',
238
+ icon: 'mdi:wrench-outline',
239
+ title: 'Wood, Metal or Glass?',
240
+ html: '<p>This calculator works for <strong>any repetitive vertical element</strong>. If you use horizontal steel cables, different regulations apply (they typically must not allow climbing, "ladder effect"). For glass, it is considered a continuous panel and spacing does not apply — impact resistance does.</p>',
241
+ },
242
+ {
243
+ type: 'card',
244
+ icon: 'mdi:format-quote-close',
245
+ title: 'Mies van der Rohe',
246
+ html: '<p><em>"Architecture is the will of an epoch translated into space."</em></p><p>We hope this tool helps you build safer and more beautiful spaces. Always consult your local building code, as there may be specific variations on minimum height (typically 36-42 inches) or force loads.</p>',
247
+ },
248
+ ],
249
+ ui: {
250
+ sectionTitle: 'Dimensions',
251
+ sectionDesc: 'Enter your railing measurements',
252
+ labelRailLength: 'Total Length (L)',
253
+ labelBalusterWidth: 'Baluster Width (w)',
254
+ labelMaxGap: 'Maximum Gap (g)',
255
+ blueprintTitle: 'Assembly Plan',
256
+ blueprintRef: 'REF: BAL-001 // SCALE: AUTO',
257
+ labelRequired: 'Balusters Required',
258
+ labelExactGap: 'Exact Gap',
259
+ labelOnCenter: 'On Center',
260
+ labelTotalSpaces: 'Total Spaces',
261
+ labelCoveredLength: 'Covered Length',
262
+ labelDisclaimer: '* Dimensions shown are approximate for visualization.',
263
+ },
264
+ };
@@ -0,0 +1,264 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { BalusterCalculatorUI } from '../ui';
4
+
5
+ const slug = 'calculadora-balustres';
6
+ const title = 'Calculadora de Balustres: Espaciado Exacto para Barandillas';
7
+ const description =
8
+ 'Calcula el espacio exacto entre barrotes o balustres para barandillas cumpliendo la normativa de los 10cm. Planos automáticos.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: '¿Cuál es la distancia máxima legal entre balustres?',
13
+ answer:
14
+ 'En España (CTE) y en la mayoría de normativas internacionales, el espacio libre entre elementos de una barandilla no debe permitir el paso de una esfera de 10 cm de diámetro para evitar accidentes infantiles.',
15
+ },
16
+ {
17
+ question: '¿Cómo se mide el espaciado: entre centros o huecos?',
18
+ answer:
19
+ "Nuestra calculadora proporciona ambos. El 'espaciado libre' es el hueco real entre barrotes (vital por seguridad), mientras que la 'distancia entre centros' (on-center) es la que marca dónde taladrar o fijar cada balustre.",
20
+ },
21
+ {
22
+ question: '¿Qué pasa si el reparto no es exacto?',
23
+ answer:
24
+ 'La calculadora ajusta automáticamente el número de barrotes para que el primer y el último hueco sean idénticos, garantizando la simetría visual y el cumplimiento estricto del hueco máximo permitido.',
25
+ },
26
+ {
27
+ question: '¿Es mejor soldar o atornillar los balustres?',
28
+ answer:
29
+ 'Depende del material. En acero, la soldadura ofrece máxima rigidez estructural. En madera o aluminio, se usan anclajes mecánicos o tornillos pasantes. Lo importante es que la barandilla soporte una fuerza horizontal de al menos 0.8 kN/m.',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Medir la longitud total',
36
+ text: 'Mide la distancia exacta entre el primer y el último poste donde irá instalada la barandilla.',
37
+ },
38
+ {
39
+ name: 'Definir el grosor del balustre',
40
+ text: 'Mide el ancho de un barrote individual (ej. 2x2 cm para tubo cuadrado o el diámetro si es redondo).',
41
+ },
42
+ {
43
+ name: 'Establecer el hueco máximo',
44
+ text: 'Indica la separación máxima deseada (recomendado 10 cm para cumplir normativa).',
45
+ },
46
+ {
47
+ name: 'Obtener marcas de instalación',
48
+ text: 'Revisa la lista de posiciones exactas para realizar los taladros y asegurar un reparto simétrico y seguro.',
49
+ },
50
+ ];
51
+
52
+ const faqSchema: WithContext<FAQPage> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'FAQPage',
55
+ mainEntity: faqData.map((item) => ({
56
+ '@type': 'Question',
57
+ name: item.question,
58
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
59
+ })),
60
+ };
61
+
62
+ const howToSchema: WithContext<HowToThing> = {
63
+ '@context': 'https://schema.org',
64
+ '@type': 'HowTo',
65
+ name: title,
66
+ description,
67
+ step: howToData.map((step, i) => ({
68
+ '@type': 'HowToStep',
69
+ position: i + 1,
70
+ name: step.name,
71
+ text: step.text,
72
+ })),
73
+ };
74
+
75
+ const appSchema: WithContext<SoftwareApplication> = {
76
+ '@context': 'https://schema.org',
77
+ '@type': 'SoftwareApplication',
78
+ name: title,
79
+ description,
80
+ applicationCategory: 'UtilityApplication',
81
+ operatingSystem: 'All',
82
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
83
+ inLanguage: 'es',
84
+ };
85
+
86
+ export const content: ToolLocaleContent<BalusterCalculatorUI> = {
87
+ slug,
88
+ title,
89
+ description,
90
+ faqTitle: 'Preguntas Frecuentes',
91
+ faq: faqData,
92
+ bibliographyTitle: 'Referencias Técnicas',
93
+ bibliography: [
94
+ {
95
+ name: 'CTE - Código Técnico de la Edificación (España)',
96
+ url: 'https://www.codigotecnico.org/',
97
+ },
98
+ {
99
+ name: 'IRC - International Residential Code (EE.UU.)',
100
+ url: 'https://codes.iccsafe.org/content/IRC2021',
101
+ },
102
+ {
103
+ name: 'IBC - International Building Code',
104
+ url: 'https://codes.iccsafe.org/content/IBC2021',
105
+ },
106
+ ],
107
+ howTo: howToData,
108
+ schemas: [faqSchema, howToSchema, appSchema],
109
+ seo: [
110
+ {
111
+ type: 'title',
112
+ text: 'Guía Definitiva: Cómo Calcular el Espaciado de Balustres para Barandillas',
113
+ level: 2,
114
+ },
115
+ {
116
+ type: 'paragraph',
117
+ html: 'Diseñar una barandilla segura y estéticamente perfecta es un arte que combina la precisión matemática con la normativa de construcción. Ya sea para una terraza, un balcón o una escalera interior, el cálculo correcto de los balustres (o barrotes) es el paso más crítico del proyecto. Un error de cálculo no solo arruina la simetría visual, sino que puede hacer que tu estructura sea ilegal e insegura.',
118
+ },
119
+ {
120
+ type: 'card',
121
+ icon: 'mdi:alert-circle-outline',
122
+ title: '¿Por qué es tan importante este cálculo?',
123
+ html: '<p>No se trata solo de "rellenar el hueco". Se trata de cumplir con la <strong>Regla de la Esfera de 4 Pulgadas (10 cm)</strong>, una normativa internacional de seguridad diseñada para evitar accidentes infantiles.</p>',
124
+ },
125
+ {
126
+ type: 'title',
127
+ text: '1. La Normativa de Seguridad: La Regla de los 10 cm',
128
+ level: 3,
129
+ },
130
+ {
131
+ type: 'paragraph',
132
+ html: 'Antes de cortar la primera pieza de madera o metal, debes entender el "por qué" de las matemáticas. El Código Técnico de la Edificación (CTE) en España, así como el IRC (International Residential Code) en Estados Unidos, establecen una norma clara: <em>"El espacio libre entre los elementos verticales no debe permitir el paso de una esfera de 10 cm (4 pulgadas) de diámetro."</em>',
133
+ },
134
+ {
135
+ type: 'paragraph',
136
+ html: 'Esta medida no es arbitraria. Es el diámetro promedio de la cabeza de un niño pequeño (generalmente de menos de 1 año). Si un niño puede pasar el cuerpo pero la cabeza se queda atascada, el riesgo de asfixia es altísimo. Si puede pasar la cabeza, puede caerse al vacío. Por lo tanto, el objetivo de nuestra <strong>Calculadora de Balustres</strong> no es solo estético, es salvar vidas.',
137
+ },
138
+ {
139
+ type: 'title',
140
+ text: '2. El Problema Matemático: El Error del Poste de la Cerca',
141
+ level: 3,
142
+ },
143
+ {
144
+ type: 'paragraph',
145
+ html: 'En programación y construcción, existe un problema clásico llamado <em>"Fencepost Error"</em> (Error del Poste de la Cerca). Si quieres construir una valla de 10 metros con postes cada metro, ¿cuántos postes necesitas? La respuesta intuitiva es 10, pero la correcta es 11.',
146
+ },
147
+ {
148
+ type: 'paragraph',
149
+ html: 'Con los balustres ocurre algo similar, pero más complejo, porque el ancho del propio balustre ocupa espacio. La fórmula que utiliza nuestra herramienta resuelve este sistema de ecuaciones por ti:',
150
+ },
151
+ {
152
+ type: 'grid',
153
+ columns: [
154
+ {
155
+ type: 'card',
156
+ icon: 'mdi:calculator',
157
+ title: 'Paso A: Calcular Huecos',
158
+ html: '<p class="bc-formula">n = (L - g_max) / (w + g_max)</p><p>Primero determinamos cuántos balustres caben teóricamente si usáramos el espacio máximo permitido. Redondeamos este número hacia arriba para asegurar que los huecos resultantes sean <em>menores</em> que el máximo.</p>',
159
+ },
160
+ {
161
+ type: 'card',
162
+ icon: 'mdi:function-variant',
163
+ title: 'Paso B: Recalcular Espacio Exacto',
164
+ html: '<p class="bc-formula">g = (L - n × w) / (n + 1)</p><p>Una vez sabemos el número exacto de balustres (n), calculamos cuánto espacio "sobra" si restamos el ancho de toda la madera, y lo dividimos equitativamente entre los huecos (n+1).</p>',
165
+ },
166
+ ],
167
+ },
168
+ {
169
+ type: 'title',
170
+ text: '3. Guía Paso a Paso para la Instalación Perfecta',
171
+ level: 3,
172
+ },
173
+ {
174
+ type: 'paragraph',
175
+ html: 'Tener los números es solo la mitad de la batalla. Aquí te explicamos cómo trasladar esas cifras del papel (o la pantalla) a la realidad de tu obra.',
176
+ },
177
+ {
178
+ type: 'title',
179
+ text: 'Pase 1: Medición de Precisión',
180
+ level: 3,
181
+ },
182
+ {
183
+ type: 'paragraph',
184
+ html: 'Mide la distancia <strong>interna</strong> entre poste y poste. No midas desde el centro del poste. Necesitas saber el espacio luz exacto que vas a rellenar (L). Si tu barandilla tiene varios tramos, mide cada uno individualmente; las construcciones rara vez son perfectamente cuadradas y un error de 0.5 cm puede arruinar la simetría.',
185
+ },
186
+ {
187
+ type: 'title',
188
+ text: 'Paso 2: Encontrar el Centro',
189
+ level: 3,
190
+ },
191
+ {
192
+ type: 'paragraph',
193
+ html: 'El error de principiante número uno es empezar a colocar balustres desde un extremo hacia el otro. Esto casi siempre resulta en un último hueco de tamaño extraño, rompiendo la armonía visual.<ul><li>Marca el <strong>centro exacto</strong> de la barandilla (L / 2).</li><li>Decide si quieres que en el centro haya un <em>balustre</em> o un <em>hueco</em>.</li><li>Si quieres un balustre en el centro: marca la mitad del ancho del balustre a cada lado de tu marca central.</li><li>Si quieres un hueco en el centro: marca la mitad de la distancia del hueco (g / 2) a cada lado.</li></ul>',
194
+ },
195
+ {
196
+ type: 'title',
197
+ text: 'Paso 3: Fabricar un Separador (Spacers)',
198
+ level: 3,
199
+ },
200
+ {
201
+ type: 'paragraph',
202
+ html: 'No uses la cinta métrica para cada balustre. El error humano acumulativo hará que el último balustre esté desviado varios centímetros. Lo profesional es cortar un bloque de madera (o dos) con la medida exacta del hueco (g) que te ha dado nuestra calculadora.',
203
+ },
204
+ {
205
+ type: 'paragraph',
206
+ html: 'Usa este bloque como plantilla física. Coloca un balustre, pon el bloque, coloca el siguiente balustre apretado contra el bloque, y fíjalo. Esto garantiza una consistencia milimétrica.',
207
+ },
208
+ {
209
+ type: 'title',
210
+ text: '4. Materiales y Herramientas Necesarias',
211
+ level: 3,
212
+ },
213
+ {
214
+ type: 'card',
215
+ icon: 'mdi:tools',
216
+ title: 'Equipamiento para un acabado profesional',
217
+ html: '<ul><li>Cinta métrica de alta precisión</li><li>Lápiz de carpintero</li><li>Nivel de burbuja (para la verticalidad)</li><li>Sierra ingleteadora (para cortes limpios)</li><li>Taladro y tornillos para madera</li><li>Bloques separadores (hechos a medida)</li></ul>',
218
+ },
219
+ {
220
+ type: 'title',
221
+ text: '5. Preguntas Técnicas Adicionales',
222
+ level: 3,
223
+ },
224
+ {
225
+ type: 'card',
226
+ icon: 'mdi:help-circle-outline',
227
+ title: '¿Qué pasa si el último hueco no encaja?',
228
+ html: '<p>Si has usado nuestra calculadora, esto no debería pasar. Sin embargo, en el mundo real, la madera se curva y los postes no siempre están rectos. Si al llegar al final te sobra o falta 1-2 mm, es imperceptible. Si te falta 1 cm, revisa tus bloques separadores, probablemente te has ido comiendo mm en cada paso.</p>',
229
+ },
230
+ {
231
+ type: 'card',
232
+ icon: 'mdi:shield-check-outline',
233
+ title: '¿Puedo poner los balustres más separados si no tengo niños?',
234
+ html: '<p>Legalmente, no. El código de construcción se aplica a la vivienda, no a los habitantes actuales. Si algún día vendes la casa, una barandilla fuera de normativa será un problema en la inspección. Además, las visitas (sobrinos, nietos) pueden estar en peligro.</p>',
235
+ },
236
+ {
237
+ type: 'card',
238
+ icon: 'mdi:wrench-outline',
239
+ title: '¿Madera, Metal o Vidrio?',
240
+ html: '<p>Esta calculadora funciona para <strong>cualquier elemento vertical repetitivo</strong>. Si usas cables de acero horizontales, la normativa es diferente (normalmente no deben permitir escalar, "efecto escalera"). Para vidrio, se considera un panel continuo y no aplica espaciado, sino resistencia al impacto.</p>',
241
+ },
242
+ {
243
+ type: 'card',
244
+ icon: 'mdi:format-quote-close',
245
+ title: 'Mies van der Rohe',
246
+ html: '<p><em>"La arquitectura es la voluntad de la época traducida a espacio."</em></p><p>Esperamos que esta herramienta te ayude a construir espacios más seguros y bellos. Recuerda siempre consultar el código de construcción local de tu municipio, ya que puede haber variaciones específicas sobre la altura mínima (generalmente 90-110 cm) o cargas de fuerza.</p>',
247
+ },
248
+ ],
249
+ ui: {
250
+ sectionTitle: 'Dimensiones',
251
+ sectionDesc: 'Ingresa las medidas de tu barandilla',
252
+ labelRailLength: 'Longitud Total (L)',
253
+ labelBalusterWidth: 'Ancho Balustre (w)',
254
+ labelMaxGap: 'Espacio Máximo (g)',
255
+ blueprintTitle: 'Plan de Montaje',
256
+ blueprintRef: 'REF: BAL-001 // ESCALA: AUTO',
257
+ labelRequired: 'Balustres Requeridos',
258
+ labelExactGap: 'Gap Exacto',
259
+ labelOnCenter: 'Centro a Centro',
260
+ labelTotalSpaces: 'Espacios Totales',
261
+ labelCoveredLength: 'Longitud Cubierta',
262
+ labelDisclaimer: '* Las dimensiones mostradas son aproximadas para visualización.',
263
+ },
264
+ };