summaryrefslogtreecommitdiffstats
path: root/content/about/email.js
diff options
context:
space:
mode:
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);