mirror of
https://github.com/hexahigh/games.git
synced 2025-12-11 20:15:38 +01:00
added it to the rest of the buttons
This commit is contained in:
parent
58d912614c
commit
683a349f5c
@ -16,9 +16,9 @@
|
|||||||
<label style="color: #ffffff;">Input data</label><br>
|
<label style="color: #ffffff;">Input data</label><br>
|
||||||
<textarea style="width: 90%; background: #343538; color: #ffffff;" value="" rows="6" cols="80" id="input"
|
<textarea style="width: 90%; background: #343538; color: #ffffff;" value="" rows="6" cols="80" id="input"
|
||||||
required></textarea><br>
|
required></textarea><br>
|
||||||
<button class="button" style="--color:#1e9bff; background: bottom;" type="button"
|
<button class="button" id="encodebutton" style="--color:#1e9bff; background: bottom;" type="button"
|
||||||
onclick="doencode();">Encode</button>
|
onclick="doencode();">Encode</button>
|
||||||
<button type="button" style="--color: #ff1867; margin-left: 2em; background: bottom;" class="button"
|
<button type="button" id="decodebutton" style="--color: #ff1867; margin-left: 2em; background: bottom;" class="button"
|
||||||
onclick="dodecode();">Decode</button><br>
|
onclick="dodecode();">Decode</button><br>
|
||||||
<label style="color: #ffffff;">Output</label><br>
|
<label style="color: #ffffff;">Output</label><br>
|
||||||
<textarea style="width: 90%; background: #343538; color: #ffffff;" id="output" rows="6" cols="80"
|
<textarea style="width: 90%; background: #343538; color: #ffffff;" id="output" rows="6" cols="80"
|
||||||
@ -39,15 +39,18 @@
|
|||||||
function docopy() {
|
function docopy() {
|
||||||
document.getElementById("output").select();
|
document.getElementById("output").select();
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
|
copytext()
|
||||||
}
|
}
|
||||||
|
|
||||||
function doencode() {
|
function doencode() {
|
||||||
var output = btoa(document.getElementById("input").value)
|
var output = btoa(document.getElementById("input").value)
|
||||||
document.getElementById("output").value = output;
|
document.getElementById("output").value = output;
|
||||||
|
encodetext()
|
||||||
}
|
}
|
||||||
function dodecode() {
|
function dodecode() {
|
||||||
var output = atob(document.getElementById("input").value)
|
var output = atob(document.getElementById("input").value)
|
||||||
document.getElementById("output").value = output;
|
document.getElementById("output").value = output;
|
||||||
|
decodetext()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function copytext() {
|
async function copytext() {
|
||||||
@ -55,5 +58,15 @@
|
|||||||
await delay(500)
|
await delay(500)
|
||||||
document.getElementById("copy").innerHTML = "Copy"
|
document.getElementById("copy").innerHTML = "Copy"
|
||||||
}
|
}
|
||||||
|
async function encodetext() {
|
||||||
|
document.getElementById("encodebutton").innerHTML = "Encoded!"
|
||||||
|
await delay(500)
|
||||||
|
document.getElementById("encodebutton").innerHTML = "Encode"
|
||||||
|
}
|
||||||
|
async function decodetext() {
|
||||||
|
document.getElementById("decodebutton").innerHTML = "Decoded!"
|
||||||
|
await delay(500)
|
||||||
|
document.getElementById("decodebutton").innerHTML = "Decode"
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
Loading…
x
Reference in New Issue
Block a user