Verified Commit cf60df09 authored by Thibaut Broggi's avatar Thibaut Broggi
Browse files

Avoid identical colors being chosen on random

      close #4
parent 8a5e28d9
......@@ -129,7 +129,10 @@ let randomElement = function(selector) {
document.getElementById('randomize').onclick = function(e) {
randomElement('input[name="bg-color"]').checked = true;
randomElement('input[name="fg-color"]').checked = true;
do {
randomElement('input[name="fg-color"]').checked = true;
} while (document.querySelector('.colorpicker input[type="radio"][name="bg-color"]:checked').value
== document.querySelector('.colorpicker input[type="radio"][name="fg-color"]:checked').value);
randomElement('input[name="font"]').checked = true;
randomElement('input[name="icon"]').checked = true;
document.getElementById('step2value').value = document.getElementById('step2value').innerText = sampleTexts[Math.trunc(Math.random() * sampleTexts.length)];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment