@@ -139,8 +139,8 @@ const sharedValues = {
139139 <div class =" scale-segment obese" >
140140 <span >Obese</span >
141141 </div >
142+ <!-- scale indicator removed - controlled indicator caused layout issues -->
142143 </div >
143- <div class =" scale-indicator" id =" scale-indicator" ></div >
144144 </div >
145145
146146 <ResultCard title =" Understanding Your BMI" >
@@ -224,8 +224,10 @@ const sharedValues = {
224224 display: flex;
225225 height: 60px;
226226 border-radius: var(--border-radius);
227- overflow: hidden;
227+ /* allow the pointer triangle to render outside the bar */
228+ overflow: visible;
228229 margin-bottom: 1.5rem;
230+ position: relative;
229231 }
230232
231233 .scale-segment {
@@ -253,17 +255,9 @@ const sharedValues = {
253255 background: var(--color-danger);
254256 }
255257
256- .scale-indicator {
257- position: absolute;
258- bottom: 1rem;
259- width: 0;
260- height: 0;
261- border-left: 10px solid transparent;
262- border-right: 10px solid transparent;
263- border-bottom: 12px solid var(--color-text);
264- transform: translateX(-50%);
265- transition: left 0.3s ease;
266- }
258+ /* scale indicator removed - kept for historical context
259+ .scale-indicator { ... }
260+ */
267261
268262 .bmi-info {
269263 background: var(--color-background);
@@ -385,6 +379,7 @@ const sharedValues = {
385379 private bmiNumber: HTMLElement | null = null;
386380 private bmiCategory: HTMLElement | null = null;
387381 private bmiExplanation: HTMLElement | null = null;
382+ // scaleIndicator removed from DOM; keep property for compatibility
388383 private scaleIndicator: HTMLElement | null = null;
389384 private asianScale: HTMLInputElement | null = null;
390385
@@ -401,7 +396,7 @@ const sharedValues = {
401396 this.bmiNumber = document.getElementById("bmi-number");
402397 this.bmiCategory = document.getElementById("bmi-category");
403398 this.bmiExplanation = document.getElementById("bmi-explanation");
404- this. scaleIndicator = document.getElementById("scale-indicator");
399+ // scaleIndicator intentionally not queried - removed from markup
405400 this.asianScale = document.getElementById("asian-scale") as HTMLInputElement;
406401 }
407402
@@ -611,8 +606,9 @@ const sharedValues = {
611606 this.bmiCategory.textContent = categoryData.name;
612607 // Update the CSS class for the category badge
613608 this.bmiCategory.className = `category-badge category-badge--md category-badge--solid ${category}`;
609+ // Set the badge color to match the chart legend colors exactly
610+ this.bmiCategory.style.setProperty("--badge-color", categoryData.color);
614611 }
615-
616612 if (this.bmiExplanation) {
617613 this.bmiExplanation.textContent = categoryData.explanation;
618614 }
@@ -669,24 +665,8 @@ const sharedValues = {
669665 }
670666
671667 private updateScaleIndicator(bmi: number, useAsianScale: boolean): void {
672- if (!this.scaleIndicator) return;
673-
674- let position;
675- if (useAsianScale) {
676- // Asian scale thresholds
677- if (bmi < 18.5) position = (bmi / 18.5) * 25;
678- else if (bmi < 23) position = 25 + ((bmi - 18.5) / 4.5) * 25;
679- else if (bmi < 27.5) position = 50 + ((bmi - 23) / 4.5) * 25;
680- else position = 75 + Math.min(((bmi - 27.5) / 7.5) * 25, 25);
681- } else {
682- // Standard scale thresholds
683- if (bmi < 18.5) position = (bmi / 18.5) * 25;
684- else if (bmi < 25) position = 25 + ((bmi - 18.5) / 6.5) * 25;
685- else if (bmi < 30) position = 50 + ((bmi - 25) / 5) * 25;
686- else position = 75 + Math.min(((bmi - 30) / 10) * 25, 25);
687- }
688-
689- this.scaleIndicator.style.left = `${Math.min(position, 100)}%`;
668+ // scale-indicator removed - no-op
669+ return;
690670 }
691671 }
692672
0 commit comments