Large Size Joinus Calculator Soup

Large Size Joinus Calculator Soup

Large Size Joinus Calculator Soup

Calculate your large joinus soup size and ingredients.

Not calculated yet.

let soupSteps = “”; const caloriePerGram1 = 2, caloriePerGram2 = 1.5, caloriePerGram3 = 3; function calculateSoup(){ soupSteps=””; const size = parseFloat(document.getElementById(“size”).value); const ingredient1 = parseFloat(document.getElementById(“ingredient1”).value); const ingredient2 = parseFloat(document.getElementById(“ingredient2”).value); const ingredient3 = parseFloat(document.getElementById(“ingredient3”).value); if(isNaN(size) || isNaN(ingredient1) || isNaN(ingredient2) || isNaN(ingredient3) || size <= 0 || ingredient1 <= 0 || ingredient2 <= 0 || ingredient3 <= 0){ alert("Please enter valid positive values for all fields."); return; } const totalCalories = (ingredient1 * caloriePerGram1) + (ingredient2 * caloriePerGram2) + (ingredient3 * caloriePerGram3); document.getElementById("totalCalories").value = totalCalories.toFixed(2); soupSteps += `Inputs:
Soup Size: ${size} liters
Ingredient 1: ${ingredient1}g
Ingredient 2: ${ingredient2}g
Ingredient 3: ${ingredient3}g

`; soupSteps += `Formulas:
Total Calories = Ingredient1 * Calorie per gram + Ingredient2 * Calorie per gram + Ingredient3 * Calorie per gram

`; soupSteps += `Results:
Total Calories: ${totalCalories.toFixed(2)}
`; if(document.getElementById(“calculationStepsSoup”).style.display === “block”){ document.getElementById(“calculationStepsSoup”).innerHTML = soupSteps; } } function resetSoup(){ document.querySelectorAll(“#calculator input”).forEach(el => el.value = “”); soupSteps = “”; document.getElementById(“calculationStepsSoup”).innerHTML = “

Not calculated yet.

“; } function toggleSoupSteps(){ const s = document.getElementById(“calculationStepsSoup”); const a = document.getElementById(“toggleArrowSoup”); if(s.style.display === “none” || s.style.display === “”){ s.style.display = “block”; a.style.transform = “rotate(180deg)”; s.innerHTML = soupSteps || “

Not calculated yet.

“; }else{ s.style.display = “none”; a.style.transform = “rotate(0deg)”; } }

Leave a Reply

Your email address will not be published. Required fields are marked *