.exe files will only function on a PC
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body { font-family: Arial, sans-serif; max-width: 420px; margin: 40px auto; }
input, select { margin: 10px 0; width: 100%; padding: 8px; }
button { padding: 10px; width: 100%; background-color: #ef5350; color: white; border: none; }
#ratios { margin-top: 20px; font-weight: bold; }
</style>
</head>
<body>
<label>Total Volume:</label>
<input type="number" id="totalVolume" placeholder="e.g. 2">
<select id="totalUnit">
<option value="litres">Litres</option>
<option value="gallons">Gallons</option>
</select>
<label>Sugar Unit Preference:</label>
<select id="sugarUnit">
<option value="kilograms">Kilograms</option>
<option value="pounds">Pounds</option>
</select>
<button onclick="calculateSyrup()">Show Breakdown</button>
<div id="ratios"></div>
<script>
function convertToLitres(value, unit) {
return unit === 'gallons' ? value * 3.78541 : value;
}
function convertLitresToSugarWeight(litres, unit) {
let kg = litres * 1;
return unit === 'pounds' ? kg * 2.20462 : kg;
}
function calculateSyrup() {
let totalRaw = parseFloat(document.getElementById('totalVolume').value);
let totalUnit = document.getElementById('totalUnit').value;
let sugarUnit = document.getElementById('sugarUnit').value;
let ratioText = '';
if (isNaN(totalRaw)) {
ratioText = 'Please enter the total syrup volume.';
} else {
let totalL = convertToLitres(totalRaw, totalUnit);
let half = totalL / 2;
let twoToOneSugar = (2 / 3) * totalL;
let twoToOneWater = totalL - twoToOneSugar;
let oneToOneWeight = convertLitresToSugarWeight(half, sugarUnit);
let twoToOneWeight = convertLitresToSugarWeight(twoToOneSugar, sugarUnit);
ratioText = `
1:1 Ratio → Sugar: ${oneToOneWeight.toFixed(2)} ${sugarUnit}, Water: ${half.toFixed(2)} L<br>
2:1 Ratio → Sugar: ${twoToOneWeight.toFixed(2)} ${sugarUnit}, Water: ${twoToOneWater.toFixed(2)} L
`;
}
document.getElementById('ratios').innerHTML = ratioText;
}
</script>
</body>
</html>
Copyright © 2025 schimanskibees.ca - All Rights Reserved.
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.