Enforce unique colors (#5)

This commit is contained in:
James 2018-01-14 17:14:14 +11:00 committed by Flame Sage
parent 8c4b06759b
commit 09a8db963a

View file

@ -15,6 +15,6 @@ if (navbar) {
}
// Handle random switch colors
const colors = ["orangered", "deepskyblue", "yellow", "deeppink", "lime", "gray"];
document.body.classList.add("switch-left-" + colors[Math.floor(Math.random() * colors.length)]);
let colors = ["orangered", "deepskyblue", "yellow", "deeppink", "lime", "gray"];
document.body.classList.add("switch-left-" + colors.splice(Math.floor(Math.random() * colors.length), 1)[0]);
document.body.classList.add("switch-right-" + colors[Math.floor(Math.random() * colors.length)]);