From 31edd556c61d0adfbb7eb521eb7cc6ac100ea45e Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Sat, 13 Apr 2024 22:32:32 +0300 Subject: [PATCH] SSH and PGP keys added, changed icon --- copyPGP.js | 41 +++++++++++++++++++++++++++++++++++++++++ copySSH.js | 41 +++++++++++++++++++++++++++++++++++++++++ hedgehog.png | Bin 0 -> 1776 bytes id_rsa.pub | 1 + index.html | 44 +++++++++++++++++++++++++++++++++++--------- pgp.pub | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 169 insertions(+), 9 deletions(-) create mode 100644 copyPGP.js create mode 100644 copySSH.js create mode 100644 hedgehog.png create mode 100644 id_rsa.pub create mode 100644 pgp.pub 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 the 
 tag
+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 the 
 tag
+  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 the 
 element
+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 the 
 tag
+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 the 
 tag
+  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 0000000000000000000000000000000000000000..950bccb558a67c473b6f723e8773f5e1bef86bcf
GIT binary patch
literal 1776
zcmV95fUJ1
zRM9U*Dy1N#s-j2`iGFKDQblc(lF$^gG_f&`<0X#wZ5(^{ef(zL<3no49*?C|2qC2Y
zrTgKY`_B3Q&pG$Ld*M_3A7KyhDp0w~CIH_927oAV;J-#L3PR3hF)P5EAKMJTX{W`c
zbhb1pbrntpc)7^W1$+)@2gFi=OBzeycb%mK+|DPSdbEQ|M;TH<
z2ABmjz_);Zh@vp>w3sd$w3;s9ol=3-8xVd47z9RuM@%~H)^>k2fl!QUmt8x#7`|NP
zvU?Bh+KyVKLdqA&E-e8x0|RcG#lN$$mQ9szvN?$>gJbkeOjq2mfFJ2KnqOrlDGWRW
z>~E~BKqZQ}?N&OsHgV=!pZCd*Hq^xr0I5ulzKL0;Ly{^y4301(lnc~uU5wwHKF`j^nhn>rYBf%)8IQe;dXI~3^$%dy=?wFc*ke+mFk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