Remve oz, cups, lb
This commit is contained in:
parent
d489a87722
commit
da9fd20ffb
125
iframe.html
125
iframe.html
@ -206,6 +206,8 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.dog-calculator-results {
|
.dog-calculator-results {
|
||||||
background: linear-gradient(135deg, rgba(241, 154, 95, 0.08) 0%, rgba(241, 154, 95, 0.04) 100%);
|
background: linear-gradient(135deg, rgba(241, 154, 95, 0.08) 0%, rgba(241, 154, 95, 0.04) 100%);
|
||||||
border: 1px solid rgba(241, 154, 95, 0.2);
|
border: 1px solid rgba(241, 154, 95, 0.2);
|
||||||
@ -1979,6 +1981,8 @@
|
|||||||
<div id="ageClampNote" class="dog-calculator-error dog-calculator-hidden">Age adjusted to the supported 2–12 month range.</div>
|
<div id="ageClampNote" class="dog-calculator-error dog-calculator-hidden">Age adjusted to the supported 2–12 month range.</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="dog-calculator-form-group">
|
<div class="dog-calculator-form-group">
|
||||||
<label for="kayaEndWeight">Kaya’s end‑weight:</label>
|
<label for="kayaEndWeight">Kaya’s end‑weight:</label>
|
||||||
<input type="text" id="kayaEndWeight" value="30 kg" readonly>
|
<input type="text" id="kayaEndWeight" value="30 kg" readonly>
|
||||||
@ -2035,9 +2039,6 @@
|
|||||||
<div class="dog-calculator-unit-buttons" id="unitButtons" style="display: none;">
|
<div class="dog-calculator-unit-buttons" id="unitButtons" style="display: none;">
|
||||||
<button type="button" class="dog-calculator-unit-btn active" data-unit="g">g</button>
|
<button type="button" class="dog-calculator-unit-btn active" data-unit="g">g</button>
|
||||||
<button type="button" class="dog-calculator-unit-btn" data-unit="kg">kg</button>
|
<button type="button" class="dog-calculator-unit-btn" data-unit="kg">kg</button>
|
||||||
<button type="button" class="dog-calculator-unit-btn" data-unit="oz">oz</button>
|
|
||||||
<button type="button" class="dog-calculator-unit-btn" data-unit="lb">lb</button>
|
|
||||||
<button type="button" class="dog-calculator-unit-btn" data-unit="cups" id="cupsButton" disabled title="Available when using kcal/cup measurement">cups</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Daily Total Results -->
|
<!-- Daily Total Results -->
|
||||||
@ -2052,9 +2053,6 @@
|
|||||||
<select id="unit" class="dog-calculator-unit-select-hidden" aria-describedby="unitHelp">
|
<select id="unit" class="dog-calculator-unit-select-hidden" aria-describedby="unitHelp">
|
||||||
<option value="g">grams (g)</option>
|
<option value="g">grams (g)</option>
|
||||||
<option value="kg">kilograms (kg)</option>
|
<option value="kg">kilograms (kg)</option>
|
||||||
<option value="oz">ounces (oz)</option>
|
|
||||||
<option value="lb">pounds (lb)</option>
|
|
||||||
<option value="cups">cups</option>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<div class="dog-calculator-food-amounts-section" id="foodAmountsSection" style="display: none;">
|
<div class="dog-calculator-food-amounts-section" id="foodAmountsSection" style="display: none;">
|
||||||
@ -2739,32 +2737,15 @@ const CALCULATOR_CONFIG = {
|
|||||||
// Auto-select cups when entering energy for kcal/cup
|
// Auto-select cups when entering energy for kcal/cup
|
||||||
const foodSource = this.foodSources.find(fs => fs.id === id);
|
const foodSource = this.foodSources.find(fs => fs.id === id);
|
||||||
if (foodSource && foodSource.energyUnit === 'kcalcup' && parseFloat(energyInput.value) > 0) {
|
if (foodSource && foodSource.energyUnit === 'kcalcup' && parseFloat(energyInput.value) > 0) {
|
||||||
|
// Cups display removed; default to grams
|
||||||
const unitSelect = document.getElementById('unit');
|
const unitSelect = document.getElementById('unit');
|
||||||
const cupsButton = document.getElementById('cupsButton');
|
if (unitSelect) {
|
||||||
|
unitSelect.value = 'g';
|
||||||
// First check if cups button will be enabled after update
|
unitSelect.setAttribute('value', 'g');
|
||||||
const willEnableCups = this.foodSources.some(fs =>
|
this.setActiveUnitButton('g');
|
||||||
fs.energyUnit === 'kcalcup' && fs.energy && parseFloat(fs.energy) > 0
|
|
||||||
);
|
|
||||||
|
|
||||||
if (willEnableCups && unitSelect) {
|
|
||||||
// Set cups BEFORE updating calculations
|
|
||||||
unitSelect.value = 'cups';
|
|
||||||
unitSelect.setAttribute('value', 'cups');
|
|
||||||
this.setActiveUnitButton('cups');
|
|
||||||
|
|
||||||
// Enable the cups button manually since we know it will be valid
|
|
||||||
if (cupsButton) {
|
|
||||||
cupsButton.disabled = false;
|
|
||||||
cupsButton.title = 'Show amounts in cups';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now update calculations with cups already selected
|
|
||||||
this.updateFoodCalculations();
|
|
||||||
} else {
|
|
||||||
this.updateFoodCalculations();
|
|
||||||
}
|
}
|
||||||
|
this.updateFoodCalculations();
|
||||||
});
|
});
|
||||||
energyInput.addEventListener('blur', () => this.validateFoodSourceEnergy(id));
|
energyInput.addEventListener('blur', () => this.validateFoodSourceEnergy(id));
|
||||||
}
|
}
|
||||||
@ -2783,21 +2764,9 @@ const CALCULATOR_CONFIG = {
|
|||||||
if (unitSelect) {
|
if (unitSelect) {
|
||||||
switch(energyUnitSelect.value) {
|
switch(energyUnitSelect.value) {
|
||||||
case 'kcalcup':
|
case 'kcalcup':
|
||||||
// Check if we have energy value to enable cups
|
// Cups display not available; default to grams
|
||||||
const foodSource = this.foodSources.find(fs => fs.id === id);
|
unitSelect.value = 'g';
|
||||||
if (foodSource && foodSource.energy && parseFloat(foodSource.energy) > 0) {
|
this.setActiveUnitButton('g');
|
||||||
// Set cups BEFORE updating calculations
|
|
||||||
unitSelect.value = 'cups';
|
|
||||||
unitSelect.setAttribute('value', 'cups');
|
|
||||||
this.setActiveUnitButton('cups');
|
|
||||||
|
|
||||||
// Enable the cups button manually
|
|
||||||
const cupsButton = document.getElementById('cupsButton');
|
|
||||||
if (cupsButton) {
|
|
||||||
cupsButton.disabled = false;
|
|
||||||
cupsButton.title = 'Show amounts in cups';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.updateFoodCalculations();
|
this.updateFoodCalculations();
|
||||||
break;
|
break;
|
||||||
case 'kcal100g':
|
case 'kcal100g':
|
||||||
@ -2813,9 +2782,9 @@ const CALCULATOR_CONFIG = {
|
|||||||
this.updateFoodCalculations();
|
this.updateFoodCalculations();
|
||||||
break;
|
break;
|
||||||
case 'kcalcan':
|
case 'kcalcan':
|
||||||
// For kcal/can, use grams as default (or ounces in imperial)
|
// For kcal/can, use grams as default
|
||||||
unitSelect.value = this.isImperial ? 'oz' : 'g';
|
unitSelect.value = 'g';
|
||||||
this.setActiveUnitButton(unitSelect.value);
|
this.setActiveUnitButton('g');
|
||||||
this.updateFoodCalculations();
|
this.updateFoodCalculations();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3106,58 +3075,14 @@ const CALCULATOR_CONFIG = {
|
|||||||
imperialLabel.classList.toggle('active', this.isImperial);
|
imperialLabel.classList.toggle('active', this.isImperial);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isImperial) {
|
// Kaya: restrict to metric g/kg only
|
||||||
if (weightLabel) weightLabel.textContent = "Dog's Weight (lbs):";
|
if (unitSelect) {
|
||||||
if (weightInput) {
|
unitSelect.innerHTML = '<option value="g">grams (g)</option>' +
|
||||||
weightInput.placeholder = "Enter weight in lbs";
|
'<option value="kg">kilograms (kg)</option>';
|
||||||
weightInput.min = "0.2";
|
if (!unitSelect.value || (unitSelect.value !== 'g' && unitSelect.value !== 'kg')) {
|
||||||
weightInput.step = "0.1";
|
unitSelect.value = 'g';
|
||||||
|
this.setActiveUnitButton('g');
|
||||||
}
|
}
|
||||||
if (unitSelect) {
|
|
||||||
unitSelect.innerHTML = '<option value="oz">ounces (oz)</option>' +
|
|
||||||
'<option value="lb">pounds (lb)</option>' +
|
|
||||||
'<option value="g">grams (g)</option>' +
|
|
||||||
'<option value="kg">kilograms (kg)</option>';
|
|
||||||
unitSelect.value = 'oz'; // Auto-select ounces for imperial
|
|
||||||
this.setActiveUnitButton('oz'); // Sync unit buttons
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update energy units for all food sources to kcal/cup for imperial
|
|
||||||
this.foodSources.forEach(fs => {
|
|
||||||
if (fs.energyUnit === 'kcal100g') {
|
|
||||||
fs.energyUnit = 'kcalcup';
|
|
||||||
const energyUnitSelect = document.getElementById(`energy-unit-${fs.id}`);
|
|
||||||
if (energyUnitSelect) {
|
|
||||||
energyUnitSelect.value = 'kcalcup';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (weightLabel) weightLabel.textContent = "Dog's Weight (kg):";
|
|
||||||
if (weightInput) {
|
|
||||||
weightInput.placeholder = "Enter weight in kg";
|
|
||||||
weightInput.min = "0.1";
|
|
||||||
weightInput.step = "0.1";
|
|
||||||
}
|
|
||||||
if (unitSelect) {
|
|
||||||
unitSelect.innerHTML = '<option value="g">grams (g)</option>' +
|
|
||||||
'<option value="kg">kilograms (kg)</option>' +
|
|
||||||
'<option value="oz">ounces (oz)</option>' +
|
|
||||||
'<option value="lb">pounds (lb)</option>';
|
|
||||||
unitSelect.value = 'g'; // Auto-select grams for metric
|
|
||||||
this.setActiveUnitButton('g'); // Sync unit buttons
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update energy units for all food sources to kcal/100g for metric
|
|
||||||
this.foodSources.forEach(fs => {
|
|
||||||
if (fs.energyUnit === 'kcalcup') {
|
|
||||||
fs.energyUnit = 'kcal100g';
|
|
||||||
const energyUnitSelect = document.getElementById(`energy-unit-${fs.id}`);
|
|
||||||
if (energyUnitSelect) {
|
|
||||||
energyUnitSelect.value = 'kcal100g';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3340,6 +3265,8 @@ const CALCULATOR_CONFIG = {
|
|||||||
if (age < 2) { age = 2; if (ageClampNote) ageClampNote.classList.remove('dog-calculator-hidden'); }
|
if (age < 2) { age = 2; if (ageClampNote) ageClampNote.classList.remove('dog-calculator-hidden'); }
|
||||||
if (age > 12) { age = 12; if (ageClampNote) ageClampNote.classList.remove('dog-calculator-hidden'); }
|
if (age > 12) { age = 12; if (ageClampNote) ageClampNote.classList.remove('dog-calculator-hidden'); }
|
||||||
|
|
||||||
|
// Bucket pills removed
|
||||||
|
|
||||||
// Calculate interpolated kibble grams/day for 30 kg at this age
|
// Calculate interpolated kibble grams/day for 30 kg at this age
|
||||||
const kibbleGrams = this.getKayaKibbleGramsForAge(age);
|
const kibbleGrams = this.getKayaKibbleGramsForAge(age);
|
||||||
|
|
||||||
@ -3394,6 +3321,8 @@ const CALCULATOR_CONFIG = {
|
|||||||
return lowerVal + (upperVal - lowerVal) * t;
|
return lowerVal + (upperVal - lowerVal) * t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateCupsButtonState() {
|
updateCupsButtonState() {
|
||||||
const cupsButton = document.getElementById('cupsButton');
|
const cupsButton = document.getElementById('cupsButton');
|
||||||
if (!cupsButton) return;
|
if (!cupsButton) return;
|
||||||
|
|||||||
@ -196,6 +196,8 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.dog-calculator-results {
|
.dog-calculator-results {
|
||||||
background: linear-gradient(135deg, rgba(241, 154, 95, 0.08) 0%, rgba(241, 154, 95, 0.04) 100%);
|
background: linear-gradient(135deg, rgba(241, 154, 95, 0.08) 0%, rgba(241, 154, 95, 0.04) 100%);
|
||||||
border: 1px solid rgba(241, 154, 95, 0.2);
|
border: 1px solid rgba(241, 154, 95, 0.2);
|
||||||
|
|||||||
@ -10,6 +10,8 @@
|
|||||||
<div id="ageClampNote" class="dog-calculator-error dog-calculator-hidden">Age adjusted to the supported 2–12 month range.</div>
|
<div id="ageClampNote" class="dog-calculator-error dog-calculator-hidden">Age adjusted to the supported 2–12 month range.</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="dog-calculator-form-group">
|
<div class="dog-calculator-form-group">
|
||||||
<label for="kayaEndWeight">Kaya’s end‑weight:</label>
|
<label for="kayaEndWeight">Kaya’s end‑weight:</label>
|
||||||
<input type="text" id="kayaEndWeight" value="30 kg" readonly>
|
<input type="text" id="kayaEndWeight" value="30 kg" readonly>
|
||||||
@ -66,9 +68,6 @@
|
|||||||
<div class="dog-calculator-unit-buttons" id="unitButtons" style="display: none;">
|
<div class="dog-calculator-unit-buttons" id="unitButtons" style="display: none;">
|
||||||
<button type="button" class="dog-calculator-unit-btn active" data-unit="g">g</button>
|
<button type="button" class="dog-calculator-unit-btn active" data-unit="g">g</button>
|
||||||
<button type="button" class="dog-calculator-unit-btn" data-unit="kg">kg</button>
|
<button type="button" class="dog-calculator-unit-btn" data-unit="kg">kg</button>
|
||||||
<button type="button" class="dog-calculator-unit-btn" data-unit="oz">oz</button>
|
|
||||||
<button type="button" class="dog-calculator-unit-btn" data-unit="lb">lb</button>
|
|
||||||
<button type="button" class="dog-calculator-unit-btn" data-unit="cups" id="cupsButton" disabled title="Available when using kcal/cup measurement">cups</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Daily Total Results -->
|
<!-- Daily Total Results -->
|
||||||
@ -83,9 +82,6 @@
|
|||||||
<select id="unit" class="dog-calculator-unit-select-hidden" aria-describedby="unitHelp">
|
<select id="unit" class="dog-calculator-unit-select-hidden" aria-describedby="unitHelp">
|
||||||
<option value="g">grams (g)</option>
|
<option value="g">grams (g)</option>
|
||||||
<option value="kg">kilograms (kg)</option>
|
<option value="kg">kilograms (kg)</option>
|
||||||
<option value="oz">ounces (oz)</option>
|
|
||||||
<option value="lb">pounds (lb)</option>
|
|
||||||
<option value="cups">cups</option>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<div class="dog-calculator-food-amounts-section" id="foodAmountsSection" style="display: none;">
|
<div class="dog-calculator-food-amounts-section" id="foodAmountsSection" style="display: none;">
|
||||||
|
|||||||
@ -641,32 +641,15 @@
|
|||||||
// Auto-select cups when entering energy for kcal/cup
|
// Auto-select cups when entering energy for kcal/cup
|
||||||
const foodSource = this.foodSources.find(fs => fs.id === id);
|
const foodSource = this.foodSources.find(fs => fs.id === id);
|
||||||
if (foodSource && foodSource.energyUnit === 'kcalcup' && parseFloat(energyInput.value) > 0) {
|
if (foodSource && foodSource.energyUnit === 'kcalcup' && parseFloat(energyInput.value) > 0) {
|
||||||
|
// Cups display removed; default to grams
|
||||||
const unitSelect = document.getElementById('unit');
|
const unitSelect = document.getElementById('unit');
|
||||||
const cupsButton = document.getElementById('cupsButton');
|
if (unitSelect) {
|
||||||
|
unitSelect.value = 'g';
|
||||||
// First check if cups button will be enabled after update
|
unitSelect.setAttribute('value', 'g');
|
||||||
const willEnableCups = this.foodSources.some(fs =>
|
this.setActiveUnitButton('g');
|
||||||
fs.energyUnit === 'kcalcup' && fs.energy && parseFloat(fs.energy) > 0
|
|
||||||
);
|
|
||||||
|
|
||||||
if (willEnableCups && unitSelect) {
|
|
||||||
// Set cups BEFORE updating calculations
|
|
||||||
unitSelect.value = 'cups';
|
|
||||||
unitSelect.setAttribute('value', 'cups');
|
|
||||||
this.setActiveUnitButton('cups');
|
|
||||||
|
|
||||||
// Enable the cups button manually since we know it will be valid
|
|
||||||
if (cupsButton) {
|
|
||||||
cupsButton.disabled = false;
|
|
||||||
cupsButton.title = 'Show amounts in cups';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now update calculations with cups already selected
|
|
||||||
this.updateFoodCalculations();
|
|
||||||
} else {
|
|
||||||
this.updateFoodCalculations();
|
|
||||||
}
|
}
|
||||||
|
this.updateFoodCalculations();
|
||||||
});
|
});
|
||||||
energyInput.addEventListener('blur', () => this.validateFoodSourceEnergy(id));
|
energyInput.addEventListener('blur', () => this.validateFoodSourceEnergy(id));
|
||||||
}
|
}
|
||||||
@ -685,21 +668,9 @@
|
|||||||
if (unitSelect) {
|
if (unitSelect) {
|
||||||
switch(energyUnitSelect.value) {
|
switch(energyUnitSelect.value) {
|
||||||
case 'kcalcup':
|
case 'kcalcup':
|
||||||
// Check if we have energy value to enable cups
|
// Cups display not available; default to grams
|
||||||
const foodSource = this.foodSources.find(fs => fs.id === id);
|
unitSelect.value = 'g';
|
||||||
if (foodSource && foodSource.energy && parseFloat(foodSource.energy) > 0) {
|
this.setActiveUnitButton('g');
|
||||||
// Set cups BEFORE updating calculations
|
|
||||||
unitSelect.value = 'cups';
|
|
||||||
unitSelect.setAttribute('value', 'cups');
|
|
||||||
this.setActiveUnitButton('cups');
|
|
||||||
|
|
||||||
// Enable the cups button manually
|
|
||||||
const cupsButton = document.getElementById('cupsButton');
|
|
||||||
if (cupsButton) {
|
|
||||||
cupsButton.disabled = false;
|
|
||||||
cupsButton.title = 'Show amounts in cups';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.updateFoodCalculations();
|
this.updateFoodCalculations();
|
||||||
break;
|
break;
|
||||||
case 'kcal100g':
|
case 'kcal100g':
|
||||||
@ -715,9 +686,9 @@
|
|||||||
this.updateFoodCalculations();
|
this.updateFoodCalculations();
|
||||||
break;
|
break;
|
||||||
case 'kcalcan':
|
case 'kcalcan':
|
||||||
// For kcal/can, use grams as default (or ounces in imperial)
|
// For kcal/can, use grams as default
|
||||||
unitSelect.value = this.isImperial ? 'oz' : 'g';
|
unitSelect.value = 'g';
|
||||||
this.setActiveUnitButton(unitSelect.value);
|
this.setActiveUnitButton('g');
|
||||||
this.updateFoodCalculations();
|
this.updateFoodCalculations();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1008,58 +979,14 @@
|
|||||||
imperialLabel.classList.toggle('active', this.isImperial);
|
imperialLabel.classList.toggle('active', this.isImperial);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isImperial) {
|
// Kaya: restrict to metric g/kg only
|
||||||
if (weightLabel) weightLabel.textContent = "Dog's Weight (lbs):";
|
if (unitSelect) {
|
||||||
if (weightInput) {
|
unitSelect.innerHTML = '<option value="g">grams (g)</option>' +
|
||||||
weightInput.placeholder = "Enter weight in lbs";
|
'<option value="kg">kilograms (kg)</option>';
|
||||||
weightInput.min = "0.2";
|
if (!unitSelect.value || (unitSelect.value !== 'g' && unitSelect.value !== 'kg')) {
|
||||||
weightInput.step = "0.1";
|
unitSelect.value = 'g';
|
||||||
|
this.setActiveUnitButton('g');
|
||||||
}
|
}
|
||||||
if (unitSelect) {
|
|
||||||
unitSelect.innerHTML = '<option value="oz">ounces (oz)</option>' +
|
|
||||||
'<option value="lb">pounds (lb)</option>' +
|
|
||||||
'<option value="g">grams (g)</option>' +
|
|
||||||
'<option value="kg">kilograms (kg)</option>';
|
|
||||||
unitSelect.value = 'oz'; // Auto-select ounces for imperial
|
|
||||||
this.setActiveUnitButton('oz'); // Sync unit buttons
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update energy units for all food sources to kcal/cup for imperial
|
|
||||||
this.foodSources.forEach(fs => {
|
|
||||||
if (fs.energyUnit === 'kcal100g') {
|
|
||||||
fs.energyUnit = 'kcalcup';
|
|
||||||
const energyUnitSelect = document.getElementById(`energy-unit-${fs.id}`);
|
|
||||||
if (energyUnitSelect) {
|
|
||||||
energyUnitSelect.value = 'kcalcup';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (weightLabel) weightLabel.textContent = "Dog's Weight (kg):";
|
|
||||||
if (weightInput) {
|
|
||||||
weightInput.placeholder = "Enter weight in kg";
|
|
||||||
weightInput.min = "0.1";
|
|
||||||
weightInput.step = "0.1";
|
|
||||||
}
|
|
||||||
if (unitSelect) {
|
|
||||||
unitSelect.innerHTML = '<option value="g">grams (g)</option>' +
|
|
||||||
'<option value="kg">kilograms (kg)</option>' +
|
|
||||||
'<option value="oz">ounces (oz)</option>' +
|
|
||||||
'<option value="lb">pounds (lb)</option>';
|
|
||||||
unitSelect.value = 'g'; // Auto-select grams for metric
|
|
||||||
this.setActiveUnitButton('g'); // Sync unit buttons
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update energy units for all food sources to kcal/100g for metric
|
|
||||||
this.foodSources.forEach(fs => {
|
|
||||||
if (fs.energyUnit === 'kcalcup') {
|
|
||||||
fs.energyUnit = 'kcal100g';
|
|
||||||
const energyUnitSelect = document.getElementById(`energy-unit-${fs.id}`);
|
|
||||||
if (energyUnitSelect) {
|
|
||||||
energyUnitSelect.value = 'kcal100g';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1242,6 +1169,8 @@
|
|||||||
if (age < 2) { age = 2; if (ageClampNote) ageClampNote.classList.remove('dog-calculator-hidden'); }
|
if (age < 2) { age = 2; if (ageClampNote) ageClampNote.classList.remove('dog-calculator-hidden'); }
|
||||||
if (age > 12) { age = 12; if (ageClampNote) ageClampNote.classList.remove('dog-calculator-hidden'); }
|
if (age > 12) { age = 12; if (ageClampNote) ageClampNote.classList.remove('dog-calculator-hidden'); }
|
||||||
|
|
||||||
|
// Bucket pills removed
|
||||||
|
|
||||||
// Calculate interpolated kibble grams/day for 30 kg at this age
|
// Calculate interpolated kibble grams/day for 30 kg at this age
|
||||||
const kibbleGrams = this.getKayaKibbleGramsForAge(age);
|
const kibbleGrams = this.getKayaKibbleGramsForAge(age);
|
||||||
|
|
||||||
@ -1296,6 +1225,8 @@
|
|||||||
return lowerVal + (upperVal - lowerVal) * t;
|
return lowerVal + (upperVal - lowerVal) * t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateCupsButtonState() {
|
updateCupsButtonState() {
|
||||||
const cupsButton = document.getElementById('cupsButton');
|
const cupsButton = document.getElementById('cupsButton');
|
||||||
if (!cupsButton) return;
|
if (!cupsButton) return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user