summaryrefslogtreecommitdiffstats
path: root/content/about/email.js
diff options
context:
space:
mode:
authorDante Catalfamo2020-11-06 10:24:15 -0500
committerDante Catalfamo2020-11-06 10:24:15 -0500
commit675ff57c2e1959070ccf0260a74f080f6fb6d383 (patch)
tree350ba1c58bce84d31a14867e6bd4311a10c7f3db /content/about/email.js
parent0b10d85d9099348c8859765e21b0948167df011b (diff)
downloadblog-675ff57c2e1959070ccf0260a74f080f6fb6d383.tar.gz
blog-675ff57c2e1959070ccf0260a74f080f6fb6d383.tar.bz2
blog-675ff57c2e1959070ccf0260a74f080f6fb6d383.zip
About: Email decode script
Diffstat (limited to 'content/about/email.js')
-rw-r--r--content/about/email.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/content/about/email.js b/content/about/email.js
new file mode 100644
index 0000000..02f3cee
--- /dev/null
+++ b/content/about/email.js
@@ -0,0 +1,12 @@
+"use strict";
+
+function emailDecode() {
+ const emailElement = document.querySelector("code.language-shell");
+ const emailB64 = emailElement.textContent.split('"')[1];
+ const email = atob(emailB64);
+ const mailto = `<a href="mailto:${email}">${email}</a>`;
+ emailElement.outerHTML = mailto;
+}
+
+const emailElement = document.querySelector("code.language-shell");
+emailElement.addEventListener('click', emailDecode);