@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,155 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { VoltageDropCalculatorUI } from '../ui';
4
+
5
+ const slug = 'voltage-drop-calculator';
6
+ const title = 'Voltage Drop Calculator: Wire Cross Section from Volts, Watts and Distance';
7
+ const description =
8
+ 'Free voltage drop calculator for 12V, 24V and 230V systems. Find the right cable cross section by entering current, wire length and conductor material. Essential for camper vans, solar and home wiring.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: 'What is voltage drop and why does it matter?',
13
+ answer:
14
+ 'Voltage drop is the loss of voltage that occurs as electricity travels through a cable. A wire that is too thin or too long loses voltage along the way. Practical consequences include dim lights, motors that fail to start, and cables that overheat dangerously.',
15
+ },
16
+ {
17
+ question: 'What cable size do I need for 12V at 10 metres?',
18
+ answer:
19
+ 'It depends on the current. For 12V and 10A over 10m, you need at minimum 2.5mm². For 20A, you need 6mm². At low voltage (12V or 24V), voltage drop is far more critical than at 230V because the same wattage demands much higher current.',
20
+ },
21
+ {
22
+ question: 'Can I use 1.5mm² cable throughout my camper van?',
23
+ answer:
24
+ 'No. 1.5mm² is suitable for light circuits up to about 10A. Sockets and fridges need 2.5mm². High-draw appliances like inverters or cookers need 6mm² or more. Undersized cable is a fire risk.',
25
+ },
26
+ {
27
+ question: 'What is the maximum allowable voltage drop?',
28
+ answer:
29
+ 'For domestic 230V installations: maximum 3% for lighting circuits, 5% for other circuits. For 12V or 24V systems (solar, camper van, marine): aim for no more than 3% total. Beyond these limits, efficiency falls and overheating risk rises.',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Select the system voltage',
36
+ text: 'Choose 12V, 24V (solar or camper) or 230V (mains) depending on your installation.',
37
+ },
38
+ {
39
+ name: 'Enter the load',
40
+ text: 'Type the Watts (W) or Amperes (A) that the appliance at the end of the cable will draw.',
41
+ },
42
+ {
43
+ name: 'Set the cable length',
44
+ text: 'Enter the one-way distance in metres from the power source to the load.',
45
+ },
46
+ {
47
+ name: 'Choose the conductor material',
48
+ text: 'Select copper (standard) or aluminium to get the correct resistivity in the calculation.',
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: 'en',
84
+ };
85
+
86
+ export const content: ToolLocaleContent<VoltageDropCalculatorUI> = {
87
+ slug,
88
+ title,
89
+ description,
90
+ faqTitle: 'Frequently Asked Questions',
91
+ faq: faqData,
92
+ bibliographyTitle: 'Technical References',
93
+ bibliography: [
94
+ { name: 'IEC 60364: Low voltage electrical installations', url: 'https://www.iec.ch/homepage' },
95
+ { name: 'Voltage drop: Wikipedia', url: 'https://en.wikipedia.org/wiki/Voltage_drop' },
96
+ { name: 'Electrical resistivity and conductivity: Wikipedia', url: 'https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity' },
97
+ ],
98
+ howTo: howToData,
99
+ schemas: [faqSchema, howToSchema, appSchema],
100
+ seo: [
101
+ { type: 'title', text: 'Complete Guide to Voltage Drop in DC and AC Systems', level: 2 },
102
+ {
103
+ type: 'paragraph',
104
+ html: 'Whether you are wiring a camper van, designing an off-grid solar system or running cable for garden lighting, there is one invisible enemy that can ruin your project before it starts: <strong>voltage drop</strong>. It is not just a technical nuance — it is the difference between a fridge that cools and one that shuts off, or between a safe installation and a fire hazard.',
105
+ },
106
+ { type: 'title', text: 'The Ohm\'s Law Formula Behind the Calculator', level: 3 },
107
+ {
108
+ type: 'card',
109
+ icon: 'mdi:function-variant',
110
+ title: 'How Voltage Drop Is Calculated',
111
+ html: '<p>The formula is <strong>ΔV = (2 × L × I × ρ) / S</strong>. L is the one-way cable length in metres, I is the current in amperes, ρ is resistivity (0.0178 Ω·mm²/m for copper, 0.028 for aluminium), and S is the cable cross-section in mm². The factor of 2 accounts for the current flowing out and back through the cable.</p>',
112
+ },
113
+ { type: 'title', text: 'Why 12V Systems Need Thicker Cable Than 230V', level: 3 },
114
+ {
115
+ type: 'card',
116
+ icon: 'mdi:alert-circle-outline',
117
+ title: 'The Low Voltage Paradox',
118
+ html: '<p>To deliver 1000W at 230V you only need 4.3A and a 1.5mm² cable will do the job. To deliver the same 1000W at 12V you need 83.3A, requiring 25mm² cable. The lower the voltage, <strong>the thicker the cable must be</strong> to carry the same power without dangerous losses. This surprises most camper van builders who assume 12V is safe to wire casually.</p>',
119
+ },
120
+ { type: 'title', text: 'Real Consequences of Excessive Voltage Drop', level: 3 },
121
+ {
122
+ type: 'card',
123
+ icon: 'mdi:thermometer-alert',
124
+ title: 'Heat, Failures and Fire Risk',
125
+ html: '<p>A cable carrying too much current for its cross-section converts electrical energy into heat. Practical consequences: 12V fridges that shut off because they detect low voltage even with a full battery, LED strips that fade and yellow at the far end, motors that cannot reach rated torque, and in extreme cases, PVC insulation melting and causing fire.</p>',
126
+ },
127
+ { type: 'title', text: 'Cable Size Reference for 12V Systems', level: 3 },
128
+ {
129
+ type: 'paragraph',
130
+ html: 'Quick reference for 12V DC wiring: <strong>1.5mm²</strong> light circuits up to 10A, <strong>2.5mm²</strong> fridges and USB sockets up to 20A, <strong>6mm²</strong> solar panels up to 40A, <strong>16mm²</strong> secondary battery connections up to 80A, <strong>25mm²</strong> main camper van circuits up to 120A. Always verify with the calculator using your exact wire length and current.',
131
+ },
132
+ ],
133
+ ui: {
134
+ heroDropLabel: 'Total Voltage Drop',
135
+ heroVoltsUnit: 'Volts',
136
+ heroPctLoss: '% loss',
137
+ heroEffLabel: 'Efficiency',
138
+ statusExcellent: 'Excellent',
139
+ statusAcceptable: 'Acceptable',
140
+ statusCritical: 'Critical',
141
+ fieldVoltage: 'Voltage',
142
+ fieldMaterial: 'Material',
143
+ materialCopper: 'Copper',
144
+ materialAlum: 'Alum.',
145
+ fieldLoad: 'Load',
146
+ modeW: 'W',
147
+ modeA: 'A',
148
+ unitWatts: 'Watts',
149
+ unitAmps: 'Amps',
150
+ fieldLength: 'Cable Length (One Way)',
151
+ unitMeters: 'metres',
152
+ fieldSection: 'Cable Cross Section',
153
+ sectionInfo: 'Recommended',
154
+ },
155
+ };
@@ -0,0 +1,155 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { VoltageDropCalculatorUI } from '../ui';
4
+
5
+ const slug = 'calculadora-caida-tension';
6
+ const title = 'Calculadora de Caída de Tensión y Sección de Cable';
7
+ const description =
8
+ 'Herramienta técnica para evitar cables quemados. Calcula la sección necesaria para instalaciones de 12V, 24V y 230V según distancia y potencia. Rápido, preciso y sin registros.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: '¿Qué es la caída de tensión y por qué importa?',
13
+ answer:
14
+ 'Es la pérdida de voltaje que ocurre cuando la electricidad viaja por un cable. Si el cable es muy fino o muy largo, pierdes voltaje. Resultado: luces tenues, motores que no arrancan, o cables que se calientan peligrosamente.',
15
+ },
16
+ {
17
+ question: '¿Qué sección de cable necesito para 12V a 10 metros?',
18
+ answer:
19
+ 'Depende de la potencia. Para 12V y 10A a 10m, necesitas mínimo 2.5mm². Para 20A, necesitas 6mm². A bajo voltaje (12V/24V), la caída es mucho más crítica que a 230V.',
20
+ },
21
+ {
22
+ question: '¿Puedo usar cable de 1.5mm² para toda mi instalación?',
23
+ answer:
24
+ 'No. 1.5mm² es para circuitos de iluminación (máx 10A). Para enchufes necesitas 2.5mm². Para cocina o lavadora necesitas 4mm² o 6mm². Usar cable fino es peligroso y puede causar incendios.',
25
+ },
26
+ {
27
+ question: '¿Cuál es la caída de tensión máxima permitida?',
28
+ answer:
29
+ 'En instalaciones domésticas (230V): máximo 3% para iluminación, 5% para otros usos. En 12V/24V (autocaravanas, solar): no más del 3% total. Más caída significa pérdida de eficiencia y riesgo de sobrecalentamiento.',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Definir el voltaje del sistema',
36
+ text: 'Selecciona si tu instalación es de 12V, 24V (solar/camper) o 230V (doméstica).',
37
+ },
38
+ {
39
+ name: 'Introducir la intensidad de corriente',
40
+ text: 'Escribe los Amperios (A) o Vatios (W) que consumirá el aparato al final del cable.',
41
+ },
42
+ {
43
+ name: 'Medir la distancia del cable',
44
+ text: 'Introduce la longitud de ida del cable en metros desde la fuente de energía hasta el receptor.',
45
+ },
46
+ {
47
+ name: 'Elegir el material del conductor',
48
+ text: 'Selecciona cobre (estándar) o aluminio para obtener el cálculo exacto de resistividad.',
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<VoltageDropCalculatorUI> = {
87
+ slug,
88
+ title,
89
+ description,
90
+ faqTitle: 'Preguntas Frecuentes',
91
+ faq: faqData,
92
+ bibliographyTitle: 'Referencias Técnicas',
93
+ bibliography: [
94
+ { name: 'IEC 60364: Instalaciones eléctricas de baja tensión', url: 'https://www.iec.ch/homepage' },
95
+ { name: 'Ley de Ohm y Resistividad: Wikipedia', url: 'https://es.wikipedia.org/wiki/Resistividad' },
96
+ { name: 'REBT: Reglamento Electrotécnico de Baja Tensión', url: 'https://www.boe.es/eli/es/rd/2002/08/02/842' },
97
+ ],
98
+ howTo: howToData,
99
+ schemas: [faqSchema, howToSchema, appSchema],
100
+ seo: [
101
+ { type: 'title', text: 'Guía Completa de Caída de Tensión', level: 2 },
102
+ {
103
+ type: 'paragraph',
104
+ html: 'Si estás camperizando una furgoneta, diseñando una instalación solar o tirando cables para iluminar tu jardín, hay un enemigo invisible que puede arruinar tu proyecto: la <strong>caída de tensión</strong>. No es solo una cuestión técnica; es la diferencia entre una nevera que enfría y una que se apaga, o entre una instalación segura y un riesgo de incendio.',
105
+ },
106
+ { type: 'title', text: 'La Fórmula de la Caída de Tensión', level: 3 },
107
+ {
108
+ type: 'card',
109
+ icon: 'mdi:function-variant',
110
+ title: 'Cálculo Exacto con la Ley de Ohm',
111
+ html: '<p>La fórmula es <strong>ΔV = (2 × L × I × ρ) / S</strong>, donde L es la longitud de ida en metros, I la corriente en amperios, ρ la resistividad del material (0,0178 Ω·mm²/m para cobre, 0,028 para aluminio) y S la sección del cable en mm². El factor 2 se debe a que la corriente recorre el cable de ida y de vuelta.</p>',
112
+ },
113
+ { type: 'title', text: 'La Paradoja del Bajo Voltaje', level: 3 },
114
+ {
115
+ type: 'card',
116
+ icon: 'mdi:alert-circle-outline',
117
+ title: 'Por qué el 12V necesita cables más gruesos que el 230V',
118
+ html: '<p>Para transportar la misma potencia (1000W), a 230V necesitas solo 4,3A y un cable de 1,5mm². A 12V necesitas 83,3A y un cable de 25mm². Cuanto más bajo es el voltaje, <strong>más grueso debe ser el cable</strong> para transportar la misma energía sin pérdidas peligrosas.</p>',
119
+ },
120
+ { type: 'title', text: 'Consecuencias de una Caída Excesiva', level: 3 },
121
+ {
122
+ type: 'card',
123
+ icon: 'mdi:thermometer-alert',
124
+ title: 'Calor, Averías e Incendios',
125
+ html: '<p>Un cable con excesiva caída de tensión convierte la energía eléctrica en calor. Las consecuencias prácticas son: neveras 12V que se apagan creyendo que la batería está baja, tiras LED que se degradan en color hacia el final, motores que no alcanzan su par nominal y, en casos extremos, fusión del PVC y riesgo de incendio.</p>',
126
+ },
127
+ { type: 'title', text: 'Tabla de Secciones y Usos Habituales', level: 3 },
128
+ {
129
+ type: 'paragraph',
130
+ html: 'Referencia rápida para instalaciones 12V: <strong>1,5mm²</strong> iluminación ligera (hasta 10A), <strong>2,5mm²</strong> neveras y tomas USB (hasta 20A), <strong>6mm²</strong> placas solares (hasta 40A), <strong>16mm²</strong> conexión de baterías auxiliares (hasta 80A), <strong>25mm²</strong> circuitos principales de camper (hasta 120A). Estos valores son orientativos; usa siempre la calculadora con tu longitud y corriente exactas.',
131
+ },
132
+ ],
133
+ ui: {
134
+ heroDropLabel: 'Caída de Tensión Total',
135
+ heroVoltsUnit: 'Voltios',
136
+ heroPctLoss: '% pérdida',
137
+ heroEffLabel: 'Eficiencia',
138
+ statusExcellent: 'Excelente',
139
+ statusAcceptable: 'Aceptable',
140
+ statusCritical: 'Crítico',
141
+ fieldVoltage: 'Voltaje',
142
+ fieldMaterial: 'Material',
143
+ materialCopper: 'Cobre',
144
+ materialAlum: 'Alum.',
145
+ fieldLoad: 'Carga',
146
+ modeW: 'W',
147
+ modeA: 'A',
148
+ unitWatts: 'Vatios',
149
+ unitAmps: 'Amperios',
150
+ fieldLength: 'Longitud del Cable (Ida)',
151
+ unitMeters: 'metros',
152
+ fieldSection: 'Sección del Cable',
153
+ sectionInfo: 'Recomendado',
154
+ },
155
+ };
@@ -0,0 +1,148 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { VoltageDropCalculatorUI } from '../ui';
4
+
5
+ const slug = 'calculateur-chute-tension';
6
+ const title = 'Calculateur de Chute de Tension et Section de Câble';
7
+ const description =
8
+ 'Calculez la chute de tension et la section de câble nécessaire pour vos installations 12V, 24V et 230V. Entrez la puissance, la distance et le matériau du conducteur pour obtenir un résultat précis.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: 'Qu\'est-ce que la chute de tension?',
13
+ answer:
14
+ 'La chute de tension est la perte de voltage qui se produit lorsque le courant électrique parcourt un câble. Un câble trop fin ou trop long entraîne une perte de tension. Résultat pratique: lumières ternes, moteurs qui ne démarrent pas, câbles qui surchauffent.',
15
+ },
16
+ {
17
+ question: 'Quelle section de câble pour du 12V sur 10 mètres?',
18
+ answer:
19
+ 'Cela dépend de la puissance. Pour 12V et 10A sur 10m, il faut au minimum 2,5mm². Pour 20A, il faut 6mm². En basse tension (12V/24V), la chute de tension est beaucoup plus critique qu\'en 230V.',
20
+ },
21
+ {
22
+ question: 'Quelle est la chute de tension maximale autorisée?',
23
+ answer:
24
+ 'Pour les installations domestiques (230V): maximum 3% pour l\'éclairage, 5% pour les autres usages. Pour les systèmes 12V/24V (camping-car, solaire): ne pas dépasser 3% au total. Au-delà, l\'efficacité chute et le risque de surchauffe augmente.',
25
+ },
26
+ {
27
+ question: 'Pourquoi le 12V nécessite des câbles plus épais que le 230V?',
28
+ answer:
29
+ 'Pour transporter la même puissance (1000W), le 230V nécessite seulement 4,3A et un câble de 1,5mm². Le 12V nécessite 83,3A et un câble de 25mm². Plus la tension est basse, plus le câble doit être épais pour éviter les pertes.',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Choisir la tension du système',
36
+ text: 'Sélectionnez 12V, 24V (solaire/camping-car) ou 230V (réseau) selon votre installation.',
37
+ },
38
+ {
39
+ name: 'Saisir la charge',
40
+ text: 'Entrez les Watts (W) ou Ampères (A) que consommera l\'appareil en bout de câble.',
41
+ },
42
+ {
43
+ name: 'Mesurer la longueur du câble',
44
+ text: 'Entrez la distance aller en mètres depuis la source d\'énergie jusqu\'au récepteur.',
45
+ },
46
+ {
47
+ name: 'Choisir le matériau du conducteur',
48
+ text: 'Sélectionnez cuivre (standard) ou aluminium pour obtenir le calcul de résistivité exact.',
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: 'fr',
84
+ };
85
+
86
+ export const content: ToolLocaleContent<VoltageDropCalculatorUI> = {
87
+ slug,
88
+ title,
89
+ description,
90
+ faqTitle: 'Questions Fréquentes',
91
+ faq: faqData,
92
+ bibliographyTitle: 'Références Techniques',
93
+ bibliography: [
94
+ { name: 'IEC 60364: Installations électriques basse tension', url: 'https://www.iec.ch/homepage' },
95
+ { name: 'Chute de tension: Wikipedia', url: 'https://fr.wikipedia.org/wiki/Chute_de_tension' },
96
+ { name: 'Résistivité électrique: Wikipedia', url: 'https://fr.wikipedia.org/wiki/R%C3%A9sistivit%C3%A9' },
97
+ ],
98
+ howTo: howToData,
99
+ schemas: [faqSchema, howToSchema, appSchema],
100
+ seo: [
101
+ { type: 'title', text: 'Guide Complet sur la Chute de Tension', level: 2 },
102
+ {
103
+ type: 'paragraph',
104
+ html: 'Que vous aménagez un van, installez des panneaux solaires ou câblez votre jardin, il existe un ennemi invisible qui peut compromettre votre projet: la <strong>chute de tension</strong>. Ce n\'est pas seulement une question technique; c\'est la différence entre un réfrigérateur qui refroidit et un qui s\'éteint, entre une installation sûre et un risque d\'incendie.',
105
+ },
106
+ { type: 'title', text: 'La Formule de Calcul de la Chute de Tension', level: 3 },
107
+ {
108
+ type: 'card',
109
+ icon: 'mdi:function-variant',
110
+ title: 'Calcul Exact par la Loi d\'Ohm',
111
+ html: '<p>La formule est <strong>ΔV = (2 × L × I × ρ) / S</strong>. L est la longueur aller en mètres, I le courant en ampères, ρ la résistivité du matériau (0,0178 Ω·mm²/m pour le cuivre, 0,028 pour l\'aluminium) et S la section du câble en mm². Le facteur 2 correspond au trajet aller-retour du courant.',
112
+ },
113
+ { type: 'title', text: 'Le Paradoxe de la Basse Tension', level: 3 },
114
+ {
115
+ type: 'card',
116
+ icon: 'mdi:alert-circle-outline',
117
+ title: 'Pourquoi le 12V exige des câbles plus épais que le 230V',
118
+ html: '<p>Pour transporter 1000W à 230V, il suffit de 4,3A et un câble de 1,5mm². Pour les mêmes 1000W à 12V, il faut 83,3A et un câble de 25mm². <strong>Plus la tension est basse, plus le câble doit être épais</strong> pour transporter la même énergie sans pertes dangereuses. C\'est le paradoxe qui surprend la plupart des constructeurs de van.</p>',
119
+ },
120
+ { type: 'title', text: 'Sections de Référence pour Installations 12V', level: 3 },
121
+ {
122
+ type: 'paragraph',
123
+ html: 'Référence rapide pour le câblage 12V DC: <strong>1,5mm²</strong> éclairage léger jusqu\'à 10A, <strong>2,5mm²</strong> réfrigérateurs et prises USB jusqu\'à 20A, <strong>6mm²</strong> panneaux solaires jusqu\'à 40A, <strong>16mm²</strong> batteries auxiliaires jusqu\'à 80A, <strong>25mm²</strong> circuits principaux de van jusqu\'à 120A. Utilisez toujours le calculateur avec votre longueur et courant exacts.',
124
+ },
125
+ ],
126
+ ui: {
127
+ heroDropLabel: 'Chute de Tension Totale',
128
+ heroVoltsUnit: 'Volts',
129
+ heroPctLoss: '% de perte',
130
+ heroEffLabel: 'Efficacité',
131
+ statusExcellent: 'Excellent',
132
+ statusAcceptable: 'Acceptable',
133
+ statusCritical: 'Critique',
134
+ fieldVoltage: 'Tension',
135
+ fieldMaterial: 'Matériau',
136
+ materialCopper: 'Cuivre',
137
+ materialAlum: 'Alum.',
138
+ fieldLoad: 'Charge',
139
+ modeW: 'W',
140
+ modeA: 'A',
141
+ unitWatts: 'Watts',
142
+ unitAmps: 'Ampères',
143
+ fieldLength: 'Longueur du Câble (Aller)',
144
+ unitMeters: 'mètres',
145
+ fieldSection: 'Section du Câble',
146
+ sectionInfo: 'Recommandé',
147
+ },
148
+ };
@@ -0,0 +1,28 @@
1
+ import VoltageDropCalculatorComponent from './component.astro';
2
+ import VoltageDropCalculatorSEO from './seo.astro';
3
+ import VoltageDropCalculatorBibliography from './bibliography.astro';
4
+ import type { DiyToolEntry, ToolDefinition } from '../../types';
5
+ import type { VoltageDropCalculatorUI } from './ui';
6
+
7
+ export {
8
+ VoltageDropCalculatorComponent,
9
+ VoltageDropCalculatorSEO,
10
+ VoltageDropCalculatorBibliography,
11
+ };
12
+
13
+ const es = async () => (await import('./i18n/es')).content;
14
+ const en = async () => (await import('./i18n/en')).content;
15
+ const fr = async () => (await import('./i18n/fr')).content;
16
+
17
+ export const voltageDropCalculator: DiyToolEntry<VoltageDropCalculatorUI> = {
18
+ id: 'voltage-drop-calculator',
19
+ icons: { bg: 'mdi:flash', fg: 'mdi:cable-data' },
20
+ i18n: { es, en, fr },
21
+ };
22
+
23
+ export const VOLTAGE_DROP_CALCULATOR_TOOL: ToolDefinition = {
24
+ entry: voltageDropCalculator,
25
+ Component: VoltageDropCalculatorComponent,
26
+ SEOComponent: VoltageDropCalculatorSEO,
27
+ BibliographyComponent: VoltageDropCalculatorBibliography,
28
+ };
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { SEORenderer } from '@jjlmoya/utils-shared';
3
+ import { voltageDropCalculator } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+ const { locale = 'es' } = Astro.props;
10
+ const content = await voltageDropCalculator.i18n[locale]?.();
11
+ if (!content) return null;
12
+ ---
13
+
14
+ <SEORenderer content={{ locale: locale as string, sections: content.seo }} />
@@ -0,0 +1,22 @@
1
+ export interface VoltageDropCalculatorUI extends Record<string, string> {
2
+ heroDropLabel: string;
3
+ heroVoltsUnit: string;
4
+ heroPctLoss: string;
5
+ heroEffLabel: string;
6
+ statusExcellent: string;
7
+ statusAcceptable: string;
8
+ statusCritical: string;
9
+ fieldVoltage: string;
10
+ fieldMaterial: string;
11
+ materialCopper: string;
12
+ materialAlum: string;
13
+ fieldLoad: string;
14
+ modeW: string;
15
+ modeA: string;
16
+ unitWatts: string;
17
+ unitAmps: string;
18
+ fieldLength: string;
19
+ unitMeters: string;
20
+ fieldSection: string;
21
+ sectionInfo: string;
22
+ }
package/src/tools.ts ADDED
@@ -0,0 +1,16 @@
1
+ import type { ToolDefinition } from './types';
2
+ import { CLAY_CALCULATOR_TOOL } from './tool/clayCalculator/index';
3
+ import { EPOXY_CALCULATOR_TOOL } from './tool/epoxyCalculator/index';
4
+ import { BALUSTER_CALCULATOR_TOOL } from './tool/balusterCalculator/index';
5
+ import { MORTAR_CALCULATOR_TOOL } from './tool/mortarCalculator/index';
6
+ import { PASSEPARTOUT_CALCULATOR_TOOL } from './tool/passepartoutCalculator/index';
7
+ import { CONCRETE_CALCULATOR_TOOL } from './tool/concreteCalculator/index';
8
+ import { CUT_OPTIMIZER_TOOL } from './tool/cutOptimizer/index';
9
+ import { VOLTAGE_DROP_CALCULATOR_TOOL } from './tool/voltageDropCalculator/index';
10
+ import { FURNITURE_FIT_TOOL } from './tool/furnitureFit/index';
11
+ import { THERMAL_EXPANSION_CALCULATOR_TOOL } from './tool/thermalExpansionCalculator/index';
12
+ import { DRILL_CALCULATOR_TOOL } from './tool/drillCalculator/index';
13
+ import { STAIR_CALCULATOR_TOOL } from './tool/stairCalculator/index';
14
+ import { DRILL_SHARPENER_TOOL } from './tool/drillSharpener/index';
15
+
16
+ export const ALL_TOOLS: ToolDefinition[] = [CLAY_CALCULATOR_TOOL, EPOXY_CALCULATOR_TOOL, BALUSTER_CALCULATOR_TOOL, MORTAR_CALCULATOR_TOOL, PASSEPARTOUT_CALCULATOR_TOOL, CONCRETE_CALCULATOR_TOOL, CUT_OPTIMIZER_TOOL, VOLTAGE_DROP_CALCULATOR_TOOL, FURNITURE_FIT_TOOL, THERMAL_EXPANSION_CALCULATOR_TOOL, DRILL_CALCULATOR_TOOL, STAIR_CALCULATOR_TOOL, DRILL_SHARPENER_TOOL];
package/src/types.ts ADDED
@@ -0,0 +1,72 @@
1
+ import type { SEOSection } from '@jjlmoya/utils-shared';
2
+ import type { WithContext, Thing } from 'schema-dts';
3
+
4
+ export type { SEOSection };
5
+
6
+ export type KnownLocale =
7
+ | 'ar' | 'da' | 'de' | 'en' | 'es' | 'fi'
8
+ | 'fr' | 'it' | 'ja' | 'ko' | 'nb' | 'nl'
9
+ | 'pl' | 'pt' | 'ru' | 'sv' | 'tr' | 'zh';
10
+
11
+ export interface FAQItem {
12
+ question: string;
13
+ answer: string;
14
+ }
15
+
16
+ export interface BibliographyEntry {
17
+ name: string;
18
+ url: string;
19
+ }
20
+
21
+ export interface HowToStep {
22
+ name: string;
23
+ text: string;
24
+ }
25
+
26
+ export interface ToolLocaleContent<TUI extends Record<string, string> = Record<string, string>> {
27
+ slug: string;
28
+ title: string;
29
+ description: string;
30
+ ui: TUI;
31
+ seo: SEOSection[];
32
+ faqTitle?: string;
33
+ faq: FAQItem[];
34
+ bibliographyTitle?: string;
35
+ bibliography: BibliographyEntry[];
36
+ howTo: HowToStep[];
37
+ schemas: WithContext<Thing>[];
38
+ }
39
+
40
+ export interface CategoryLocaleContent {
41
+ slug: string;
42
+ title: string;
43
+ description: string;
44
+ seo: SEOSection[];
45
+ }
46
+
47
+ export type LocaleLoader<T> = () => Promise<T>;
48
+
49
+ export type LocaleMap<T> = Partial<Record<KnownLocale, LocaleLoader<T>>>;
50
+
51
+ export interface DiyToolEntry<TUI extends Record<string, string> = Record<string, string>> {
52
+ id: string;
53
+ icons: {
54
+ bg: string;
55
+ fg: string;
56
+ };
57
+ i18n: LocaleMap<ToolLocaleContent<TUI>>;
58
+ }
59
+
60
+ export interface DiyCategoryEntry {
61
+ icon: string;
62
+ tools: DiyToolEntry[];
63
+ i18n: LocaleMap<CategoryLocaleContent>;
64
+ }
65
+
66
+ export interface ToolDefinition {
67
+ entry: DiyToolEntry;
68
+ Component: unknown;
69
+ SEOComponent: unknown;
70
+ BibliographyComponent: unknown;
71
+ }
72
+