This commit is contained in:
Dayowe 2025-06-09 10:12:28 +02:00
parent d3bec564a9
commit 28f5a459dd
2 changed files with 30 additions and 0 deletions

View File

@ -724,8 +724,14 @@
.dog-calc-share-copy { background: #f19a5f; }
.dog-calc-share-copy:hover { background: #e87741; transform: translateY(-1px); }
.dog-calc-share-url {
display: flex;
width: 100%;
}
.dog-calc-share-url input {
flex: 1;
width: 100%;
padding: 10px 16px;
border: 1px solid #e8e3ed;
border-radius: 6px;
@ -1301,6 +1307,7 @@
const weightLabel = this.container.querySelector('#weightLabel');
const weightInput = this.container.querySelector('#weight');
const unitSelect = this.container.querySelector('#unit');
const energyUnitSelect = this.container.querySelector('#energyUnit');
if (metricLabel && imperialLabel) {
metricLabel.classList.toggle('active', !this.isImperial);
@ -1322,6 +1329,10 @@
<option value="kg">kilograms (kg)</option>
`;
}
// Set energy unit to kcal/cup for imperial
if (energyUnitSelect && energyUnitSelect.value === 'kcal100g') {
energyUnitSelect.value = 'kcalcup';
}
} else {
if (weightLabel) weightLabel.textContent = "Dog's Weight (kg):";
if (weightInput) {
@ -1337,6 +1348,10 @@
<option value="lb">pounds (lb)</option>
`;
}
// Set energy unit to kcal/100g for metric
if (energyUnitSelect && energyUnitSelect.value === 'kcalcup') {
energyUnitSelect.value = 'kcal100g';
}
}
}

View File

@ -726,8 +726,14 @@
.dog-calculator-share-copy { background: #f19a5f; }
.dog-calculator-share-copy:hover { background: #e87741; transform: translateY(-1px); }
.dog-calculator-share-url {
display: flex;
width: 100%;
}
.dog-calculator-share-url input {
flex: 1;
width: 100%;
padding: 10px 16px;
border: 1px solid #e8e3ed;
border-radius: 6px;
@ -1243,6 +1249,7 @@
const weightLabel = document.getElementById('weightLabel');
const weightInput = document.getElementById('weight');
const unitSelect = document.getElementById('unit');
const energyUnitSelect = document.getElementById('energyUnit');
if (metricLabel && imperialLabel) {
metricLabel.classList.toggle('active', !this.isImperial);
@ -1262,6 +1269,10 @@
'<option value="g">grams (g)</option>' +
'<option value="kg">kilograms (kg)</option>';
}
// Set energy unit to kcal/cup for imperial
if (energyUnitSelect && energyUnitSelect.value === 'kcal100g') {
energyUnitSelect.value = 'kcalcup';
}
} else {
if (weightLabel) weightLabel.textContent = "Dog's Weight (kg):";
if (weightInput) {
@ -1275,6 +1286,10 @@
'<option value="oz">ounces (oz)</option>' +
'<option value="lb">pounds (lb)</option>';
}
// Set energy unit to kcal/100g for metric
if (energyUnitSelect && energyUnitSelect.value === 'kcalcup') {
energyUnitSelect.value = 'kcal100g';
}
}
}