mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
shuffle avatars in website header
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user