-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase64.html
34 lines (32 loc) · 1006 Bytes
/
base64.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Tools - Base 64</title>
<script src="components/sidebar-component.js"></script>
<script src="components/header-component.js"></script>
<link href="index.css" rel="stylesheet">
</head>
<body>
<header-component></header-component>
<sidebar-component></sidebar-component>
<main>
<textarea id="encode-content"></textarea>
<span id="encode-output"></span>
<button onclick="encode()">Encode</button>
<textarea id="decode-content"></textarea>
<span id="decode-output"></span>
<button onclick="decode()">Decode</button>
</main>
<script>
function encode() {
const content = document.getElementById('encode-content').value;
document.getElementById('encode-output').innerHTML = btoa(content);
}
function decode() {
const content = document.getElementById('decode-content').value;
document.getElementById('decode-output').innerHTML = atob(content);
}
</script>
</body>
</html>