19 lines
1 KiB
JavaScript
19 lines
1 KiB
JavaScript
window.addEventListener("load", (event) => {
|
|
const names = ["James Gunn", "Ben Affleck", "Bill Cosby", "Hillary Clinton", "Rey Emerito", "Beyonce", "James Franco", "Elon Musk", "Donald Trump", "Bill Gates", "Madonna", "John Travolta", "Charles III", "Eminem", "Bruce Willis", "Joe Biden", "George Clooney", "Quentin Tarantino", "Obama", "Bernie Sanders", "Steven Spielberg", "Tom Hanks", "Justin Roiland", "Justin Trudeau", "Angelina Jolie", "Taylor Swift", "George Lopez", "George Lucas", "Steve Huffman", "Mark Zuckerberg", "R. Kelly", "Stephen Hawking", "Prince Andrew", "Alan Dershowitz"];
|
|
shuffleArray(names);
|
|
const tiles = document.getElementsByClassName("tile");
|
|
for(i=0; i<tiles.length; i++) {
|
|
if (!tiles[i].classList.contains("free")) {
|
|
tiles[i].innerText = names[i];
|
|
}
|
|
}
|
|
});
|
|
function shuffleArray(array) {
|
|
for (let i = array.length - 1; i > 0; i--) {
|
|
const j = Math.floor(Math.random() * (i + 1));
|
|
[array[i], array[j]] = [array[j], array[i]];
|
|
}
|
|
}
|
|
function selected(item) {
|
|
item.style.backgroundColor = '#000';
|
|
}
|