@jjlmoya/utils-health 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 (155) hide show
  1. package/package.json +60 -0
  2. package/src/category/i18n/en.ts +60 -0
  3. package/src/category/i18n/es.ts +60 -0
  4. package/src/category/i18n/fr.ts +60 -0
  5. package/src/category/index.ts +22 -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 +28 -0
  10. package/src/env.d.ts +5 -0
  11. package/src/index.ts +36 -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/binauralTuner/bibliography.astro +14 -0
  25. package/src/tool/binauralTuner/component.astro +687 -0
  26. package/src/tool/binauralTuner/i18n/en.ts +187 -0
  27. package/src/tool/binauralTuner/i18n/es.ts +187 -0
  28. package/src/tool/binauralTuner/i18n/fr.ts +187 -0
  29. package/src/tool/binauralTuner/index.ts +27 -0
  30. package/src/tool/binauralTuner/seo.astro +14 -0
  31. package/src/tool/binauralTuner/ui.ts +18 -0
  32. package/src/tool/bloodUnitConverter/bibliography.astro +14 -0
  33. package/src/tool/bloodUnitConverter/component.astro +915 -0
  34. package/src/tool/bloodUnitConverter/i18n/en.ts +227 -0
  35. package/src/tool/bloodUnitConverter/i18n/es.ts +250 -0
  36. package/src/tool/bloodUnitConverter/i18n/fr.ts +218 -0
  37. package/src/tool/bloodUnitConverter/index.ts +27 -0
  38. package/src/tool/bloodUnitConverter/seo.astro +14 -0
  39. package/src/tool/bloodUnitConverter/ui.ts +38 -0
  40. package/src/tool/bmiCalculator/bibliography.astro +14 -0
  41. package/src/tool/bmiCalculator/component.astro +415 -0
  42. package/src/tool/bmiCalculator/i18n/en.ts +217 -0
  43. package/src/tool/bmiCalculator/i18n/es.ts +221 -0
  44. package/src/tool/bmiCalculator/i18n/fr.ts +217 -0
  45. package/src/tool/bmiCalculator/index.ts +27 -0
  46. package/src/tool/bmiCalculator/seo.astro +14 -0
  47. package/src/tool/bmiCalculator/ui.ts +21 -0
  48. package/src/tool/breathingVisualizer/bibliography.astro +14 -0
  49. package/src/tool/breathingVisualizer/component.astro +636 -0
  50. package/src/tool/breathingVisualizer/i18n/en.ts +206 -0
  51. package/src/tool/breathingVisualizer/i18n/es.ts +206 -0
  52. package/src/tool/breathingVisualizer/i18n/fr.ts +206 -0
  53. package/src/tool/breathingVisualizer/index.ts +27 -0
  54. package/src/tool/breathingVisualizer/seo.astro +14 -0
  55. package/src/tool/breathingVisualizer/ui.ts +31 -0
  56. package/src/tool/caffeineTracker/bibliography.astro +14 -0
  57. package/src/tool/caffeineTracker/component.astro +1210 -0
  58. package/src/tool/caffeineTracker/i18n/en.ts +198 -0
  59. package/src/tool/caffeineTracker/i18n/es.ts +198 -0
  60. package/src/tool/caffeineTracker/i18n/fr.ts +198 -0
  61. package/src/tool/caffeineTracker/index.ts +27 -0
  62. package/src/tool/caffeineTracker/logic.ts +31 -0
  63. package/src/tool/caffeineTracker/seo.astro +14 -0
  64. package/src/tool/caffeineTracker/ui.ts +36 -0
  65. package/src/tool/daltonismSimulator/bibliography.astro +14 -0
  66. package/src/tool/daltonismSimulator/component.astro +383 -0
  67. package/src/tool/daltonismSimulator/i18n/en.ts +188 -0
  68. package/src/tool/daltonismSimulator/i18n/es.ts +218 -0
  69. package/src/tool/daltonismSimulator/i18n/fr.ts +168 -0
  70. package/src/tool/daltonismSimulator/index.ts +27 -0
  71. package/src/tool/daltonismSimulator/seo.astro +14 -0
  72. package/src/tool/daltonismSimulator/ui.ts +20 -0
  73. package/src/tool/digestionStopwatch/bibliography.astro +14 -0
  74. package/src/tool/digestionStopwatch/component.astro +627 -0
  75. package/src/tool/digestionStopwatch/i18n/en.ts +173 -0
  76. package/src/tool/digestionStopwatch/i18n/es.ts +173 -0
  77. package/src/tool/digestionStopwatch/i18n/fr.ts +173 -0
  78. package/src/tool/digestionStopwatch/index.ts +27 -0
  79. package/src/tool/digestionStopwatch/logic.ts +63 -0
  80. package/src/tool/digestionStopwatch/seo.astro +14 -0
  81. package/src/tool/digestionStopwatch/ui.ts +20 -0
  82. package/src/tool/epworthSleepinessScale/bibliography.astro +14 -0
  83. package/src/tool/epworthSleepinessScale/component.astro +528 -0
  84. package/src/tool/epworthSleepinessScale/i18n/en.ts +217 -0
  85. package/src/tool/epworthSleepinessScale/i18n/es.ts +217 -0
  86. package/src/tool/epworthSleepinessScale/i18n/fr.ts +217 -0
  87. package/src/tool/epworthSleepinessScale/index.ts +27 -0
  88. package/src/tool/epworthSleepinessScale/seo.astro +14 -0
  89. package/src/tool/epworthSleepinessScale/ui.ts +27 -0
  90. package/src/tool/hydrationCalculator/bibliography.astro +14 -0
  91. package/src/tool/hydrationCalculator/component.astro +694 -0
  92. package/src/tool/hydrationCalculator/i18n/en.ts +217 -0
  93. package/src/tool/hydrationCalculator/i18n/es.ts +222 -0
  94. package/src/tool/hydrationCalculator/i18n/fr.ts +199 -0
  95. package/src/tool/hydrationCalculator/index.ts +27 -0
  96. package/src/tool/hydrationCalculator/seo.astro +14 -0
  97. package/src/tool/hydrationCalculator/ui.ts +28 -0
  98. package/src/tool/pelliRobsonTest/bibliography.astro +14 -0
  99. package/src/tool/pelliRobsonTest/component.astro +653 -0
  100. package/src/tool/pelliRobsonTest/i18n/en.ts +205 -0
  101. package/src/tool/pelliRobsonTest/i18n/es.ts +205 -0
  102. package/src/tool/pelliRobsonTest/i18n/fr.ts +205 -0
  103. package/src/tool/pelliRobsonTest/index.ts +27 -0
  104. package/src/tool/pelliRobsonTest/seo.astro +14 -0
  105. package/src/tool/pelliRobsonTest/ui.ts +21 -0
  106. package/src/tool/peripheralVisionTrainer/bibliography.astro +14 -0
  107. package/src/tool/peripheralVisionTrainer/component.astro +678 -0
  108. package/src/tool/peripheralVisionTrainer/i18n/en.ts +224 -0
  109. package/src/tool/peripheralVisionTrainer/i18n/es.ts +224 -0
  110. package/src/tool/peripheralVisionTrainer/i18n/fr.ts +211 -0
  111. package/src/tool/peripheralVisionTrainer/index.ts +27 -0
  112. package/src/tool/peripheralVisionTrainer/seo.astro +14 -0
  113. package/src/tool/peripheralVisionTrainer/ui.ts +26 -0
  114. package/src/tool/readingDistanceCalculator/bibliography.astro +14 -0
  115. package/src/tool/readingDistanceCalculator/component.astro +588 -0
  116. package/src/tool/readingDistanceCalculator/i18n/en.ts +202 -0
  117. package/src/tool/readingDistanceCalculator/i18n/es.ts +215 -0
  118. package/src/tool/readingDistanceCalculator/i18n/fr.ts +193 -0
  119. package/src/tool/readingDistanceCalculator/index.ts +31 -0
  120. package/src/tool/readingDistanceCalculator/seo.astro +14 -0
  121. package/src/tool/readingDistanceCalculator/ui.ts +18 -0
  122. package/src/tool/screenDecompressionTime/bibliography.astro +14 -0
  123. package/src/tool/screenDecompressionTime/component.astro +671 -0
  124. package/src/tool/screenDecompressionTime/i18n/en.ts +225 -0
  125. package/src/tool/screenDecompressionTime/i18n/es.ts +247 -0
  126. package/src/tool/screenDecompressionTime/i18n/fr.ts +225 -0
  127. package/src/tool/screenDecompressionTime/index.ts +27 -0
  128. package/src/tool/screenDecompressionTime/seo.astro +14 -0
  129. package/src/tool/screenDecompressionTime/ui.ts +32 -0
  130. package/src/tool/tinnitusReliever/bibliography.astro +14 -0
  131. package/src/tool/tinnitusReliever/component.astro +581 -0
  132. package/src/tool/tinnitusReliever/i18n/en.ts +161 -0
  133. package/src/tool/tinnitusReliever/i18n/es.ts +161 -0
  134. package/src/tool/tinnitusReliever/i18n/fr.ts +161 -0
  135. package/src/tool/tinnitusReliever/index.ts +27 -0
  136. package/src/tool/tinnitusReliever/seo.astro +14 -0
  137. package/src/tool/tinnitusReliever/ui.ts +9 -0
  138. package/src/tool/ubeCalculator/bibliography.astro +14 -0
  139. package/src/tool/ubeCalculator/component.astro +683 -0
  140. package/src/tool/ubeCalculator/i18n/en.ts +200 -0
  141. package/src/tool/ubeCalculator/i18n/es.ts +200 -0
  142. package/src/tool/ubeCalculator/i18n/fr.ts +196 -0
  143. package/src/tool/ubeCalculator/index.ts +27 -0
  144. package/src/tool/ubeCalculator/seo.astro +14 -0
  145. package/src/tool/ubeCalculator/ui.ts +26 -0
  146. package/src/tool/waterPurifier/bibliography.astro +14 -0
  147. package/src/tool/waterPurifier/component.astro +628 -0
  148. package/src/tool/waterPurifier/i18n/en.ts +167 -0
  149. package/src/tool/waterPurifier/i18n/es.ts +167 -0
  150. package/src/tool/waterPurifier/i18n/fr.ts +167 -0
  151. package/src/tool/waterPurifier/index.ts +27 -0
  152. package/src/tool/waterPurifier/seo.astro +14 -0
  153. package/src/tool/waterPurifier/ui.ts +18 -0
  154. package/src/tools.ts +19 -0
  155. package/src/types.ts +72 -0
@@ -0,0 +1,200 @@
1
+ import type { WithContext, SoftwareApplication, FAQPage, HowToThing } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { UbeCalculatorUI } from '../ui';
4
+
5
+ const slug = 'standard-drink-unit-calculator';
6
+ const title = 'Standard Drink Unit Calculator';
7
+ const description =
8
+ 'Calculate the pure grams of alcohol and Standard Drink Units (SDU) of your cocktails, beer, wine and shots for safe and informed consumption.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: 'What exactly is a Standard Drink Unit?',
13
+ answer:
14
+ 'A Standard Drink Unit (SDU) is a metric measure used to quantify pure alcohol consumption. In Spain it represents exactly 10 grams of pure alcohol, regardless of the type of drink.',
15
+ },
16
+ {
17
+ question: 'What is the point of knowing the grams of alcohol I consume?',
18
+ answer:
19
+ 'Knowing the exact grams of pure ethanol you ingest allows you to evaluate the metabolic or driving risk you take in that session. Counting glasses is not enough — you need to count the real toxicological density.',
20
+ },
21
+ {
22
+ question: 'How many units are safe?',
23
+ answer:
24
+ 'The World Health Organization recommends not exceeding 2 units per day for healthy adult men, or 1 unit for women. Exceeding 4-6 units in a single session is classified as very high risk consumption.',
25
+ },
26
+ {
27
+ question: 'Why does a small shot have the same units as a beer?',
28
+ answer:
29
+ 'Because of the ABV percentage. Beer has only 5% ABV compared to 40% for spirits; the ethanol load compensates from one volumetric extreme to the other.',
30
+ },
31
+ {
32
+ question: 'Does the calculator work for specific brands of gin or rum?',
33
+ answer:
34
+ 'Yes. The calculation depends exclusively on the alcohol content (% ABV) shown on the product label and the volume you enter in ml.',
35
+ },
36
+ ];
37
+
38
+ const howToData = [
39
+ {
40
+ name: 'Identify the Drink',
41
+ text: 'Choose from the quick visual options such as draft beer, bottle, wine, cocktail or shot with standard hospitality volumes and ABV.',
42
+ },
43
+ {
44
+ name: 'Enter Custom Volume',
45
+ text: 'If you use a special glass or a large cup at home, enter the precise amount of drink served in ml and the alcohol content.',
46
+ },
47
+ {
48
+ name: 'Check the Alcohol Content',
49
+ text: 'Read the back label of your drink (5.0% ABV for lager beers, or 38-40% ABV for spirits) and enter it in the ABV field.',
50
+ },
51
+ {
52
+ name: 'Get the Results',
53
+ text: 'The tool will calculate the absolute grams of absorbed alcohol, the equivalent in Standard Units, and the health risk level.',
54
+ },
55
+ ];
56
+
57
+ const faqSchema: WithContext<FAQPage> = {
58
+ '@context': 'https://schema.org',
59
+ '@type': 'FAQPage',
60
+ mainEntity: faqData.map((item) => ({
61
+ '@type': 'Question',
62
+ name: item.question,
63
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
64
+ })),
65
+ };
66
+
67
+ const howToSchema: WithContext<HowToThing> = {
68
+ '@context': 'https://schema.org',
69
+ '@type': 'HowTo',
70
+ name: title,
71
+ description,
72
+ step: howToData.map((step, i) => ({
73
+ '@type': 'HowToStep',
74
+ position: i + 1,
75
+ name: step.name,
76
+ text: step.text,
77
+ })),
78
+ };
79
+
80
+ const appSchema: WithContext<SoftwareApplication> = {
81
+ '@context': 'https://schema.org',
82
+ '@type': 'SoftwareApplication',
83
+ name: title,
84
+ description,
85
+ applicationCategory: 'HealthApplication',
86
+ operatingSystem: 'Web',
87
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
88
+ };
89
+
90
+ export const content: ToolLocaleContent<UbeCalculatorUI> = {
91
+ slug,
92
+ title,
93
+ description,
94
+ faqTitle: 'Frequently asked questions about drink units and alcohol',
95
+ faq: faqData,
96
+ bibliographyTitle: 'Scientific references',
97
+ bibliography: [
98
+ {
99
+ name: 'World Health Organization - Alcohol impact and standard units',
100
+ url: 'https://www.who.int/es/news-room/fact-sheets/detail/alcohol',
101
+ },
102
+ {
103
+ name: 'Low-Risk Consumption Limits (Spanish Ministry of Health)',
104
+ url: 'https://www.sanidad.gob.es/areas/promocionPrevencion/alcohol/documentosTecnicos/docs/Limites_Consumo_Bajo_Riesgo_Alcohol_Actualizacion.pdf',
105
+ },
106
+ ],
107
+ howTo: howToData,
108
+ schemas: [faqSchema, howToSchema, appSchema],
109
+ ui: {
110
+ sectionAdd: 'Add Drink',
111
+ drinkCana: 'Draft',
112
+ drinkTercio: 'Bottle',
113
+ drinkVino: 'Wine',
114
+ drinkCopa: 'Cocktail',
115
+ drinkChupito: 'Shot',
116
+ labelVolume: 'Volume (ml)',
117
+ labelAbv: 'Alcohol Content (% ABV)',
118
+ btnAddCustom: 'Add Custom Drink',
119
+ customDrinkName: 'Custom',
120
+ sectionConsumed: 'Accumulated Consumption',
121
+ drinkSingular: 'drink',
122
+ drinkPlural: 'drinks',
123
+ emptyTitle: 'Your consumption list is empty',
124
+ emptyHint: 'Select drinks above or add manually',
125
+ resultLabel: 'Total Toxic Load',
126
+ ubesLabel: 'Units',
127
+ riskHeader: 'Epidemiological Risk',
128
+ riskNone: 'No Consumption',
129
+ riskLow: 'Low (Safe Consumption)',
130
+ riskMid: 'Moderate Risk',
131
+ riskHigh: 'High (Risky Consumption)',
132
+ riskMarkerZero: '0 units',
133
+ riskMarkerHigh: 'High Risk > 4 units',
134
+ },
135
+ seo: [
136
+ {
137
+ type: 'summary',
138
+ title: 'Standard Drink Unit Calculator',
139
+ items: [
140
+ '<strong>Exact formula</strong>: grams = Volume × (ABV/100) × 0.8 — real ethanol density.',
141
+ '<strong>5 preset drinks</strong>: draft beer, bottle, wine, cocktail and shot with standard values.',
142
+ '<strong>Risk meter</strong>: visual scale with 4 levels (no consumption, low, moderate, high).',
143
+ '<strong>Free input</strong>: enter any volume and ABV for custom drinks.',
144
+ ],
145
+ },
146
+ {
147
+ type: 'title',
148
+ text: 'Standard Drink Units (SDU): Concept and Mathematical Calculation',
149
+ level: 2,
150
+ },
151
+ {
152
+ type: 'paragraph',
153
+ html: 'The term <strong>Standard Drink Unit</strong> (SDU) is a standardised metric measure used in epidemiological studies and clinical practice to precisely quantify the amount of pure alcohol consumed. In Spain, one SDU is strictly defined as <strong>10 grams of pure alcohol</strong>. This system eliminates the confusion of talking about "glasses" or "cups" that vary in volume and ABV.',
154
+ },
155
+ {
156
+ type: 'paragraph',
157
+ html: 'By reducing any drink to the physical amount of ethanol grams absorbed, the SDU concept becomes the fundamental pillar for identifying risky drinkers, setting legal driving limits, and promoting responsible consumption.',
158
+ },
159
+ { type: 'title', text: 'Biophysical Formula for Calculating Grams of Alcohol', level: 2 },
160
+ {
161
+ type: 'paragraph',
162
+ html: 'Calculating the exact alcohol load does not only mean measuring the volume consumed. Two drinks with the same volumetric capacity can trigger very different hepatic responses if their ABV percentage differs.',
163
+ },
164
+ {
165
+ type: 'table',
166
+ headers: ['Physical Variable', 'Symbol', 'Measurement', 'Explanation'],
167
+ rows: [
168
+ ['<strong>Liquid Volume</strong>', 'V', 'Millilitres (ml)', 'Total amount of the drink served.'],
169
+ ['<strong>Alcohol Content</strong>', '% ABV', 'Ethanol percentage', 'Alcohol content by volume, shown on the product label.'],
170
+ ['<strong>Ethanol Density</strong>', 'ρ', '0.8 g/ml', 'Volumetric mass of alcohol compared to water.'],
171
+ ['<strong>Resulting Formula</strong>', 'g = V × (ABV/100) × 0.8', 'Grams (g)', 'Internationally accepted equation for converting served alcohol to ethanol mass.'],
172
+ ],
173
+ },
174
+ {
175
+ type: 'tip',
176
+ title: 'Measurement Tip',
177
+ html: 'Once the gram mass of alcohol is calculated, this value is divided by 10 to obtain the corresponding number of <strong>Standard Drink Units (SDU)</strong> consumed.',
178
+ },
179
+ { type: 'title', text: 'Standard Drink Patterns', level: 2 },
180
+ {
181
+ type: 'list',
182
+ items: [
183
+ '<strong>Draft beer (200ml, 5% ABV):</strong> Mathematically equivalent to 10 grams of alcohol = exactly 1 standard unit.',
184
+ '<strong>Wine (120ml, 12% ABV):</strong> Approximately 11.5 grams of ethanol, slightly more than 1 unit.',
185
+ '<strong>Spirit shot (40ml, 40% ABV):</strong> Despite its small size, it encapsulates high ethanol density: ~1.28 units.',
186
+ '<strong>Cocktail (50ml, 40% ABV):</strong> Always exceeds 1.6 units counting only the spirit, not the mixer.',
187
+ ],
188
+ },
189
+ { type: 'title', text: 'Risk Zones and Epidemiological Assessment', level: 2 },
190
+ {
191
+ type: 'paragraph',
192
+ html: '<strong>Low</strong> consumption means not exceeding 2 units per session, allowing the liver to metabolise ethanol correctly. <strong>High</strong> consumption profiles exceed 4-6 units in one session, subjecting the hepatic system to levels incompatible with proper cellular recovery.',
193
+ },
194
+ { type: 'title', text: 'The Large Format Paradox', level: 2 },
195
+ {
196
+ type: 'paragraph',
197
+ html: 'When bars increase container sizes (transforming small bottles into pints or large jugs), actual intake escalates without any change in the drinker\'s self-perception. Someone claiming to have "only two beers" in 500ml glasses is passively absorbing 4 to 5 standard units, triggering far more severe biochemical profiles than their perceived "two drinks".',
198
+ },
199
+ ],
200
+ };
@@ -0,0 +1,200 @@
1
+ import type { WithContext, SoftwareApplication, FAQPage, HowToThing } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { UbeCalculatorUI } from '../ui';
4
+
5
+ const slug = 'calculadora-ubes';
6
+ const title = 'Calculadora de Unidades de Bebida Estándar UBEs';
7
+ const description =
8
+ 'Calcula los gramos puros de alcohol y las Unidades de Bebida Estándar (UBE) de tus combinados, cerveza, vino y chupitos para un consumo seguro e informado.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: '¿Qué es exactamente una UBE?',
13
+ answer:
14
+ 'La Unidad de Bebida Estándar (UBE) es una medida métrica ideada para calcular el alcohol en España. Representa matemáticamente 10 gramos de alcohol puro, independientemente de la bebida que estés tomando.',
15
+ },
16
+ {
17
+ question: '¿Para qué sirve conocer los gramos de alcohol que consumo?',
18
+ answer:
19
+ 'Conocer los gramos exactos de etanol puro que ingieres permite evaluar el riesgo metabólico o de conducción que asumes en esa sesión. No basta con contar vasos, hay que contar la densidad toxicológica real.',
20
+ },
21
+ {
22
+ question: '¿Cuántas UBEs son recomendables o seguras?',
23
+ answer:
24
+ 'La Organización Mundial de la Salud recomienda no superar las 2 UBEs diarias en varones adultos sanos, o 1 UBE en mujeres. Superar las 4-6 UBEs en una sesión se clasifica como consumo de altísimo riesgo.',
25
+ },
26
+ {
27
+ question: '¿Por qué un chupito tan pequeño tiene las mismas UBEs que una caña?',
28
+ answer:
29
+ 'Por el grado volumétrico ABV. La cerveza tiene apenas un 5% de ABV frente al 40% del destilado; esto hace que la carga de etanol se compense de un extremo volumétrico al otro.',
30
+ },
31
+ {
32
+ question: '¿La calculadora funciona para marcas concretas de ginebra o ron?',
33
+ answer:
34
+ 'Sí. El cálculo depende exclusivamente del grado alcohólico (% ABV) indicado en la etiqueta del producto y del volumen que introduzcas en ml.',
35
+ },
36
+ ];
37
+
38
+ const howToData = [
39
+ {
40
+ name: 'Identifica la Bebida',
41
+ text: 'Selecciona entre las opciones visuales rápidas como cañas, tercios, vino o chupitos, para las cantidades y graduaciones de la hostelería nacional más frecuente.',
42
+ },
43
+ {
44
+ name: 'Introduce Volumen Personalizado',
45
+ text: 'Si utilizas un vaso especial o una copa grande en casa, introduce la cantidad precisa de bebida servida en ml y el grado alcohólico.',
46
+ },
47
+ {
48
+ name: 'Verifica el Grado Alcohólico',
49
+ text: 'Lee la etiqueta trasera de tu bebida (5.0% ABV para cervezas lager, o 38-40% ABV para licores) e introdúcelo en el campo de graduación.',
50
+ },
51
+ {
52
+ name: 'Obtén los Resultados',
53
+ text: 'La herramienta calculará los gramos absolutos de alcohol asimilado, la equivalencia en UBEs y el nivel de riesgo para la salud.',
54
+ },
55
+ ];
56
+
57
+ const faqSchema: WithContext<FAQPage> = {
58
+ '@context': 'https://schema.org',
59
+ '@type': 'FAQPage',
60
+ mainEntity: faqData.map((item) => ({
61
+ '@type': 'Question',
62
+ name: item.question,
63
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
64
+ })),
65
+ };
66
+
67
+ const howToSchema: WithContext<HowToThing> = {
68
+ '@context': 'https://schema.org',
69
+ '@type': 'HowTo',
70
+ name: title,
71
+ description,
72
+ step: howToData.map((step, i) => ({
73
+ '@type': 'HowToStep',
74
+ position: i + 1,
75
+ name: step.name,
76
+ text: step.text,
77
+ })),
78
+ };
79
+
80
+ const appSchema: WithContext<SoftwareApplication> = {
81
+ '@context': 'https://schema.org',
82
+ '@type': 'SoftwareApplication',
83
+ name: title,
84
+ description,
85
+ applicationCategory: 'HealthApplication',
86
+ operatingSystem: 'Web',
87
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
88
+ };
89
+
90
+ export const content: ToolLocaleContent<UbeCalculatorUI> = {
91
+ slug,
92
+ title,
93
+ description,
94
+ faqTitle: 'Preguntas frecuentes sobre UBEs y alcohol',
95
+ faq: faqData,
96
+ bibliographyTitle: 'Referencias científicas',
97
+ bibliography: [
98
+ {
99
+ name: 'Organización Mundial de la Salud - Impacto del Alcohol y las UBE',
100
+ url: 'https://www.who.int/es/news-room/fact-sheets/detail/alcohol',
101
+ },
102
+ {
103
+ name: 'Límites del Consumo de Bajo Riesgo (Ministerio de Sanidad de España)',
104
+ url: 'https://www.sanidad.gob.es/areas/promocionPrevencion/alcohol/documentosTecnicos/docs/Limites_Consumo_Bajo_Riesgo_Alcohol_Actualizacion.pdf',
105
+ },
106
+ ],
107
+ howTo: howToData,
108
+ schemas: [faqSchema, howToSchema, appSchema],
109
+ ui: {
110
+ sectionAdd: 'Añadir Bebida',
111
+ drinkCana: 'Caña',
112
+ drinkTercio: 'Tercio',
113
+ drinkVino: 'Vino',
114
+ drinkCopa: 'Copa',
115
+ drinkChupito: 'Chupito',
116
+ labelVolume: 'Volumen (ml)',
117
+ labelAbv: 'Graduación (% ABV)',
118
+ btnAddCustom: 'Añadir Bebida Manual',
119
+ customDrinkName: 'Personalizada',
120
+ sectionConsumed: 'Consumo Acumulado',
121
+ drinkSingular: 'bebida',
122
+ drinkPlural: 'bebidas',
123
+ emptyTitle: 'Tu lista de consumo está vacía',
124
+ emptyHint: 'Selecciona bebidas arriba o añade manualmente',
125
+ resultLabel: 'Carga Tóxica Absoluta',
126
+ ubesLabel: 'UBEs',
127
+ riskHeader: 'Riesgo Epidemiológico',
128
+ riskNone: 'Sin Consumo',
129
+ riskLow: 'Bajo (Consumo Seguro)',
130
+ riskMid: 'Tránsito (Riesgo Moderado)',
131
+ riskHigh: 'Alto (Consumo de Riesgo)',
132
+ riskMarkerZero: '0 UBEs',
133
+ riskMarkerHigh: 'Riesgo Alto > 4 UBEs',
134
+ },
135
+ seo: [
136
+ {
137
+ type: 'summary',
138
+ title: 'Calculadora de UBEs',
139
+ items: [
140
+ '<strong>Fórmula exacta</strong>: gramos = Volumen × (ABV/100) × 0.8 — densidad real del etanol.',
141
+ '<strong>5 bebidas preestablecidas</strong>: caña, tercio, vino, copa y chupito con valores hostelería nacional.',
142
+ '<strong>Medidor de riesgo</strong>: escala visual con 4 niveles (sin consumo, bajo, moderado, alto).',
143
+ '<strong>Entrada libre</strong>: introduce cualquier volumen y graduación para bebidas personalizadas.',
144
+ ],
145
+ },
146
+ {
147
+ type: 'title',
148
+ text: 'Unidades de Bebida Estándar (UBE): Concepto y Cálculo Matemático',
149
+ level: 2,
150
+ },
151
+ {
152
+ type: 'paragraph',
153
+ html: 'El término <strong>Unidad de Bebida Estándar</strong> (UBE) es una medida métrica y estandarizada utilizada en estudios epidemiológicos y práctica clínica para cuantificar exactamente la cantidad de alcohol puro consumida. En España, una UBE se define estrictamente como <strong>10 gramos de alcohol puro</strong>. Este sistema elimina la confusión de hablar de "vasos" o "copas" que varían en volumen y graduación.',
154
+ },
155
+ {
156
+ type: 'paragraph',
157
+ html: 'Al reducir cualquier bebida a la cantidad física de gramos de etanol absorbidos, el concepto de UBE se transforma en el pilar fundamental para detectar el bebedor de riesgo, establecer límites legales de conducción y prescribir tratamientos hepáticos.',
158
+ },
159
+ { type: 'title', text: 'Fórmula Biofísica para el Cálculo de Gramos de Alcohol', level: 2 },
160
+ {
161
+ type: 'paragraph',
162
+ html: 'Calcular el alcohol exacto no implica medir únicamente el volumen ingerido. Dos bebidas con la misma capacidad volumétrica pueden desencadenar respuestas hepáticas muy diferentes si su porcentaje de ABV difiere.',
163
+ },
164
+ {
165
+ type: 'table',
166
+ headers: ['Variable Física', 'Símbolo', 'Medición', 'Explicación'],
167
+ rows: [
168
+ ['<strong>Volumen de Líquido</strong>', 'V', 'Mililitros (ml)', 'Cantidad total del líquido servido.'],
169
+ ['<strong>Graduación Alcohólica</strong>', '% ABV', 'Porcentaje de etanol', 'Contenido de alcohol en volumen, indicado en la etiqueta.'],
170
+ ['<strong>Densidad del Etanol</strong>', 'ρ', '0.8 g/ml', 'Masa volumétrica del alcohol respecto al agua.'],
171
+ ['<strong>Fórmula Resultante</strong>', 'g = V × (ABV/100) × 0.8', 'Gramos (g)', 'Ecuación internacional para la conversión a masa de etanol.'],
172
+ ],
173
+ },
174
+ {
175
+ type: 'tip',
176
+ title: 'Consejo de Medición',
177
+ html: 'Una vez calculada la masa en gramos de alcohol, este valor se divide entre 10 para obtener el número de <strong>Unidades de Bebida Estándar (UBE)</strong> consumidas.',
178
+ },
179
+ { type: 'title', text: 'Patrones de Bebidas Estándar en España', level: 2 },
180
+ {
181
+ type: 'list',
182
+ items: [
183
+ '<strong>Caña (200ml, 5% ABV):</strong> Equivale matemáticamente a 10 gramos de alcohol = 1 UBE exacta. La base cultural por excelencia.',
184
+ '<strong>Vino (120ml, 12% ABV):</strong> Aproximadamente 11.5 gramos de etanol, algo más de 1 UBE.',
185
+ '<strong>Chupito de licor (40ml, 40% ABV):</strong> Pese a su reducido tamaño, encapsula alta densidad de etanol: ~1.28 UBEs.',
186
+ '<strong>Copa o combinado (50ml, 40% ABV):</strong> Siempre supera las 1.6 UBEs si consideramos solo el licor, sin contar el mezclador.',
187
+ ],
188
+ },
189
+ { type: 'title', text: 'Zonas de Riesgo y Evaluación Epidemiológica', level: 2 },
190
+ {
191
+ type: 'paragraph',
192
+ html: 'Un consumo <strong>Bajo</strong> implica no superar 2 UBEs por sesión, permitiendo al hígado metabolizar el etanol correctamente. Los perfiles de consumo <strong>Alto</strong> superan las 4-6 UBEs en una sesión, sometiendo el sistema hepático a niveles inasumibles para la recuperación celular.',
193
+ },
194
+ { type: 'title', text: 'La Paradoja de los Formatos Grandes', level: 2 },
195
+ {
196
+ type: 'paragraph',
197
+ html: 'Cuando los bares incrementan el tamaño de los recipientes (transformando botellínes en pintas o jarras), la ingesta real escala sin que cambie la autopercepción del hábito. Quien asegura tomar "apenas dos cervezas" en vasos de 500ml está asimilando pasivamente 4 a 5 UBEs, desencadenando perfiles bioquímicos mucho más severos que la percepción de las dos "consumiciones".',
198
+ },
199
+ ],
200
+ };
@@ -0,0 +1,196 @@
1
+ import type { WithContext, SoftwareApplication, FAQPage, HowToThing } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { UbeCalculatorUI } from '../ui';
4
+
5
+ const slug = 'calculateur-unites-boisson-standard';
6
+ const title = "Calculateur d'Unités de Boisson Standard";
7
+ const description =
8
+ "Calculez les grammes purs d'alcool et les Unités de Boisson Standard (UBS) de vos cocktails, bières, vins et shots pour une consommation sûre et éclairée.";
9
+
10
+ const faqData = [
11
+ {
12
+ question: "Qu'est-ce exactement qu'une Unité de Boisson Standard?",
13
+ answer:
14
+ "Une Unité de Boisson Standard (UBS) est une mesure métrique utilisée pour quantifier la consommation d'alcool pur. En Espagne, elle représente exactement 10 grammes d'alcool pur, quelle que soit la boisson consommée.",
15
+ },
16
+ {
17
+ question: "À quoi sert de connaître les grammes d'alcool consommés?",
18
+ answer:
19
+ "Connaître les grammes exacts d'éthanol pur ingérés permet d'évaluer le risque métabolique ou de conduite. Compter les verres ne suffit pas — il faut compter la densité toxicologique réelle.",
20
+ },
21
+ {
22
+ question: 'Combien d\'unités sont recommandées ou sûres?',
23
+ answer:
24
+ "L'Organisation Mondiale de la Santé recommande de ne pas dépasser 2 unités par jour pour les hommes adultes en bonne santé, ou 1 unité pour les femmes. Dépasser 4 à 6 unités en une seule session est classifié comme une consommation à très haut risque.",
25
+ },
26
+ {
27
+ question: 'Pourquoi un petit shot a-t-il les mêmes unités qu\'une bière?',
28
+ answer:
29
+ "À cause du pourcentage ABV. La bière n'a que 5% d'ABV contre 40% pour les spiritueux; la charge en éthanol se compense d'un extrême volumétrique à l'autre.",
30
+ },
31
+ {
32
+ question: 'Le calculateur fonctionne-t-il pour des marques spécifiques de gin ou de rhum?',
33
+ answer:
34
+ "Oui. Le calcul dépend exclusivement de la teneur en alcool (% ABV) indiquée sur l'étiquette du produit et du volume que vous saisissez en ml.",
35
+ },
36
+ ];
37
+
38
+ const howToData = [
39
+ {
40
+ name: 'Identifiez la Boisson',
41
+ text: "Choisissez parmi les options visuelles rapides comme la bière pression, la bouteille, le vin, le cocktail ou le shot avec les volumes et ABV standards.",
42
+ },
43
+ {
44
+ name: 'Entrez un Volume Personnalisé',
45
+ text: 'Si vous utilisez un verre spécial ou une grande coupe à la maison, saisissez la quantité précise de boisson servie en ml et la teneur en alcool.',
46
+ },
47
+ {
48
+ name: "Vérifiez la Teneur en Alcool",
49
+ text: "Lisez l'étiquette arrière de votre boisson (5.0% ABV pour les bières lager, ou 38-40% ABV pour les spiritueux) et saisissez-la dans le champ ABV.",
50
+ },
51
+ {
52
+ name: 'Obtenez les Résultats',
53
+ text: "L'outil calculera les grammes absolus d'alcool absorbé, l'équivalent en Unités Standard et le niveau de risque pour la santé.",
54
+ },
55
+ ];
56
+
57
+ const faqSchema: WithContext<FAQPage> = {
58
+ '@context': 'https://schema.org',
59
+ '@type': 'FAQPage',
60
+ mainEntity: faqData.map((item) => ({
61
+ '@type': 'Question',
62
+ name: item.question,
63
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
64
+ })),
65
+ };
66
+
67
+ const howToSchema: WithContext<HowToThing> = {
68
+ '@context': 'https://schema.org',
69
+ '@type': 'HowTo',
70
+ name: title,
71
+ description,
72
+ step: howToData.map((step, i) => ({
73
+ '@type': 'HowToStep',
74
+ position: i + 1,
75
+ name: step.name,
76
+ text: step.text,
77
+ })),
78
+ };
79
+
80
+ const appSchema: WithContext<SoftwareApplication> = {
81
+ '@context': 'https://schema.org',
82
+ '@type': 'SoftwareApplication',
83
+ name: title,
84
+ description,
85
+ applicationCategory: 'HealthApplication',
86
+ operatingSystem: 'Web',
87
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
88
+ };
89
+
90
+ export const content: ToolLocaleContent<UbeCalculatorUI> = {
91
+ slug,
92
+ title,
93
+ description,
94
+ faqTitle: "Questions fréquentes sur les unités de boisson et l'alcool",
95
+ faq: faqData,
96
+ bibliographyTitle: 'Références scientifiques',
97
+ bibliography: [
98
+ {
99
+ name: "Organisation Mondiale de la Santé - Impact de l'alcool",
100
+ url: 'https://www.who.int/es/news-room/fact-sheets/detail/alcohol',
101
+ },
102
+ {
103
+ name: "Limites de consommation à faible risque (Ministère de la Santé d'Espagne)",
104
+ url: 'https://www.sanidad.gob.es/areas/promocionPrevencion/alcohol/documentosTecnicos/docs/Limites_Consumo_Bajo_Riesgo_Alcohol_Actualizacion.pdf',
105
+ },
106
+ ],
107
+ howTo: howToData,
108
+ schemas: [faqSchema, howToSchema, appSchema],
109
+ ui: {
110
+ sectionAdd: 'Ajouter une Boisson',
111
+ drinkCana: 'Bière Pression',
112
+ drinkTercio: 'Bouteille',
113
+ drinkVino: 'Vin',
114
+ drinkCopa: 'Cocktail',
115
+ drinkChupito: 'Shot',
116
+ labelVolume: 'Volume (ml)',
117
+ labelAbv: 'Teneur en Alcool (% ABV)',
118
+ btnAddCustom: 'Ajouter une Boisson',
119
+ customDrinkName: 'Personnalisée',
120
+ sectionConsumed: 'Consommation Accumulée',
121
+ drinkSingular: 'boisson',
122
+ drinkPlural: 'boissons',
123
+ emptyTitle: 'Votre liste de consommation est vide',
124
+ emptyHint: 'Sélectionnez des boissons ci-dessus ou ajoutez manuellement',
125
+ resultLabel: 'Charge Toxique Totale',
126
+ ubesLabel: 'Unités',
127
+ riskHeader: 'Risque Épidémiologique',
128
+ riskNone: 'Aucune Consommation',
129
+ riskLow: 'Faible (Consommation Sûre)',
130
+ riskMid: 'Risque Modéré',
131
+ riskHigh: 'Élevé (Consommation à Risque)',
132
+ riskMarkerZero: '0 unités',
133
+ riskMarkerHigh: 'Risque Élevé > 4 unités',
134
+ },
135
+ seo: [
136
+ {
137
+ type: 'summary',
138
+ title: 'Calculateur UBS',
139
+ items: [
140
+ "<strong>Formule exacte</strong>: grammes = Volume × (ABV/100) × 0,8 — densité réelle de l'éthanol.",
141
+ '<strong>5 boissons préréglées</strong>: bière pression, bouteille, vin, cocktail et shot.',
142
+ '<strong>Indicateur de risque</strong>: échelle visuelle à 4 niveaux (sans consommation, faible, modéré, élevé).',
143
+ '<strong>Saisie libre</strong>: entrez tout volume et ABV pour des boissons personnalisées.',
144
+ ],
145
+ },
146
+ {
147
+ type: 'title',
148
+ text: "Unités de Boisson Standard (UBS): Concept et Calcul Mathématique",
149
+ level: 2,
150
+ },
151
+ {
152
+ type: 'paragraph',
153
+ html: "Le terme <strong>Unité de Boisson Standard</strong> (UBS) est une mesure métrique standardisée utilisée dans les études épidémiologiques et la pratique clinique pour quantifier précisément la quantité d'alcool pur consommée. En Espagne, une UBS est strictement définie comme <strong>10 grammes d'alcool pur</strong>. Ce système élimine la confusion liée aux \"verres\" ou \"coupes\" qui varient en volume et en ABV.",
154
+ },
155
+ {
156
+ type: 'paragraph',
157
+ html: "En réduisant toute boisson à la quantité physique de grammes d'éthanol absorbés, le concept d'UBS devient le pilier fondamental pour identifier les buveurs à risque, fixer les limites légales de conduite et promouvoir une consommation responsable.",
158
+ },
159
+ { type: 'title', text: "Formule Biophysique pour le Calcul des Grammes d'Alcool", level: 2 },
160
+ {
161
+ type: 'table',
162
+ headers: ['Variable Physique', 'Symbole', 'Mesure', 'Explication'],
163
+ rows: [
164
+ ['<strong>Volume du Liquide</strong>', 'V', 'Millilitres (ml)', 'Quantité totale de boisson servie.'],
165
+ ["<strong>Teneur en Alcool</strong>", '% ABV', "Pourcentage d'éthanol", "Teneur en alcool par volume, indiquée sur l'étiquette."],
166
+ ["<strong>Densité de l'Éthanol</strong>", 'ρ', '0,8 g/ml', "Masse volumique de l'alcool par rapport à l'eau."],
167
+ ['<strong>Formule Résultante</strong>', 'g = V × (ABV/100) × 0,8', 'Grammes (g)', "Équation internationale pour la conversion en masse d'éthanol."],
168
+ ],
169
+ },
170
+ {
171
+ type: 'tip',
172
+ title: 'Conseil de Mesure',
173
+ html: "Une fois la masse en grammes d'alcool calculée, cette valeur est divisée par 10 pour obtenir le nombre d'<strong>Unités de Boisson Standard (UBS)</strong> consommées.",
174
+ },
175
+ { type: 'title', text: 'Équivalences des Boissons Standard', level: 2 },
176
+ {
177
+ type: 'list',
178
+ items: [
179
+ "<strong>Bière pression (200ml, 5% ABV):</strong> Équivaut mathématiquement à 10 grammes d'alcool = exactement 1 unité standard.",
180
+ "<strong>Vin (120ml, 12% ABV):</strong> Environ 11,5 grammes d'éthanol, légèrement plus d'1 unité.",
181
+ "<strong>Shot de spiritueux (40ml, 40% ABV):</strong> Malgré sa petite taille, encapsule une haute densité d'éthanol: ~1,28 unités.",
182
+ "<strong>Cocktail (50ml, 40% ABV):</strong> Dépasse toujours 1,6 unité en comptant uniquement le spiritueux.",
183
+ ],
184
+ },
185
+ { type: 'title', text: "Zones de Risque et Évaluation Épidémiologique", level: 2 },
186
+ {
187
+ type: 'paragraph',
188
+ html: "Une consommation <strong>Faible</strong> implique de ne pas dépasser 2 unités par session, permettant au foie de métaboliser correctement l'éthanol. Les profils de consommation <strong>Élevée</strong> dépassent 4 à 6 unités en une session, soumettant le système hépatique à des niveaux incompatibles avec une récupération cellulaire correcte.",
189
+ },
190
+ { type: 'title', text: 'Le Paradoxe des Grands Formats', level: 2 },
191
+ {
192
+ type: 'paragraph',
193
+ html: "Lorsque les bars augmentent la taille des contenants (transformant les petites bouteilles en pintes ou grandes chopes), la consommation réelle augmente sans que la perception du buveur ne change. Quelqu'un affirmant prendre \"seulement deux bières\" dans des verres de 500ml absorbe passivement 4 à 5 unités standard, déclenchant des profils biochimiques bien plus graves que la perception de ses deux \"consommations\".",
194
+ },
195
+ ],
196
+ };
@@ -0,0 +1,27 @@
1
+ import type { HealthToolEntry, ToolDefinition } from '../../types';
2
+ import UbeCalculatorComponent from './component.astro';
3
+ import UbeCalculatorSEO from './seo.astro';
4
+ import UbeCalculatorBibliography from './bibliography.astro';
5
+ import type { UbeCalculatorUI } from './ui';
6
+
7
+ export const ubeCalculator: HealthToolEntry<UbeCalculatorUI> = {
8
+ id: 'ubeCalculator',
9
+ icons: {
10
+ bg: 'mdi:cup-outline',
11
+ fg: 'mdi:beer-outline',
12
+ },
13
+ i18n: {
14
+ es: () => import('./i18n/es').then((m) => m.content),
15
+ en: () => import('./i18n/en').then((m) => m.content),
16
+ fr: () => import('./i18n/fr').then((m) => m.content),
17
+ },
18
+ };
19
+
20
+ export { UbeCalculatorComponent, UbeCalculatorSEO, UbeCalculatorBibliography };
21
+
22
+ export const UBE_CALCULATOR_TOOL: ToolDefinition = {
23
+ entry: ubeCalculator,
24
+ Component: UbeCalculatorComponent,
25
+ SEOComponent: UbeCalculatorSEO,
26
+ BibliographyComponent: UbeCalculatorBibliography,
27
+ };
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { SEORenderer } from '@jjlmoya/utils-shared';
3
+ import { ubeCalculator } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await ubeCalculator.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SEORenderer content={{ locale, sections: content.seo }} />}
@@ -0,0 +1,26 @@
1
+ export interface UbeCalculatorUI extends Record<string, string> {
2
+ sectionAdd: string;
3
+ drinkCana: string;
4
+ drinkTercio: string;
5
+ drinkVino: string;
6
+ drinkCopa: string;
7
+ drinkChupito: string;
8
+ labelVolume: string;
9
+ labelAbv: string;
10
+ btnAddCustom: string;
11
+ customDrinkName: string;
12
+ sectionConsumed: string;
13
+ drinkSingular: string;
14
+ drinkPlural: string;
15
+ emptyTitle: string;
16
+ emptyHint: string;
17
+ resultLabel: string;
18
+ ubesLabel: string;
19
+ riskHeader: string;
20
+ riskNone: string;
21
+ riskLow: string;
22
+ riskMid: string;
23
+ riskHigh: string;
24
+ riskMarkerZero: string;
25
+ riskMarkerHigh: string;
26
+ }