You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
366 B
JavaScript
13 lines
366 B
JavaScript
3 years ago
|
const bubbles = document.querySelectorAll('.bubble')
|
||
|
console.log(bubbles)
|
||
|
|
||
|
let colors = ["--blue","--pink","--orange","--yellow","--green"];
|
||
|
|
||
|
|
||
|
|
||
|
Array.from(bubbles).forEach(bubble=>{
|
||
|
let color = colors[(colors.length * Math.random()) | 0];
|
||
|
bubble.style.backgroundColor = `var(${color})`;
|
||
|
bubble.style.transform = `rotate(${Math.random() * 10 - 5}deg)`
|
||
|
|
||
|
})
|