shuffle avatars in website header

This commit is contained in:
jomo
2015-10-15 01:46:14 +02:00
parent 882b0753bc
commit 70900a249b
3 changed files with 10 additions and 3 deletions

View File

@@ -31,6 +31,13 @@ xhr.onload = function() {
};
document.addEventListener("DOMContentLoaded", function(event) {
var avatars = document.querySelector("#avatar-wrapper");
for (var i = 0; i < avatars.children.length; i++) {
// shake 'em on down!
// https://stackoverflow.com/a/11972692/2517068
avatars.appendChild(avatars.children[Math.random() * i | 0]);
}
xhr.open("GET", "https://status.mojang.com/check", true);
xhr.send();
});