-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (54 loc) · 2.39 KB
/
Copy pathindex.html
File metadata and controls
54 lines (54 loc) · 2.39 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!-- Author: Bocaletto Luca -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Unit Converter - JavaScript</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS from CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="converter-unit.css">
</head>
<body>
<header><h1 class="text-center mb-4">Unit Converter</h1></header>
<div class="container my-4">
<div class="card">
<div class="card-body">
<!-- Conversion Type Selection -->
<div class="mb-3">
<label for="conversionType" class="form-label">Conversion Type:</label>
<select id="conversionType" class="form-select">
<option value="Length" selected>Length</option>
<option value="Weight">Weight</option>
<option value="Temperature">Temperature</option>
</select>
</div>
<!-- Input Value -->
<div class="mb-3">
<label for="inputValue" class="form-label">Value:</label>
<input type="number" id="inputValue" class="form-control" placeholder="Enter value to convert">
</div>
<!-- From Unit -->
<div class="mb-3">
<label for="fromUnit" class="form-label">From:</label>
<select id="fromUnit" class="form-select"></select>
</div>
<!-- To Unit -->
<div class="mb-3">
<label for="toUnit" class="form-label">To:</label>
<select id="toUnit" class="form-select"></select>
</div>
<!-- Convert Button -->
<button id="convertButton" class="btn btn-primary">Convert</button>
<!-- Result Display -->
<div id="result" class="mt-3 alert alert-info" role="alert" style="display: none;"></div>
</div>
</div>
</div>
<!-- Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Converter JavaScript -->
<script src="converter-unit.js"></script>
</body>
</html>