-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
27 lines (18 loc) · 699 Bytes
/
script.js
File metadata and controls
27 lines (18 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function openHamburger(hamburger) {
hamburger.classList.toggle("hamburger-open");
}
const home = document.getElementById("home");
const layers = [];
const count = 100; // number of glowing spots
for (let i = 0; i < count; i++) {
const x = Math.random() * 100;
const y = Math.random() * 100;
const size = Math.random() * 0.5; // glow size
const hue = 220 + Math.random() * 40; // bluish glow
const color = `hsla(${hue}, 100%, 80%, 1)`;
layers.push(
`radial-gradient(circle at ${x}% ${y}%, ${color} 0%, transparent ${size}%)`
);
}
layers.push(`radial-gradient(ellipse at center, hsl(240, 20%, 20%) 60%, hsl(0, 0%, 0%) 100%)`)
home.style.backgroundImage = layers.join(",");