Skip to content

Instantly share code, notes, and snippets.

@alicethewhale
Created December 14, 2018 11:19
Show Gist options
  • Save alicethewhale/1f0efe4b425e2b6e94d2b68cc51ee05b to your computer and use it in GitHub Desktop.
Save alicethewhale/1f0efe4b425e2b6e94d2b68cc51ee05b to your computer and use it in GitHub Desktop.
function twinkle() {
if (lightsContainer.hasChildNodes()) {
Array.from(lightsContainer.querySelectorAll('circle')).forEach(light => {
light.setAttribute('r', `${Math.random()+1}`);
});
}
}
setInterval(twinkle, 500);
twinkle();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment