ricardosantis commited on
Commit
5aa6fed
·
verified ·
1 Parent(s): 9900bc7

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +30 -0
  2. prompts.txt +2 -1
index.html CHANGED
@@ -162,6 +162,7 @@
162
  <div id="progressFill" class="progress-fill" style="width: 0%"></div>
163
  </div>
164
  <div id="idealWeightRange" class="mt-3 text-sm text-gray-600"></div>
 
165
  </div>
166
 
167
  <!-- Classification -->
@@ -215,6 +216,7 @@
215
  <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">IMC</th>
216
  <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Classificação</th>
217
  <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Risco de Saúde</th>
 
218
  </tr>
219
  </thead>
220
  <tbody class="bg-white divide-y divide-gray-200">
@@ -222,31 +224,37 @@
222
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Abaixo de 18,5</td>
223
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Abaixo do peso</td>
224
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Desnutrição, osteoporose</td>
 
225
  </tr>
226
  <tr class="hover:bg-gray-50">
227
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">18,5 - 24,9</td>
228
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Peso normal</td>
229
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Baixo risco</td>
 
230
  </tr>
231
  <tr class="hover:bg-gray-50">
232
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">25,0 - 29,9</td>
233
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Sobrepeso</td>
234
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Risco aumentado</td>
 
235
  </tr>
236
  <tr class="hover:bg-gray-50">
237
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">30,0 - 34,9</td>
238
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Obesidade Grau I</td>
239
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Alto risco</td>
 
240
  </tr>
241
  <tr class="hover:bg-gray-50">
242
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">35,0 - 39,9</td>
243
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Obesidade Grau II</td>
244
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Muito alto risco</td>
 
245
  </tr>
246
  <tr class="hover:bg-gray-50">
247
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Acima de 40,0</td>
248
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Obesidade Grau III</td>
249
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Risco extremo</td>
 
250
  </tr>
251
  </tbody>
252
  </table>
@@ -271,6 +279,7 @@
271
  // Get input values
272
  const height = parseFloat(document.getElementById('height').value) / 100; // Convert cm to m
273
  const weight = parseFloat(document.getElementById('weight').value);
 
274
 
275
  // Calculate IMC
276
  const imc = weight / (height * height);
@@ -285,6 +294,27 @@
285
  document.getElementById('idealWeightRange').innerHTML =
286
  `<span class="font-medium">Peso ideal para sua altura:</span> ${minIdealWeight}kg a ${maxIdealWeight}kg`;
287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  // Calculate progress bar position (IMC range: 15 to 45)
289
  const progressPercentage = ((roundedImc - 15) / 30) * 100;
290
  document.getElementById('progressFill').style.width = `${Math.min(Math.max(progressPercentage, 0), 100)}%`;
 
162
  <div id="progressFill" class="progress-fill" style="width: 0%"></div>
163
  </div>
164
  <div id="idealWeightRange" class="mt-3 text-sm text-gray-600"></div>
165
+ <div id="waistCircumference" class="mt-2 text-sm text-gray-600"></div>
166
  </div>
167
 
168
  <!-- Classification -->
 
216
  <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">IMC</th>
217
  <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Classificação</th>
218
  <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Risco de Saúde</th>
219
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Circunferência Abdominal Ideal</th>
220
  </tr>
221
  </thead>
222
  <tbody class="bg-white divide-y divide-gray-200">
 
224
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Abaixo de 18,5</td>
225
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Abaixo do peso</td>
226
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Desnutrição, osteoporose</td>
227
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Homens: até 94cm<br>Mulheres: até 80cm</td>
228
  </tr>
229
  <tr class="hover:bg-gray-50">
230
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">18,5 - 24,9</td>
231
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Peso normal</td>
232
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Baixo risco</td>
233
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Homens: até 94cm<br>Mulheres: até 80cm</td>
234
  </tr>
235
  <tr class="hover:bg-gray-50">
236
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">25,0 - 29,9</td>
237
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Sobrepeso</td>
238
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Risco aumentado</td>
239
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Homens: abaixo de 102cm<br>Mulheres: abaixo de 88cm</td>
240
  </tr>
241
  <tr class="hover:bg-gray-50">
242
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">30,0 - 34,9</td>
243
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Obesidade Grau I</td>
244
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Alto risco</td>
245
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Homens: abaixo de 102cm<br>Mulheres: abaixo de 88cm</td>
246
  </tr>
247
  <tr class="hover:bg-gray-50">
248
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">35,0 - 39,9</td>
249
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Obesidade Grau II</td>
250
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Muito alto risco</td>
251
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Homens: abaixo de 102cm<br>Mulheres: abaixo de 88cm</td>
252
  </tr>
253
  <tr class="hover:bg-gray-50">
254
  <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Acima de 40,0</td>
255
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Obesidade Grau III</td>
256
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Risco extremo</td>
257
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Homens: abaixo de 102cm<br>Mulheres: abaixo de 88cm</td>
258
  </tr>
259
  </tbody>
260
  </table>
 
279
  // Get input values
280
  const height = parseFloat(document.getElementById('height').value) / 100; // Convert cm to m
281
  const weight = parseFloat(document.getElementById('weight').value);
282
+ const gender = document.querySelector('input[name="gender"]:checked')?.value;
283
 
284
  // Calculate IMC
285
  const imc = weight / (height * height);
 
294
  document.getElementById('idealWeightRange').innerHTML =
295
  `<span class="font-medium">Peso ideal para sua altura:</span> ${minIdealWeight}kg a ${maxIdealWeight}kg`;
296
 
297
+ // Calculate and display ideal waist circumference
298
+ let waistCircumferenceInfo = "";
299
+ if (gender === 'male') {
300
+ if (roundedImc < 25) {
301
+ waistCircumferenceInfo = "Circunferência abdominal ideal para homens: até 94cm";
302
+ } else {
303
+ waistCircumferenceInfo = "Circunferência abdominal ideal para homens: abaixo de 102cm";
304
+ }
305
+ } else if (gender === 'female') {
306
+ if (roundedImc < 25) {
307
+ waistCircumferenceInfo = "Circunferência abdominal ideal para mulheres: até 80cm";
308
+ } else {
309
+ waistCircumferenceInfo = "Circunferência abdominal ideal para mulheres: abaixo de 88cm";
310
+ }
311
+ } else {
312
+ waistCircumferenceInfo = "Circunferência abdominal ideal: Homens até 94cm (abaixo de 102cm se sobrepeso), Mulheres até 80cm (abaixo de 88cm se sobrepeso)";
313
+ }
314
+
315
+ document.getElementById('waistCircumference').innerHTML =
316
+ `<span class="font-medium">${waistCircumferenceInfo}</span>`;
317
+
318
  // Calculate progress bar position (IMC range: 15 to 45)
319
  const progressPercentage = ((roundedImc - 15) / 30) * 100;
320
  document.getElementById('progressFill').style.width = `${Math.min(Math.max(progressPercentage, 0), 100)}%`;
prompts.txt CHANGED
@@ -1,2 +1,3 @@
1
  Preciso que mostre na resposta do IMC qual a faixa de peso ideal para aquele IMC encontrado. Verifique a regra publica para isso.
2
- Preciso que ajuste o peso para que aceite fração em ate 1 digito, ou seja, permita que o peso tenha decimal.
 
 
1
  Preciso que mostre na resposta do IMC qual a faixa de peso ideal para aquele IMC encontrado. Verifique a regra publica para isso.
2
+ Preciso que ajuste o peso para que aceite fração em ate 1 digito, ou seja, permita que o peso tenha decimal.
3
+ Preciso que além do calculo do IMC e também da apresentação do peso ideal, voce encontre a informação da circunferência abdominal ideal para cada resultado e mostre junto com os resultados existentes.