randomly shuffle team list in contributors page
MODIFY
website/static/js/index.js
website/static/js/index.js
@@ -9,6 +9,7 @@ const elements = {
headerMobile: document.getElementsByClassName("header-mobile")[0],
colorSchemeSwitch: document.getElementById("color-scheme-switch"),
colorSchemeSwitchText: document.getElementById("color-scheme-switch-text"),
+ teamList: document.getElementsByClassName("team-list")[0],
};
function isMobile() {
@@ -145,6 +146,19 @@ function modeSwitch() {
window.localStorage.setItem("data-theme", theme);
}
+function randomShuffle(array) {
+ let count = array.length;
+ let temp;
+ let index;
+ while (count) {
+ index = Math.floor(Math.random() * count--);
+ temp = array[count];
+ array[count] = array[index];
+ array[index] = temp;
+ }
+
+ return array;
+}
const themeInStorage = window.localStorage.getItem("data-theme");
if (themeInStorage) {
@@ -190,6 +204,10 @@ elements.overlay.addEventListener("touchstart", mobileToggleEvent, false);
window.addEventListener("scroll", handleScroll, false);
elements.colorSchemeSwitch.addEventListener("click", modeSwitch, false);
+const teamArr = Array.from(elements.teamList.getElementsByTagName("li"));
+for (const li of randomShuffles(teamArr)){
+ elements.teamList.appendChild(li);
+}
const homepageExample = document.querySelector(".homepage-example");
if (homepageExample != null) {

randomly shuffle team list in contributors page (#810)

Co-authored-by: Sebastian <853712+sebmck@users.noreply.github.com>