Files
isdieselcheaper/index.html
Vasily Davydov 17c01cd79a checkpoint
2026-09-21 14:39:14 +03:00

88 lines
4.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Is Diesel Cheaper?</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="header">
<h2 id="header">Car Cost Comparison</h2>
<div class="buttons">
<div class="button-toggle" id="language-toggle">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
<!--!Font Awesome Free v7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M192 64C209.7 64 224 78.3 224 96L224 128L352 128C369.7 128 384 142.3 384 160C384 177.7 369.7 192 352 192L342.4 192L334 215.1C317.6 260.3 292.9 301.6 261.8 337.1C276 345.9 290.8 353.7 306.2 360.6L356.6 383L418.8 243C423.9 231.4 435.4 224 448 224C460.6 224 472.1 231.4 477.2 243L605.2 531C612.4 547.2 605.1 566.1 589 573.2C572.9 580.3 553.9 573.1 546.8 557L526.8 512L369.3 512L349.3 557C342.1 573.2 323.2 580.4 307.1 573.2C291 566 283.7 547.1 290.9 531L330.7 441.5L280.3 419.1C257.3 408.9 235.3 396.7 214.5 382.7C193.2 399.9 169.9 414.9 145 427.4L110.3 444.6C94.5 452.5 75.3 446.1 67.4 430.3C59.5 414.5 65.9 395.3 81.7 387.4L116.2 370.1C132.5 361.9 148 352.4 162.6 341.8C148.8 329.1 135.8 315.4 123.7 300.9L113.6 288.7C102.3 275.1 104.1 254.9 117.7 243.6C131.3 232.3 151.5 234.1 162.8 247.7L173 259.9C184.5 273.8 197.1 286.7 210.4 298.6C237.9 268.2 259.6 232.5 273.9 193.2L274.4 192L64.1 192C46.3 192 32 177.7 32 160C32 142.3 46.3 128 64 128L160 128L160 96C160 78.3 174.3 64 192 64zM448 334.8L397.7 448L498.3 448L448 334.8z"/>
</svg>
</div>
<div class="button-toggle" id="dark-mode-toggle">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M512 320C512 214 426 128 320 128L320 512C426 512 512 426 512 320zM64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320z"/></svg>
</div>
</div>
</div>
<div class="input-grid">
<!-- Diesel Inputs -->
<div class="input-group">
<label id="dTaxLabel">Diesel Annual Tax (€)</label>
<input type="number" id="dTax" value="600" oninput="calculate()">
</div>
<div class="input-group">
<label id="dPriceLabel">Diesel Price per Liter (€)</label>
<input type="number" id="dPrice" value="2.51" step="0.01" oninput="calculate()">
</div>
<div class="input-group">
<label id="dConsLabel">Diesel Consumption (L/100km)</label>
<input type="number" id="dCons" value="5.5" step="0.1" oninput="calculate()">
</div>
<!-- Petrol Inputs -->
<div class="input-group">
<label id="pTaxLabel">Petrol Annual Tax (€)</label>
<input type="number" id="pTax" value="200" oninput="calculate()">
</div>
<div class="input-group">
<label id="pPriceLabel">Petrol Price per Liter (€)</label>
<input type="number" id="pPrice" value="2.32" step="0.01" oninput="calculate()">
</div>
<div class="input-group">
<label id="pConsLabel">Petrol Consumption (L/100km)</label>
<input type="number" id="pCons" value="6.2" step="0.1" oninput="calculate()">
</div>
</div>
<div class="input-group" style="margin-bottom: 20px; max-width: 300px; margin-left: auto; margin-right: auto;">
<label id="annualKmLabel">Your Annual Distance (km) for Break-even</label>
<input type="number" id="annualKm" value="17500" oninput="calculate()">
</div>
<div class="result-box">
<span id="resultText1">To offset the tax difference at </span><span id="displayKm">17500</span> <span id="resultText2">km/year,
a petrol car would need to consume at least </span><b id="breakEvenCons">0.00</b><span id="resultText3">L/100km,
or the diesel price should be at least </span> <b id="minDieselPrice">0.00</b> <span id="resultText4">€/L.</span>
</div>
<table id="comparisonTable">
<thead>
<tr>
<th id="tableDistance">Annual Distance</th>
<th id="tableDieselTotal">Diesel Total</th>
<th id="tablePetrolTotal">Petrol Total</th>
<th id="tableDifference">Difference</th>
</tr>
</thead>
<tbody>
<!-- Rows generated by JS -->
</tbody>
</table>
</div>
<script src="languages.js"></script>
<script src="fuel-calc.js"></script>
</body>
</html>