-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
19 lines (18 loc) · 701 Bytes
/
Copy pathscript.js
File metadata and controls
19 lines (18 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Membuat bintang secara acak
for (let i = 0; i < 150; i++) {
const star = document.createElement('div');
star.classList.add('star');
star.style.top = Math.random() * 100 + 'vh';
star.style.left = Math.random() * 100 + 'vw';
star.style.animationDelay = Math.random() * 2 + 's';
document.body.appendChild(star);
}
// Membuat meteor jatuh
for (let i = 0; i < 10; i++) {
const meteor = document.createElement('div');
meteor.classList.add('meteor');
meteor.style.top = Math.random() * -100 + 'vh';
meteor.style.left = Math.random() * 100 + 'vw';
meteor.style.animationDelay = Math.random() * 5 + 's';
document.body.appendChild(meteor);
}