From 89952d30e2d550d29ff8eb29c51f62a6f0373aa5 Mon Sep 17 00:00:00 2001 From: Boof <97455552+hexahigh@users.noreply.github.com> Date: Thu, 9 Mar 2023 08:03:19 +0100 Subject: [PATCH] update base64 --- tools/Base64/index.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/Base64/index.html b/tools/Base64/index.html index 1b1675d..0deaf31 100644 --- a/tools/Base64/index.html +++ b/tools/Base64/index.html @@ -5,7 +5,7 @@ @@ -36,36 +36,40 @@ setTimeout(resolve, milliseconds); }); } + //Copies the text from the output function docopy() { document.getElementById("output").select(); document.execCommand('copy'); copytext() } - + //Takes care of the encoding function doencode() { var output = btoa(document.getElementById("input").value) document.getElementById("output").value = output; encodetext() } + //Takes care of the decoding function dodecode() { var output = atob(document.getElementById("input").value) document.getElementById("output").value = output; decodetext() } + //How long the text will appear in milliseconds + const textTime = 750 async function copytext() { document.getElementById("copy").innerHTML = "Copied!" - await delay(500) + await delay(textTime) document.getElementById("copy").innerHTML = "Copy" } async function encodetext() { document.getElementById("encodebutton").innerHTML = "Encoded!" - await delay(500) + await delay(textTime) document.getElementById("encodebutton").innerHTML = "Encode" } async function decodetext() { document.getElementById("decodebutton").innerHTML = "Decoded!" - await delay(500) + await delay(textTime) document.getElementById("decodebutton").innerHTML = "Decode" }