oe7drt-website/assets/js/text-interaction.js
Dominic Reich 01706732f2
update about page (email obfuscation)
introducing two new javascript files that use browser JS interaction to
reveal the data

moved everything into /assets (from /static) so we also added defer,
devmode choise and integrity to the files, scrumbling their names with
sha256 checksums in extended header partial

also moved lightbox into extended header from _baseof layout
2024-12-26 19:00:04 +01:00

45 lines
1.1 KiB
JavaScript

"use strict";
document.addEventListener("DOMContentLoaded", function () {
const listener = new Listener();
listener.decode = function () {
const email = document.getElementById("text-interaction").firstChild;
email.nodeValue = email.nodeValue
.replace("ity ", ".")
.replaceAll("Y", "y1288")
.replace(" ", "@")
.replace("north", "qtztsjo")
.replace(" side", "smprqmgtunj")
.replaceAll(" ", ".")
.replace(".stream", "yf");
};
listener.on();
});
// Listener
function Listener() {}
Listener.prototype.decode = null;
Listener.prototype.on = function () {
this.listener = this.__onInteraction.bind(this);
document.addEventListener("mouseenter", this.listener, true);
document.addEventListener("focus", this.listener, true);
};
Listener.prototype.off = function () {
document.removeEventListener("mouseenter", this.listener, true);
document.removeEventListener("focus", this.listener, true);
delete this.listener;
};
Listener.prototype.__onInteraction = function () {
this.off();
this.decode();
};