-
Notifications
You must be signed in to change notification settings - Fork 0
/
base-converter.html
63 lines (63 loc) · 2.55 KB
/
base-converter.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Base converter</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/png" href="assets/favicon.png"/>
</head>
<body>
<div class="dropdown">
<button class="dropbtn">▼ Menu</button>
<div class="dropdown-content">
<a href="index.html">Base calculator</a>
<a href="text-converter.html">Text converter</a>
</div>
</div>
<h1 id="header">Base converter</h1>
<div class="info">
<p>Base converter is a free to use and open source tool to convert numbers between differnt number-systems.</p>
</div>
<div class="main">
<p>Select the input base:</p>
<select name="inbase" id="inbase">
<option value="bin">2 (Binary)</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="oct">8 (Octal)</option>
<option selected="selected" value="dec">10 (Decimal)</option>
<option onclick="hex()" value="hex">16 (Hexadecimal)</option>
</select>
<p>Select the output base:</p>
<select name="outbase" id="outbase">
<option selected="selected" value="bin">2 (Binary)</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="oct">8 (Octal)</option>
<option value="dec">10 (Decimal)</option>
<option value="hex">16 (Hexadecimal)</option>
</select>
<p>Enter your number:</p>
<input type="number" name="input" id="input">
<p>Here is the result:</p>
<textarea readonly=true id="output" cols="30" rows="2"></textarea>
<div id="calcbtndiv">
<button id="calcbtn" onclick="convert()">convert!</button>
</div>
</div>
<div class="howitworks">
<h2>How it works</h2>
<p>The algorithm is based on the parseInt()-function in JavaScript; It takes the input string as a number with base n
and then converts it into a number with base x.
</p>
</div>
<div class="credits">
<h2>Credits</h2>
<p>Elias Kelta (<a href="https://eliaskelta.netlify.app/">eliaskelta.netlify.app</a>)</p>
<p>Github: <a href="https://github.com/Elxas866/base-calculator">https://github.com/Elxas866/base-calculator</a></p>
</div>
</body>
<script src="convert.js"></script>
</html>