Skip to content

Commit 402a105

Browse files
committed
albumin unit corrections
1 parent 683753c commit 402a105

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

LongevityWorldCup.Website/wwwroot/onboarding/pheno-age.html

+20-4
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,22 @@ <h2 data-aos="fade" data-aos-duration="700" data-aos-delay="250">The Blood Pact
296296
}
297297

298298
function correctCorrectableUnits() {
299+
// Albumin
300+
const albuminValue = parseFloat(document.getElementById('albumin').value);
301+
const albuminUnit = parseFloat(document.getElementById('albuminUnit').value);
302+
if (albuminUnit != 15.0466 && albuminValue > 300) {
303+
console.log("Albumin is too high. Correcting the unit.");
304+
document.getElementById('albuminUnit').value = 15.0466;
305+
}
306+
else if (albuminUnit != 0.1 && albuminValue < 6) {
307+
console.log("Albumin is too low. Correcting the unit.");
308+
document.getElementById('albuminUnit').value = 0.1;
309+
}
310+
else if (albuminUnit != 1 && albuminValue < 60) {
311+
console.log("Albumin is too low. Correcting the unit.");
312+
document.getElementById('albuminUnit').value = 1;
313+
}
314+
299315
// White Blood Cell Count (WBC)
300316
const wbcValue = parseFloat(document.getElementById('wbc').value);
301317
const wbcUnit = parseFloat(document.getElementById('wbcUnit').value);
@@ -411,10 +427,10 @@ <h2 data-aos="fade" data-aos-duration="700" data-aos-delay="250">The Blood Pact
411427
// Setting up the animated counter effect
412428
let displayAge = 0;
413429
resultElement.innerHTML = `
414-
<div style="font-size: 1rem; color: #2c3e50; text-align: center;">Your biological age is:</div>
415-
<div style="font-size: 2.5rem; color: #4CAF50; font-weight: bold; text-align: center;"><span id="animatedAge">0</span></div>
416-
<div id="yearsText" style="font-size: 1rem; color: #2c3e50; text-align: center;">years</div>
417-
`;
430+
<div style="font-size: 1rem; color: #2c3e50; text-align: center;">Your biological age is:</div>
431+
<div style="font-size: 2.5rem; color: #4CAF50; font-weight: bold; text-align: center;"><span id="animatedAge">0</span></div>
432+
<div id="yearsText" style="font-size: 1rem; color: #2c3e50; text-align: center;">years</div>
433+
`;
418434

419435
if (isFirstTimeAnimation) {
420436
// Set the flag to false after the first run

0 commit comments

Comments
 (0)