-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
38 lines (36 loc) · 1.79 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Temperature Converter</title>
<link rel="stylesheet" href="CSS/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<div class="container">
<h1>Temperature Converter</h1>
<form id="converter-form">
<label for="celsius"><i class="fas fa-thermometer-half"></i> Celsius (°C):</label>
<input type="number" id="celsius" name="celsius" placeholder="Enter Celsius">
<label for="fahrenheit"><i class="fas fa-thermometer-three-quarters"></i> Fahrenheit (°F):</label>
<input type="number" id="fahrenheit" name="fahrenheit" placeholder="Enter Fahrenheit">
<button type="button" class="button primary" onclick="convertToFahrenheit()">Convert to Fahrenheit</button>
<button type="button" class="button primary" onclick="convertToCelsius()">Convert to Celsius</button>
<button type="button" class="button secondary" onclick="resetForm()">Reset</button>
</form>
<div id="result"></div>
<div id="calculation-box"></div>
<div class="formula-container">
<h2>Conversion Formulas</h2>
<div class="formula" id="formula-c-to-f">
<p>Celsius to Fahrenheit: <span>C<sub>°F</sub> = (C<sub>°C</sub> × 9/5) + 32</span></p>
</div>
<div class="formula" id="formula-f-to-c">
<p>Fahrenheit to Celsius: <span>C<sub>°C</sub> = (C<sub>°F</sub> - 32) × 5/9</span></p>
</div>
</div>
</div>
<script src="js/script.js"></script>
</body>
</html>