-
Notifications
You must be signed in to change notification settings - Fork 0
/
text-converter.html
57 lines (57 loc) · 2.32 KB
/
text-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
<!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>Text 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="base-converter.html">Base converter</a>
<a href="index.html">Base calculator</a>
</div>
</div>
<h1 id="header">Text converter</h1>
<div class="info">
<p>Text converter is a free and open source tool to convert text to a number with base n.</p>
</div>
<div class="main">
<p>Select the base:</p>
<select name="base" id="base">
<option 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 text:</p>
<textarea id="input" cols="30" rows="5" placeholder="All languages are supported! You can also use emojis."></textarea>
<div id="calcbtndiv">
<button id="calcbtn" onclick="text()">convert!</button>
</div>
<p>Here is the result:</p>
<textarea readonly=true id="output" cols="30" rows="5"></textarea>
<div id="calcbtndiv">
<button id="calcbtn" onclick="copy()">📋</button>
</div>
</div>
<div class="howitworks">
<h2>How it works</h2>
<p>The algorithm is based on the charCodeAt()-function in JavaScript; It iterates through the input string and reads the elements
UNICODE index. It then converts the decimal number into a number with base n and outputs the result.
</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="text_converter.js"></script>
</html>