Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature easter egg username replacements #196

Open
wants to merge 8 commits into
base: next
Choose a base branch
from
19 changes: 13 additions & 6 deletions stregsystem/static/stregsystem/gdpr.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ Simply replaces the letters with 'x'.
var username_element = document.querySelectorAll(".username");

if (username_element.length > 0) {
setTimeout(function () {
var username_element = document.querySelectorAll(".username");
for (var i = 0; i < username_element.length; i++) {
username_element[i].innerText = "xxxxxxxx";
}
}, 5000);
setTimeout(function () {
var username_element = document.querySelectorAll(".username");
var replaced_username = "[username_hidden]";
var date = new Date();
// Only do username memes on April Fools
if (date.getDate() === 1 && date.getMonth() + 1 === 4) {
const easter_egg_names = ["user", "admin", "root", "alan_turing", "hackerman", "hans_huttel"];
falkecarlsen marked this conversation as resolved.
Show resolved Hide resolved
replaced_username = easter_egg_names[Math.floor(Math.random() * easter_egg_names.length)];
}
for (var i = 0; i < username_element.length; i++) {
username_element[i].innerText = replaced_username;
}
}, 5000);
}