+ 4

I am having a problem to create star animation in this code👇👇 using JavaScript

https://code.sololearn.com/W0FfkeGpmb1f/?ref=app

31st Aug 2020, 9:18 AM
Divyansh Singh
Divyansh Singh - avatar
3 RĂ©ponses
+ 2
window.onload= ()=>{ //change function stars(){ let count = 50; let scene = document.querySelector('.scene'); let i = 0 ; //change while(i < count){ let star = document.createElement('i'); let x = Math.floor(Math.random() * window.innerWidth); let duration = Math.random() * 1; let h = Math.random() * 100; star.style.left = x + 'px'; star.style.width = 1 + 'px'; star.style.background = "white";//change star.style.height = 50 + h + 'px'; star.style.animationDuration = duration + 's'; scene.appendChild(star);//change i++ } } stars(); } I have mentioned where applied changes
31st Aug 2020, 10:46 AM
Divya Mohan
Divya Mohan - avatar
+ 4
Thanks bro 😊 for helping me
31st Aug 2020, 12:38 PM
Divyansh Singh
Divyansh Singh - avatar
+ 2
If you want code tell me so.
31st Aug 2020, 10:46 AM
Divya Mohan
Divya Mohan - avatar