diff --git a/copyPGP.js b/copyPGP.js new file mode 100644 index 0000000..ff02292 --- /dev/null +++ b/copyPGP.js @@ -0,0 +1,41 @@ +// Get the
element +const PGP = document.getElementById("myPGP"); + +//Create a copy button element +const copyButton = document.createElement("span"); +copyButton.innerText = "Copy"; +copyButton.classList.add("copy-button"); + +// Append the copy button to thetag +PGP.appendChild(copyButton); + +// Add click event listener to the copy button +copyButton.addEventListener("click", () => { + // Hide the copy button temporarily + copyButton.style.display = "none"; + + // Create a range and select the text inside thetag + const range = document.createRange(); + range.selectNode(PGP); + window.getSelection().removeAllRanges(); + window.getSelection().addRange(range); + + try { + // Copy the selected text to the clipboard + document.execCommand("copy"); + + // Alert the user that the text has been copied + copyButton.innerText = "Copied!"; + setTimeout(function(){ + copyButton.innerText = "Copy"; + }, 2000); + } catch (err) { + console.error("Unable to copy text:", err); + } finally { + // Show the copy button again + copyButton.style.display = "inline"; + + // Deselect the text + window.getSelection().removeAllRanges(); + } +}); diff --git a/copySSH.js b/copySSH.js new file mode 100644 index 0000000..eb0d8eb --- /dev/null +++ b/copySSH.js @@ -0,0 +1,41 @@ +// Get theelement +const SSH = document.getElementById("mySSH"); + +//Create a copy button element +const copyButtonSSH = document.createElement("span"); +copyButtonSSH.innerText = "Copy"; +copyButtonSSH.classList.add("copy-button"); + +// Append the copy button to thetag +SSH.appendChild(copyButtonSSH); + +// Add click event listener to the copy button +copyButtonSSH.addEventListener("click", () => { + // Hide the copy button temporarily + copyButtonSSH.style.display = "none"; + + // Create a range and select the text inside thetag + const range = document.createRange(); + range.selectNode(SSH); + window.getSelection().removeAllRanges(); + window.getSelection().addRange(range); + + try { + // Copy the selected text to the clipboard + document.execCommand("copy"); + + // Alert the user that the text has been copied + copyButtonSSH.innerText = "Copied!"; + setTimeout(function(){ + copyButtonSSH.innerText = "Copy"; + }, 2000); + } catch (err) { + console.error("Unable to copy text:", err); + } finally { + // Show the copy button again + copyButtonSSH.style.display = "inline"; + + // Deselect the text + window.getSelection().removeAllRanges(); + } +}); diff --git a/hedgehog.png b/hedgehog.png new file mode 100644 index 0000000..950bccb Binary files /dev/null and b/hedgehog.png differ diff --git a/id_rsa.pub b/id_rsa.pub new file mode 100644 index 0000000..3667e08 --- /dev/null +++ b/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC//ljrf65xbFyGmy/xeZs5GZvkmufCioqIGYguR3c8c/Ff9HiA4oMRT53Qs16KMuXRg62NusVQvJsvyPRSARpBFsoPiZ/YNBteWlqT1aVqeZwPOfUfFycQ2T8a9qtDnZ0WhamSlJMSAHQPkxXNA6S2ZE9y+dMzMc5qPeRwdsQmuvkxjual/35t9qTgCAG7LvKCKPJkLL5YpwLoqWYWTqSJ6RxNLTYNgIhJBZirzB5rNiFDDupnOuTKSpyRJNxyBSapNge5rCnGQYIeoJ4fi+FTi5wzjlC3hC0BN4Oc/zrm1nS9lyPXQS8KV5/vcQlPrvYZmv0LneeQ/gH/jJsSlwRp2qIatoASSfTlz1y1bOOYtPFojJPikXiXeZMCdlam1II6B94z1ybOIO8TqyKDVs4eHRFfYO72zv0sGsTr7t0C7+N9Wrpmhk38zdlLagZ6HO7KSyoAHm+fQc58fXmOhz4vfYrbmYRPgO0VO03fEb7lSFPPLaSseT0tayli05irJpc= asxpi@meow diff --git a/index.html b/index.html index 606b0ec..37b9c12 100644 --- a/index.html +++ b/index.html @@ -2,13 +2,39 @@asxpi - + +