Combined Values Calculator
AMA Guides 5th Ed
(Input values, OK to leave values blank)
Calculator const handEmojis = ["✊", "☝️", "✌️", "🤟", "🖖", "🖐️"]; let animationInterval; function startAnimation() { let index = 0; const loadingElement = document.getElementById('loadingAnimation'); loadingElement.style.display = 'block'; animationInterval = setInterval(() => { loadingElement.textContent = handEmojis[index]; index = (index + 1) % handEmojis.length; }, 300); } function stopAnimation() { clearInterval(animationInterval); document.getElementById('loadingAnimation').style.display = 'none'; } function getInputValue(id) { const value = document.getElementById(id).value; return value === '' ? 0 : parseFloat(value); } document.getElementById('calculatorForm').addEventListener('submit', function(e) { e.preventDefault(); const value1 = getInputValue('value1'); const value2 = getInputValue('value2'); const value3 = getInputValue('value3'); const value4 = getInputValue('value4'); const value5 = getInputValue('value5'); startAnimation(); fetch('https://hook.us1.make.com/sbzdpydsr7zjfozi1n3nmmyq3llxwc5g', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ value1: value1, value2: value2, value3: value3, value4: value4, value5: value5 }) }) .then(response => response.json()) .then(data => { document.getElementById('combinedResult').value = data.result; document.getElementById('ueToWpiResult').value = data.ueToWpi; document.getElementById('leToWpiResult').value = data.leToWpi; stopAnimation(); }) .catch((error) => { console.error('Error:', error); stopAnimation(); }); });