updated the gui of the base64 encoder

This commit is contained in:
Boof 2023-03-08 12:25:25 +01:00 committed by GitHub
parent f37754fcff
commit fb0ce2030b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 97 deletions

View File

@ -1,26 +1,36 @@
<h1>Encode/decode data to base64</h1>
<form>
<label>Input data</label><br>
<textarea value="" rows="6" cols="80" id="input" required></textarea><br>
<button type="button" onclick="doencode();">Encode</button>
<button type="button" onclick="dodecode();">Decode</button><br>
<label>Output</label><br>
<textarea id="output" rows="6" cols="80" readonly></textarea><br>
<button type="button" id="copy" onclick="docopy();">Copy</button>
</form>
<head>
<link rel="stylesheet" href="style.css" Type="text/css" media="all">
<title>Base64 encoder and decoder</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<script>
function docopy() {
document.getElementById("output").select();
document.execCommand('copy');
}
<body style="background: #27282c;">
<div style="margin-left: 5em;">
<h1 style="color: #ffffff;">Encode/decode data to base64</h1>
<form>
<label style="color: #ffffff;">Input data</label><br>
<textarea style="background: #343538; color: #ffffff;" value="" rows="6" cols="80" id="input" required></textarea><br>
<button class="button" style="--color:#1e9bff; background: bottom;"type="button" onclick="doencode();">Encode</button>
<button type="button" style= "--color: #ff1867; margin-left: 2em; background: bottom;" class="button" onclick="dodecode();">Decode</button><br>
<label style="color: #ffffff;">Output</label><br>
<textarea style="background: #343538; color: #ffffff;" id="output" rows="6" cols="80" readonly></textarea><br>
<button class="button" type="button" id="copy" style="--color:#1e9bff; background: bottom;" onclick="docopy();">Copy</button>
</form>
</div>
function doencode() {
var output = btoa(document.getElementById("input").value)
document.getElementById("output").value = output;
}
function dodecode() {
var output = atob(document.getElementById("input").value)
document.getElementById("output").value = output;
}
</script>
<script>
function docopy() {
document.getElementById("output").select();
document.execCommand('copy');
}
function doencode() {
var output = btoa(document.getElementById("input").value)
document.getElementById("output").value = output;
}
function dodecode() {
var output = atob(document.getElementById("input").value)
document.getElementById("output").value = output;
}
</script>
</body>

View File

@ -1,37 +0,0 @@
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - Button hover effect</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<div class="container">
<a class="button" href="#" style="--color:#1e9bff;">
<span></span>
<span></span>
<span></span>
<span></span>
Button
</a>
<a class="button" href="#" style="--color: #ff1867;">
<span></span>
<span></span>
<span></span>
<span></span>
Button
</a>
<a class="button" href="#" style="--color: #6eff3e;">
<span></span>
<span></span>
<span></span>
<span></span>
Button
</a>
</div>
<!-- partial -->
</body>
</html>

View File

@ -1,36 +0,0 @@
<head>
<link rel="stylesheet" href="style.css" Type="text/css" media="all">
<title>Base64 encoder and decoder</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body style="background: #27282c;">
<div style="margin-left: 5em;">
<h1 style="color: #ffffff;">Encode/decode data to base64</h1>
<form>
<label style="color: #ffffff;">Input data</label><br>
<textarea style="background: #343538; color: #ffffff;" value="" rows="6" cols="80" id="input" required></textarea><br>
<button class="button" style="--color:#1e9bff; background: bottom;"type="button" onclick="doencode();">Encode</button>
<button type="button" style= "--color: #ff1867; margin-left: 2em; background: bottom;" class="button" onclick="dodecode();">Decode</button><br>
<label style="color: #ffffff;">Output</label><br>
<textarea style="background: #343538; color: #ffffff;" id="output" rows="6" cols="80" readonly></textarea><br>
<button class="button" type="button" id="copy" style="--color:#1e9bff; background: bottom;" onclick="docopy();">Copy</button>
</form>
</div>
<script>
function docopy() {
document.getElementById("output").select();
document.execCommand('copy');
}
function doencode() {
var output = btoa(document.getElementById("input").value)
document.getElementById("output").value = output;
}
function dodecode() {
var output = atob(document.getElementById("input").value)
document.getElementById("output").value = output;
}
</script>
</body>