@jjlmoya/utils-alcohol 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 (62) hide show
  1. package/package.json +60 -0
  2. package/src/category/i18n/en.ts +19 -0
  3. package/src/category/i18n/es.ts +28 -0
  4. package/src/category/i18n/fr.ts +19 -0
  5. package/src/category/index.ts +12 -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 +19 -0
  12. package/src/layouts/PreviewLayout.astro +117 -0
  13. package/src/pages/[locale]/[slug].astro +155 -0
  14. package/src/pages/[locale].astro +271 -0
  15. package/src/pages/index.astro +4 -0
  16. package/src/tests/content_mandatory.test.ts +32 -0
  17. package/src/tests/faq_count.test.ts +17 -0
  18. package/src/tests/mocks/astro_mock.js +2 -0
  19. package/src/tests/seo_length.test.ts +39 -0
  20. package/src/tests/tool_validation.test.ts +17 -0
  21. package/src/tool/alcoholClearance/component.astro +219 -0
  22. package/src/tool/alcoholClearance/component.css +369 -0
  23. package/src/tool/alcoholClearance/i18n/en.ts +172 -0
  24. package/src/tool/alcoholClearance/i18n/es.ts +181 -0
  25. package/src/tool/alcoholClearance/i18n/fr.ts +163 -0
  26. package/src/tool/alcoholClearance/index.ts +50 -0
  27. package/src/tool/alcoholClearance/logic.ts +59 -0
  28. package/src/tool/beerCooler/component.astro +236 -0
  29. package/src/tool/beerCooler/component.css +381 -0
  30. package/src/tool/beerCooler/i18n/en.ts +168 -0
  31. package/src/tool/beerCooler/i18n/es.ts +181 -0
  32. package/src/tool/beerCooler/i18n/fr.ts +168 -0
  33. package/src/tool/beerCooler/index.ts +49 -0
  34. package/src/tool/beerCooler/logic.ts +34 -0
  35. package/src/tool/carbonationCalculator/component.astro +225 -0
  36. package/src/tool/carbonationCalculator/component.css +483 -0
  37. package/src/tool/carbonationCalculator/i18n/en.ts +175 -0
  38. package/src/tool/carbonationCalculator/i18n/es.ts +179 -0
  39. package/src/tool/carbonationCalculator/i18n/fr.ts +175 -0
  40. package/src/tool/carbonationCalculator/index.ts +48 -0
  41. package/src/tool/carbonationCalculator/logic.ts +40 -0
  42. package/src/tool/cocktailBalancer/bibliography.astro +14 -0
  43. package/src/tool/cocktailBalancer/component.astro +396 -0
  44. package/src/tool/cocktailBalancer/component.css +1218 -0
  45. package/src/tool/cocktailBalancer/data/IngredientRepository.ts +83 -0
  46. package/src/tool/cocktailBalancer/data/Presets.ts +122 -0
  47. package/src/tool/cocktailBalancer/domain/Ingredient.ts +29 -0
  48. package/src/tool/cocktailBalancer/i18n/en.ts +193 -0
  49. package/src/tool/cocktailBalancer/i18n/es.ts +193 -0
  50. package/src/tool/cocktailBalancer/i18n/fr.ts +193 -0
  51. package/src/tool/cocktailBalancer/index.ts +68 -0
  52. package/src/tool/cocktailBalancer/logic.ts +118 -0
  53. package/src/tool/cocktailBalancer/seo.astro +53 -0
  54. package/src/tool/partyKeg/component.astro +269 -0
  55. package/src/tool/partyKeg/component.css +660 -0
  56. package/src/tool/partyKeg/i18n/en.ts +162 -0
  57. package/src/tool/partyKeg/i18n/es.ts +166 -0
  58. package/src/tool/partyKeg/i18n/fr.ts +162 -0
  59. package/src/tool/partyKeg/index.ts +46 -0
  60. package/src/tool/partyKeg/logic.ts +36 -0
  61. package/src/tools.ts +14 -0
  62. package/src/types.ts +72 -0
@@ -0,0 +1,162 @@
1
+ import type { WithContext, SoftwareApplication } from 'schema-dts';
2
+ import type { PartyKegUI, PartyKegLocaleContent } from '../index';
3
+
4
+ const slug = 'party-stock-calculator';
5
+ const title = 'Party Beer & Ice Calculator';
6
+ const description = 'Calculate how much alcohol and how many bags of ice you need for your party based on guests, duration and temperature.';
7
+
8
+ const ui: PartyKegUI = {
9
+ calcStockTitle: 'Stock Calculator',
10
+ beerIceSub: 'Beer & Ice for Events',
11
+ guestsLabel: 'Guests',
12
+ durationLabel: 'Duration',
13
+ hoursUnit: 'Hours',
14
+ intensityLabel: 'Intensity',
15
+ chillLabel: 'Chill',
16
+ standardLabel: 'Standard',
17
+ partyLabel: 'Party',
18
+ tempLabel: 'Temperature',
19
+ estimatedVolLabel: 'Estimated Volume',
20
+ kegsLabel: 'Kegs',
21
+ iceRequiredLabel: 'Ice Required',
22
+ bagsLabel: 'Bags',
23
+ visualizationTitle: 'Stock Visualization',
24
+ optimalMsg: 'Optimal Conditions',
25
+ highMeltMsg: 'High Melt Detected',
26
+ highEfficiencyMsg: 'Cold / High Efficiency'
27
+ };
28
+
29
+ const faqTitle = 'Frequently Asked Questions';
30
+ const bibliographyTitle = 'Bibliography & Sources';
31
+
32
+ const faq: PartyKegLocaleContent['faq'] = [
33
+ {
34
+ question: "How many beers does a person drink in 4 hours?",
35
+ answer: "On average, calculate 5 beers per person for a 4-hour event. This assumes 2 drinks the first hour and 1 for each remaining hour.",
36
+ },
37
+ {
38
+ question: "How much ice do I need for 100 beers?",
39
+ answer: "You will need approximately 15-20 kilos of ice (7-10 bags). The general rule is 1kg of ice for every liter of drink if it's hot (>25°C).",
40
+ },
41
+ {
42
+ question: "What is the difference between a standard keg and a party keg?",
43
+ answer: "A standard commercial keg holds 50 liters, which yields approximately 200 servings (250ml each). A party keg (mini-keg) typically holds 5 liters — about 20 servings. Knowing these sizes helps you translate the calculator's liter output into the number of containers to purchase.",
44
+ },
45
+ ];
46
+
47
+ const howTo: PartyKegLocaleContent['howTo'] = [
48
+ {
49
+ name: "Estimate the number of guests",
50
+ text: "Define how many people will attend. Our calculator adjusts the quantities based on statistical consumption averages.",
51
+ },
52
+ {
53
+ name: "Define duration and intensity",
54
+ text: "Indicate how many hours the event will last and the 'flow' of the party (chill, standard, or intense).",
55
+ },
56
+ {
57
+ name: "Adjust for ambient temperature",
58
+ text: "Outdoor temperature is key for ice calculation. The hotter it is, the higher the melt rate we must compensate for.",
59
+ },
60
+ ];
61
+
62
+ const bibliography: PartyKegLocaleContent['bibliography'] = [
63
+ {
64
+ name: "Event Planning: Alcohol & Bar Calculations - Spruce Eats",
65
+ url: "https://www.thespruceeats.com/how-much-alcohol-for-a-party-1191060",
66
+ },
67
+ {
68
+ name: "Thermodynamics of Ice Melting - Engineering Toolbox",
69
+ url: "https://www.engineeringtoolbox.com/ice-thermal-properties-d_156.html",
70
+ },
71
+ ];
72
+
73
+ const seo: PartyKegLocaleContent['seo'] = [
74
+ {
75
+ type: 'title',
76
+ text: 'How Much Beer and Ice do I need for my Party?',
77
+ level: 2
78
+ },
79
+ {
80
+ type: 'paragraph',
81
+ html: 'The million-dollar question when organizing any event: <strong>How many liters of beer should I buy?</strong> Running short is a disaster, but overbuying is an unnecessary expense. This tool helps you calculate the exact amount of alcohol and, most importantly, <strong>how many bags of ice</strong> you need to keep it cold. Professional caterers and event planners use statistical consumption models — and now you can too, for free.'
82
+ },
83
+ {
84
+ type: 'title',
85
+ text: 'The Consumption Formula by Person',
86
+ level: 2
87
+ },
88
+ {
89
+ type: 'paragraph',
90
+ html: 'To estimate the alcohol needed, professional caterers use a formula based on the "Hourly Consumption Rate". It is not an exact science, but statistics show that at a standard party, approximately 1.5 units are consumed per hour per person. Factors like ambient temperature, food availability, and the social energy of the event all shift this baseline number.'
91
+ },
92
+ {
93
+ type: 'stats',
94
+ items: [
95
+ { label: 'Chill Consumption', value: '1 drink/hour', icon: 'mdi:tea-outline' },
96
+ { label: 'Standard Party', value: '1.5 drinks/hour', icon: 'mdi:glass-mug-variant' },
97
+ { label: 'Wedding / Festival', value: '2.5+ drinks/hour', icon: 'mdi:fire' }
98
+ ],
99
+ columns: 3
100
+ },
101
+ {
102
+ type: 'diagnostic',
103
+ title: 'The Physics of Ice',
104
+ icon: 'mdi:snowflake-thermometer',
105
+ variant: 'warning',
106
+ badge: 'Thermodynamics',
107
+ html: 'Calculating ice is where most hosts fail. Ice serves two functions: Cooling (bringing beer from 25°C to 4°C) and Maintaining (fighting ambient heat). At temperatures above 30°C, the melt rate doubles. A full bag of ice in direct sun can be gone in under 20 minutes, leaving your beverages warm before the party peaks.'
108
+ },
109
+ {
110
+ type: 'tip',
111
+ title: 'Professional Tip to Save Ice',
112
+ html: 'Keep kegs and cans in the shade before adding ice. If drinks are warm in the sun, the first 50% of your ice bag will die within 10 minutes simply exchanging latent heat. Start with pre-chilled beverages to dramatically reduce how much ice you actually need to buy.'
113
+ },
114
+ {
115
+ type: 'title',
116
+ text: 'Reference Data for Logistics',
117
+ level: 2
118
+ },
119
+ {
120
+ type: 'paragraph',
121
+ html: 'A standard 50L keg yields around 200 servings. A typical bag of ice weighs 2kg. Knowing these figures, you can plan the transport and storage needed for your event without last-minute surprises. Account for ice melt during transport — a 30-minute drive in summer can cost you one full bag before the party even starts.'
122
+ },
123
+ {
124
+ type: 'summary',
125
+ title: 'Who is this tool for?',
126
+ items: [
127
+ 'Private Party Hosts: Stop guessing and confidently buy exactly what you need for your next celebration.',
128
+ 'Event Planners: Use accurate consumption models to quote clients and plan bar logistics professionally.',
129
+ 'Venue Managers: Standardize stock calculations across recurring events with different guest counts.'
130
+ ]
131
+ },
132
+ {
133
+ type: 'paragraph',
134
+ html: 'One often-overlooked variable is <strong>guest dropout rate</strong>. In most parties, 10-15% of guests leave early and 10% may not drink at all. The calculator applies a conservative buffer so that you are never caught short, but also not left with an enormous surplus. Understanding these adjustments helps you fine-tune the estimate for your specific crowd and context. Always round up when purchasing, since returning opened kegs is generally not possible. A small surplus is always preferable to running dry mid-party.'
135
+ }
136
+ ];
137
+
138
+ const schemas: PartyKegLocaleContent['schemas'] = [
139
+ {
140
+ '@context': 'https://schema.org',
141
+ '@type': 'SoftwareApplication',
142
+ name: title,
143
+ description: description,
144
+ applicationCategory: 'UtilityApplication',
145
+ operatingSystem: 'Web',
146
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
147
+ } as WithContext<SoftwareApplication>,
148
+ ];
149
+
150
+ export const content: PartyKegLocaleContent = {
151
+ slug,
152
+ title,
153
+ description,
154
+ ui,
155
+ seo,
156
+ faqTitle,
157
+ faq,
158
+ bibliographyTitle,
159
+ bibliography,
160
+ howTo,
161
+ schemas,
162
+ };
@@ -0,0 +1,166 @@
1
+ import type { WithContext, SoftwareApplication } from 'schema-dts';
2
+ import type { PartyKegUI, PartyKegLocaleContent } from '../index';
3
+
4
+ const slug = 'calculadora-fiesta-barril';
5
+ const title = 'Calculadora de Cerveza y Hielo para Eventos';
6
+ const description = 'Calcula cuánto alcohol y cuántas bolsas de hielo necesitas para tu fiesta según los invitados, la duración y la temperatura.';
7
+
8
+ const ui: PartyKegUI = {
9
+ calcStockTitle: 'Calculadora de Stock',
10
+ beerIceSub: 'Cerveza y Hielo para Eventos',
11
+ guestsLabel: 'Invitados',
12
+ durationLabel: 'Duración',
13
+ hoursUnit: 'Horas',
14
+ intensityLabel: 'Intensidad',
15
+ chillLabel: 'Chill',
16
+ standardLabel: 'Standard',
17
+ partyLabel: 'Party',
18
+ tempLabel: 'Temperatura',
19
+ estimatedVolLabel: 'Volumen Estimado',
20
+ kegsLabel: 'Barriles',
21
+ iceRequiredLabel: 'Hielo Requerido',
22
+ bagsLabel: 'Bolsas',
23
+ visualizationTitle: 'Visualización de Stock',
24
+ optimalMsg: 'Condiciones Óptimas',
25
+ highMeltMsg: 'Alto Deshielo Detectado',
26
+ highEfficiencyMsg: 'Ambiente Frío / Eficiencia Alta'
27
+ };
28
+
29
+ const faqTitle = 'Preguntas Frecuentes';
30
+ const bibliographyTitle = 'Bibliografía y Fuentes';
31
+
32
+ const faq: PartyKegLocaleContent['faq'] = [
33
+ {
34
+ question: "¿Cuántas cervezas bebe una persona en 4 horas?",
35
+ answer: "De media, calcula 5 cervezas por persona para un evento de 4 horas. Esto asume 2 bebidas la primera hora y 1 por cada hora restante.",
36
+ },
37
+ {
38
+ question: "¿Cuánto hielo necesito para 100 cervezas?",
39
+ answer: "Necesitarás aproximadamente 15-20 kilos de hielo (7-10 bolsas). La regla general es 1kg de hielo por cada litro de bebida si hace calor (>25°C).",
40
+ },
41
+ {
42
+ question: "¿Cuál es la diferencia entre un barril estándar y un barril de fiesta?",
43
+ answer: "Un barril comercial estándar contiene 50 litros, lo que equivale a unas 200 raciones de 250ml. Un barril de fiesta (mini-barril) suele contener 5 litros — unas 20 raciones. Conocer estos volúmenes te ayuda a convertir la salida en litros de la calculadora al número de envases que debes comprar.",
44
+ },
45
+ ];
46
+
47
+ const howTo: PartyKegLocaleContent['howTo'] = [
48
+ {
49
+ name: "Estimar el número de invitados",
50
+ text: "Define cuántas personas asistirán. Nuestra calculadora ajusta las cantidades basándose en promedios estadísticos de consumo.",
51
+ },
52
+ {
53
+ name: "Definir la duración y la intensidad",
54
+ text: "Indica cuántas horas durará el evento y el 'ritmo' de la fiesta (tranquilo, estándar o intenso).",
55
+ },
56
+ {
57
+ name: "Ajustar por temperatura ambiente",
58
+ text: "La temperatura exterior es clave para el cálculo del hielo. A más calor, mayor será la tasa de deshielo que debemos compensar.",
59
+ },
60
+ ];
61
+
62
+ const bibliography: PartyKegLocaleContent['bibliography'] = [
63
+ {
64
+ name: "Event Planning: Alcohol & Bar Calculations - Spruce Eats",
65
+ url: "https://www.thespruceeats.com/how-much-alcohol-for-a-party-1191060",
66
+ },
67
+ {
68
+ name: "Thermodynamics of Ice Melting - Engineering Toolbox",
69
+ url: "https://www.engineeringtoolbox.com/ice-thermal-properties-d_156.html",
70
+ },
71
+ ];
72
+
73
+ const seo: PartyKegLocaleContent['seo'] = [
74
+ {
75
+ type: 'title',
76
+ text: '¿Cuánta Cerveza y Hielo necesito para mi Fiesta?',
77
+ level: 2
78
+ },
79
+ {
80
+ type: 'paragraph',
81
+ html: 'La pregunta del millón al organizar cualquier evento: <strong>¿Cuántos litros de cerveza debo comprar?</strong> Quedarse corto es un desastre, pero comprar de más es un gasto innecesario. Esta herramienta te ayuda a calcular la cantidad exacta de alcohol y, lo más importante, <strong>cuántas bolsas de hielo</strong> necesitas para mantenerlo frío.'
82
+ },
83
+ {
84
+ type: 'title',
85
+ text: 'Fórmula de Consumo por Persona',
86
+ level: 2
87
+ },
88
+ {
89
+ type: 'paragraph',
90
+ html: 'Para estimar el alcohol necesario, los caterings profesionales utilizan una fórmula basada en la "Tasa de Consumo por Hora". No es una ciencia exacta, pero las estadísticas nos dicen que en una fiesta estándar se beben unas 1.5 unidades/hora por persona.'
91
+ },
92
+ {
93
+ type: 'stats',
94
+ items: [
95
+ { label: 'Consumo Chill', value: '1 bebida/hora', icon: 'mdi:tea-outline' },
96
+ { label: 'Fiesta Estándar', value: '1.5 bebidas/hora', icon: 'mdi:glass-mug-variant' },
97
+ { label: 'Boda / Festival', value: '2.5+ bebidas/hora', icon: 'mdi:fire' }
98
+ ],
99
+ columns: 3
100
+ },
101
+ {
102
+ type: 'diagnostic',
103
+ title: 'La Física del Hielo',
104
+ icon: 'mdi:snowflake-thermometer',
105
+ variant: 'warning',
106
+ badge: 'Termodinámica',
107
+ html: 'Calcular el hielo es donde la mayoría falla. El hielo cumple dos funciones: Enfriar (de 25°C a 4°C) y Mantener (luchar contra el calor ambiental). Si la temperatura supera los 30°C, la velocidad de fusión se duplica.'
108
+ },
109
+ {
110
+ type: 'tip',
111
+ title: 'Consejo Profesional para Ahorrar Hielo',
112
+ html: 'Mantén los barriles o latas a la sombra antes de ponerles el hielo. Si las bebidas están calientes al sol, el 50% de tu primera bolsa de hielo morirá en 10 minutos solo intercambiando calor latente. Comienza siempre con bebidas pre-enfriadas para reducir drásticamente la cantidad de hielo que realmente necesitas comprar.'
113
+ },
114
+ {
115
+ type: 'title',
116
+ text: 'Datos de Referencia para Logística',
117
+ level: 2
118
+ },
119
+ {
120
+ type: 'paragraph',
121
+ html: 'Un barril estándar de 50L rinde unas 200 cañas. Una bolsa de hielo típica pesa 2kg. Conociendo estos datos, puedes planificar el transporte y el almacenamiento necesario para tu evento sin sorpresas de última hora. Ten también en cuenta el deshielo durante el transporte: un trayecto de 30 minutos en verano puede costarte una bolsa entera antes de que empiece la fiesta.'
122
+ },
123
+ {
124
+ type: 'paragraph',
125
+ html: 'Una variable que a menudo se pasa por alto es la <strong>tasa de abandono de invitados</strong>. En la mayoría de fiestas, el 10-15% de los invitados se van antes y el 10% puede que no beban en absoluto. La calculadora aplica un margen de seguridad conservador para que nunca te quedes corto, sin que tampoco te sobre demasiado. Entender estos ajustes te ayuda a afinar la estimación para tu grupo y contexto específicos.'
126
+ },
127
+ {
128
+ type: 'summary',
129
+ title: '¿Para quién es esta herramienta?',
130
+ items: [
131
+ 'Anfitriones de fiestas privadas: Compra exactamente lo que necesitas sin quedarte corto ni malgastar.',
132
+ 'Organizadores de eventos: Usa modelos de consumo precisos para planificar la logística del bar profesionalmente.',
133
+ 'Gestores de locales: Estandariza los cálculos de stock para eventos recurrentes con diferentes aforos.'
134
+ ]
135
+ },
136
+ {
137
+ type: 'paragraph',
138
+ html: 'Redondea siempre al alza cuando compres, ya que devolver barriles abiertos generalmente no es posible. Un pequeño exceso es siempre preferible a quedarse sin bebida a mitad de fiesta — es mejor que sobren unas cañas a que la velada termine prematuramente por falta de stock.'
139
+ }
140
+ ];
141
+
142
+ const schemas: PartyKegLocaleContent['schemas'] = [
143
+ {
144
+ '@context': 'https://schema.org',
145
+ '@type': 'SoftwareApplication',
146
+ name: title,
147
+ description: description,
148
+ applicationCategory: 'UtilityApplication',
149
+ operatingSystem: 'Web',
150
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
151
+ } as WithContext<SoftwareApplication>,
152
+ ];
153
+
154
+ export const content: PartyKegLocaleContent = {
155
+ slug,
156
+ title,
157
+ description,
158
+ ui,
159
+ seo,
160
+ faqTitle,
161
+ faq,
162
+ bibliographyTitle,
163
+ bibliography,
164
+ howTo,
165
+ schemas,
166
+ };
@@ -0,0 +1,162 @@
1
+ import type { WithContext, SoftwareApplication } from 'schema-dts';
2
+ import type { PartyKegUI, PartyKegLocaleContent } from '../index';
3
+
4
+ const slug = 'calculateur-fete-fût';
5
+ const title = 'Calculateur de Bière et Glace pour Événements';
6
+ const description = 'Calculez la quantité d\'alcool et de sacs de glace dont vous avez besoin pour votre fête selon les invités, la durée et la température.';
7
+
8
+ const ui: PartyKegUI = {
9
+ calcStockTitle: 'Calculateur de Stock',
10
+ beerIceSub: 'Bière et Glace pour Événements',
11
+ guestsLabel: 'Invités',
12
+ durationLabel: 'Durée',
13
+ hoursUnit: 'Heures',
14
+ intensityLabel: 'Intensité',
15
+ chillLabel: 'Chill',
16
+ standardLabel: 'Standard',
17
+ partyLabel: 'Party',
18
+ tempLabel: 'Température',
19
+ estimatedVolLabel: 'Volume Estimé',
20
+ kegsLabel: 'Fûts',
21
+ iceRequiredLabel: 'Glace Requise',
22
+ bagsLabel: 'Sacs',
23
+ visualizationTitle: 'Visualisation du Stock',
24
+ optimalMsg: 'Conditions Optimales',
25
+ highMeltMsg: 'Fonte Élevée Détectée',
26
+ highEfficiencyMsg: 'Environnement Froid'
27
+ };
28
+
29
+ const faqTitle = 'Foire Aux Questions';
30
+ const bibliographyTitle = 'Bibliographie & Sources';
31
+
32
+ const faq: PartyKegLocaleContent['faq'] = [
33
+ {
34
+ question: "Combien de bières une personne boit-elle en 4 heures ?",
35
+ answer: "En moyenne, on compte 1 à 1,5 bière par heure par personne pour une fête standard. Pour un événement plus intense comme un Beer Pong, cela peut monter à 2 ou plus.",
36
+ },
37
+ {
38
+ question: "Pourquoi ai-je besoin de tant de glace ?",
39
+ answer: "La glace ne sert pas seulement à refroidir, mais à compenser la perte thermique. Dans un environnement chaud, jusqu'à 30% de la glace peut fondre avant même le début de l'événement.",
40
+ },
41
+ {
42
+ question: "Quelle est la différence entre un fût standard et un mini-fût ?",
43
+ answer: "Un fût commercial standard contient 50 litres, soit environ 200 portions de 250ml. Un mini-fût de fête contient généralement 5 litres — environ 20 portions. Connaître ces volumes vous aide à convertir la sortie en litres du calculateur en nombre de contenants à acheter.",
44
+ },
45
+ ];
46
+
47
+ const howTo: PartyKegLocaleContent['howTo'] = [
48
+ {
49
+ name: "Saisir le nombre d'invités",
50
+ text: "Entrez le nombre total de personnes attendues pour l'événement.",
51
+ },
52
+ {
53
+ name: "Définir la durée et l'intensité",
54
+ text: "Indiquez combien de temps durera la fête et quel est le 'vibe' (tranquille, standard ou fête intense).",
55
+ },
56
+ {
57
+ name: "Ajuster la température ambiante",
58
+ text: "La température extérieure influence directement la quantité de glace nécessaire pour garder les fûts au frais.",
59
+ },
60
+ ];
61
+
62
+ const bibliography: PartyKegLocaleContent['bibliography'] = [
63
+ {
64
+ name: "Event Planning: Beverage Calculation Guide",
65
+ url: "https://www.thespruceeats.com/how-much-alcohol-for-a-party-4158434",
66
+ },
67
+ {
68
+ name: "Ice Melt Rates and Cooling Efficiency",
69
+ url: "https://www.engineeringtoolbox.com/ice-melting-water-d_1594.html",
70
+ },
71
+ ];
72
+
73
+ const seo: PartyKegLocaleContent['seo'] = [
74
+ {
75
+ type: 'title',
76
+ text: 'Combien de Bière et de Glace pour ma Fête ?',
77
+ level: 2
78
+ },
79
+ {
80
+ type: 'paragraph',
81
+ html: 'Planifier un événement demande de la précision. Trop peu de bière et la fête s\'arrête avant l\'heure ; trop peu de glace et les boissons deviennent tièdes et imbuvables. Notre calculateur utilise des modèles de consommation basés sur des données réelles pour vous donner une estimation fiable, que vous organisiez une soirée intime ou un festival en plein air.'
82
+ },
83
+ {
84
+ type: 'title',
85
+ text: 'La Formule de Consommation par Personne',
86
+ level: 2
87
+ },
88
+ {
89
+ type: 'paragraph',
90
+ html: 'Pour estimer l\'alcool nécessaire, les traiteurs professionnels utilisent une formule basée sur le "Taux de Consommation Horaire". Ce n\'est pas une science exacte, mais les statistiques montrent qu\'à une fête standard, on consomme environ 1,5 unité par heure par personne. La chaleur ambiante, la disponibilité de nourriture et l\'ambiance générale influencent ce chiffre de base.'
91
+ },
92
+ {
93
+ type: 'stats',
94
+ items: [
95
+ { label: 'Consommation Chill', value: '1 boisson/heure', icon: 'mdi:tea-outline' },
96
+ { label: 'Fête Standard', value: '1,5 boisson/heure', icon: 'mdi:glass-mug-variant' },
97
+ { label: 'Mariage / Festival', value: '2,5+ boissons/heure', icon: 'mdi:fire' }
98
+ ],
99
+ columns: 3
100
+ },
101
+ {
102
+ type: 'diagnostic',
103
+ title: 'La Physique de la Glace',
104
+ icon: 'mdi:snowflake-thermometer',
105
+ variant: 'warning',
106
+ badge: 'Thermodynamique',
107
+ html: 'Calculer la glace est l\'erreur la plus courante des organisateurs de fêtes. La glace remplit deux fonctions : Refroidir (amener la bière de 25°C à 4°C) et Maintenir (lutter contre la chaleur ambiante). À des températures supérieures à 30°C, la vitesse de fonte double. Un sac de glace complet en plein soleil peut disparaître en moins de 20 minutes.'
108
+ },
109
+ {
110
+ type: 'tip',
111
+ title: 'Conseil Professionnel pour Économiser la Glace',
112
+ html: 'Gardez les fûts et les canettes à l\'ombre avant d\'ajouter de la glace. Si les boissons sont chaudes au soleil, les 50% de votre premier sac de glace disparaîtront en 10 minutes uniquement en échangeant la chaleur latente. Commencez avec des boissons pré-refroidies pour réduire drastiquement la quantité de glace nécessaire.'
113
+ },
114
+ {
115
+ type: 'title',
116
+ text: 'Données de Référence pour la Logistique',
117
+ level: 2
118
+ },
119
+ {
120
+ type: 'paragraph',
121
+ html: 'Un fût standard de 50L donne environ 200 portions. Un sac de glace typique pèse 2kg. En connaissant ces chiffres, vous pouvez planifier le transport et le stockage nécessaires à votre événement sans mauvaises surprises de dernière minute. Comptez également la fonte pendant le transport — un trajet de 30 minutes en été peut vous coûter un sac entier avant même le début de la fête.'
122
+ },
123
+ {
124
+ type: 'summary',
125
+ title: 'À qui s\'adresse cet outil ?',
126
+ items: [
127
+ 'Hôtes de fêtes privées : Achetez exactement ce dont vous avez besoin pour votre prochaine célébration.',
128
+ 'Organisateurs d\'événements : Utilisez des modèles de consommation précis pour planifier la logistique du bar.',
129
+ 'Gérants de lieux : Standardisez les calculs de stock pour des événements récurrents avec des nombres d\'invités variables.'
130
+ ]
131
+ },
132
+ {
133
+ type: 'paragraph',
134
+ html: 'Une variable souvent négligée est le <strong>taux d\'abandon des invités</strong>. Dans la plupart des fêtes, 10 à 15 % des invités partent tôt et 10 % peuvent ne pas boire du tout. Le calculateur applique une marge de sécurité conservatrice pour que vous ne soyez jamais à court, sans pour autant vous retrouver avec un surplus énorme. Comprendre ces ajustements vous aide à affiner l\'estimation pour votre groupe et contexte spécifiques.'
135
+ }
136
+ ];
137
+
138
+ const schemas: PartyKegLocaleContent['schemas'] = [
139
+ {
140
+ '@context': 'https://schema.org',
141
+ '@type': 'SoftwareApplication',
142
+ name: title,
143
+ description: description,
144
+ applicationCategory: 'UtilityApplication',
145
+ operatingSystem: 'Web',
146
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
147
+ } as WithContext<SoftwareApplication>,
148
+ ];
149
+
150
+ export const content: PartyKegLocaleContent = {
151
+ slug,
152
+ title,
153
+ description,
154
+ ui,
155
+ seo,
156
+ faqTitle,
157
+ faq,
158
+ bibliographyTitle,
159
+ bibliography,
160
+ howTo,
161
+ schemas,
162
+ };
@@ -0,0 +1,46 @@
1
+ import type { AlcoholToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
+ import PartyKegCalculator from './component.astro';
3
+
4
+ export interface PartyKegUI {
5
+ [key: string]: string;
6
+ calcStockTitle: string;
7
+ beerIceSub: string;
8
+ guestsLabel: string;
9
+ durationLabel: string;
10
+ hoursUnit: string;
11
+ intensityLabel: string;
12
+ chillLabel: string;
13
+ standardLabel: string;
14
+ partyLabel: string;
15
+ tempLabel: string;
16
+ estimatedVolLabel: string;
17
+ kegsLabel: string;
18
+ iceRequiredLabel: string;
19
+ bagsLabel: string;
20
+ visualizationTitle: string;
21
+ optimalMsg: string;
22
+ highMeltMsg: string;
23
+ highEfficiencyMsg: string;
24
+ }
25
+
26
+ export type PartyKegLocaleContent = ToolLocaleContent<PartyKegUI>;
27
+
28
+ export const partyKeg: AlcoholToolEntry<PartyKegUI> = {
29
+ id: 'party-keg',
30
+ icons: {
31
+ bg: 'mdi:party-popper',
32
+ fg: 'mdi:keg',
33
+ },
34
+ i18n: {
35
+ es: () => import('./i18n/es').then((m) => m.content),
36
+ en: () => import('./i18n/en').then((m) => m.content),
37
+ fr: () => import('./i18n/fr').then((m) => m.content),
38
+ },
39
+ };
40
+
41
+ export { PartyKegCalculator };
42
+
43
+ export const PARTY_KEG_TOOL: ToolDefinition = {
44
+ entry: partyKeg as AlcoholToolEntry<Record<string, string>>,
45
+ Component: PartyKegCalculator,
46
+ };
@@ -0,0 +1,36 @@
1
+ export interface PartyStats {
2
+ totalLiters: number;
3
+ kegs: number;
4
+ totalIce: number;
5
+ bags: number;
6
+ iceMsg: string;
7
+ }
8
+
9
+ export function calculatePartyStock(
10
+ guests: number,
11
+ duration: number,
12
+ temp: number,
13
+ drinkRate: number
14
+ ): PartyStats {
15
+ const totalDrinks = guests * (drinkRate * duration);
16
+ const totalLiters = Math.ceil(totalDrinks * 0.33);
17
+ const kegs = Math.ceil(totalLiters / 50);
18
+
19
+ const deltaT = temp - 4;
20
+ const massBeer = totalLiters;
21
+ const energyToRemove = massBeer * 4.18 * deltaT;
22
+ const iceForCooling = (energyToRemove / 334) * 1.5;
23
+
24
+ const ambientDelta = temp - 0;
25
+ const meltRate = (ambientDelta / 10) * 0.5;
26
+ const iceForMaintenance = meltRate * duration * (massBeer / 20);
27
+
28
+ const totalIce = Math.ceil(iceForCooling + iceForMaintenance);
29
+ const bags = Math.ceil(totalIce / 2);
30
+
31
+ let iceMsg = 'optimal';
32
+ if (temp > 30) iceMsg = 'highMelt';
33
+ else if (temp < 15) iceMsg = 'highEfficiency';
34
+
35
+ return { totalLiters, kegs, totalIce, bags, iceMsg };
36
+ }
package/src/tools.ts ADDED
@@ -0,0 +1,14 @@
1
+ import type { ToolDefinition } from './types';
2
+ import { COCKTAIL_BALANCER_TOOL } from './tool/cocktailBalancer';
3
+ import { BEER_COOLER_TOOL } from './tool/beerCooler';
4
+ import { PARTY_KEG_TOOL } from './tool/partyKeg';
5
+ import { CARBONATION_TOOL } from './tool/carbonationCalculator';
6
+ import { ALCOHOL_CLEARANCE_TOOL } from './tool/alcoholClearance';
7
+
8
+ export const ALL_TOOLS: ToolDefinition[] = [
9
+ COCKTAIL_BALANCER_TOOL,
10
+ BEER_COOLER_TOOL,
11
+ PARTY_KEG_TOOL,
12
+ CARBONATION_TOOL,
13
+ ALCOHOL_CLEARANCE_TOOL,
14
+ ];
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 AlcoholToolEntry<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 AlcoholCategoryEntry {
61
+ icon: string;
62
+ tools: AlcoholToolEntry[];
63
+ i18n: LocaleMap<CategoryLocaleContent>;
64
+ }
65
+
66
+ export interface ToolDefinition {
67
+ entry: AlcoholToolEntry<Record<string, string>>;
68
+ Component: unknown;
69
+ SEOComponent?: unknown;
70
+ BibliographyComponent?: unknown;
71
+ }
72
+