Spaces:
Sleeping
Sleeping
Update web/profile.html
Browse files- web/profile.html +1 -132
web/profile.html
CHANGED
|
@@ -477,138 +477,7 @@ function renderBars(measurements) {
|
|
| 477 |
// RANGE BARS LOGIC
|
| 478 |
const tabs = document.querySelectorAll(".tab");
|
| 479 |
const contents = document.querySelectorAll(".tab-content");
|
| 480 |
-
|
| 481 |
-
// {
|
| 482 |
-
// name: "Blood Sugar",
|
| 483 |
-
// min: 70,
|
| 484 |
-
// max: 110,
|
| 485 |
-
// value: 95,
|
| 486 |
-
// tab: "in-range",
|
| 487 |
-
// impacts: ["Pancreas"],
|
| 488 |
-
// },
|
| 489 |
-
// {
|
| 490 |
-
// name: "Cholesterol",
|
| 491 |
-
// min: 120,
|
| 492 |
-
// max: 200,
|
| 493 |
-
// value: 180,
|
| 494 |
-
// tab: "in-range",
|
| 495 |
-
// impacts: ["Heart", "Arteries"],
|
| 496 |
-
// },
|
| 497 |
-
// {
|
| 498 |
-
// name: "Triglycerides",
|
| 499 |
-
// min: 50,
|
| 500 |
-
// max: 150,
|
| 501 |
-
// value: 180,
|
| 502 |
-
// tab: "out-range",
|
| 503 |
-
// impacts: ["Heart"],
|
| 504 |
-
// },
|
| 505 |
-
// {
|
| 506 |
-
// name: "Blood Pressure",
|
| 507 |
-
// min: 90,
|
| 508 |
-
// max: 120,
|
| 509 |
-
// value: 130,
|
| 510 |
-
// tab: "out-range",
|
| 511 |
-
// impacts: ["Heart", "Kidneys"],
|
| 512 |
-
// },
|
| 513 |
-
// ];
|
| 514 |
-
|
| 515 |
-
// const counts = { "in-range": 0, "out-range": 0 };
|
| 516 |
-
|
| 517 |
-
// measurements.forEach((m) => {
|
| 518 |
-
// counts[m.tab]++;
|
| 519 |
-
// const container = document.getElementById(m.tab);
|
| 520 |
-
// const card = document.createElement("div");
|
| 521 |
-
// card.className = "range-card";
|
| 522 |
-
// const title = document.createElement("h3");
|
| 523 |
-
// title.textContent = m.name;
|
| 524 |
-
// card.appendChild(title);
|
| 525 |
-
// if (m.impacts) {
|
| 526 |
-
// const impactLabel = document.createElement("div");
|
| 527 |
-
// impactLabel.className = "impact-label";
|
| 528 |
-
// impactLabel.textContent = "Impacts: " + m.impacts.join(", ");
|
| 529 |
-
// card.appendChild(impactLabel);
|
| 530 |
-
// }
|
| 531 |
-
// const barContainer = document.createElement("div");
|
| 532 |
-
// barContainer.className = "range-bar-container";
|
| 533 |
-
// const bar = document.createElement("div");
|
| 534 |
-
// bar.className = "range-bar";
|
| 535 |
-
|
| 536 |
-
// let normalPercent = 100;
|
| 537 |
-
// let overflowPercent = 0;
|
| 538 |
-
// if (m.tab === "out-range" && m.value > m.max) {
|
| 539 |
-
// normalPercent = ((m.max - m.min) / (m.value - m.min)) * 100;
|
| 540 |
-
// overflowPercent = 100 - normalPercent;
|
| 541 |
-
// }
|
| 542 |
-
|
| 543 |
-
// const normalDiv = document.createElement("div");
|
| 544 |
-
// normalDiv.className = "normal-range";
|
| 545 |
-
// normalDiv.style.width = normalPercent + "%";
|
| 546 |
-
// bar.appendChild(normalDiv);
|
| 547 |
-
// if (overflowPercent > 0) {
|
| 548 |
-
// const overflowDiv = document.createElement("div");
|
| 549 |
-
// overflowDiv.className = "overflow-range";
|
| 550 |
-
// overflowDiv.style.left = normalPercent + "%";
|
| 551 |
-
// overflowDiv.style.width = overflowPercent + "%";
|
| 552 |
-
// bar.appendChild(overflowDiv);
|
| 553 |
-
// }
|
| 554 |
-
|
| 555 |
-
// let valuePercent = ((m.value - m.min) / (m.max - m.min)) * 100;
|
| 556 |
-
// valuePercent = Math.min(Math.max(valuePercent, 0), 100);
|
| 557 |
-
// const marker = document.createElement("div");
|
| 558 |
-
// marker.className = "marker";
|
| 559 |
-
// marker.style.left = valuePercent + "%";
|
| 560 |
-
// bar.appendChild(marker);
|
| 561 |
-
// const valueLabel = document.createElement("div");
|
| 562 |
-
// valueLabel.className = "value-label";
|
| 563 |
-
// valueLabel.style.left = valuePercent + "%";
|
| 564 |
-
// valueLabel.textContent = m.value;
|
| 565 |
-
// bar.appendChild(valueLabel);
|
| 566 |
-
|
| 567 |
-
// barContainer.appendChild(bar);
|
| 568 |
-
|
| 569 |
-
// const minMaxDiv = document.createElement("div");
|
| 570 |
-
// minMaxDiv.className = "min-max-labels relative w-full";
|
| 571 |
-
|
| 572 |
-
// const minLabel = document.createElement("span");
|
| 573 |
-
// minLabel.textContent = "Min: " + m.min;
|
| 574 |
-
// minLabel.style.position = "absolute";
|
| 575 |
-
// minLabel.style.left = "0";
|
| 576 |
-
|
| 577 |
-
// const maxLabel = document.createElement("span");
|
| 578 |
-
// maxLabel.textContent = "Max: " + m.max;
|
| 579 |
-
// maxLabel.style.position = "absolute";
|
| 580 |
-
|
| 581 |
-
// // put the max label at the end of the green section
|
| 582 |
-
// let maxPercent = 100;
|
| 583 |
-
// if (m.value > m.max) {
|
| 584 |
-
// maxPercent = ((m.max - m.min) / (m.value - m.min)) * 100;
|
| 585 |
-
// }
|
| 586 |
-
// maxLabel.style.left = maxPercent + "%";
|
| 587 |
-
// maxLabel.style.transform = "translateX(-100%)"; // anchor it properly
|
| 588 |
-
|
| 589 |
-
// minMaxDiv.appendChild(minLabel);
|
| 590 |
-
// minMaxDiv.appendChild(maxLabel);
|
| 591 |
-
// barContainer.appendChild(minMaxDiv);
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
// card.appendChild(barContainer);
|
| 595 |
-
// container.appendChild(card);
|
| 596 |
-
// });
|
| 597 |
-
|
| 598 |
-
// tabs.forEach((tab) => {
|
| 599 |
-
// const t = tab.dataset.tab;
|
| 600 |
-
// const badge = tab.querySelector(".count-badge");
|
| 601 |
-
// badge.textContent = counts[t];
|
| 602 |
-
// tab.addEventListener("click", () => {
|
| 603 |
-
// tabs.forEach((t) => t.classList.remove("active"));
|
| 604 |
-
// tab.classList.add("active");
|
| 605 |
-
// contents.forEach((c) =>
|
| 606 |
-
// c.id === t
|
| 607 |
-
// ? c.classList.add("active")
|
| 608 |
-
// : c.classList.remove("active")
|
| 609 |
-
// );
|
| 610 |
-
// });
|
| 611 |
-
// });
|
| 612 |
});
|
| 613 |
</script>
|
| 614 |
</body>
|
|
|
|
| 477 |
// RANGE BARS LOGIC
|
| 478 |
const tabs = document.querySelectorAll(".tab");
|
| 479 |
const contents = document.querySelectorAll(".tab-content");
|
| 480 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 481 |
});
|
| 482 |
</script>
|
| 483 |
</body>
|