-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
41 lines (25 loc) · 843 Bytes
/
index.js
File metadata and controls
41 lines (25 loc) · 843 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const inputs=document.querySelectorAll(".wrapper input");
const box=document.querySelector(".boxCont");
const scale=document.getElementById("scale")
const Blur=document.getElementById("blur")
const color=document.getElementById("color")
function change() {
const suffix=this.dataset.sizings|| '';
if (!suffix){
console.log(this.value)
box.style.boxShadow=`0px 0px 10px 5px ${this.value}`;
}
if(this.name==="space"){
scale.textContent=`SPACING: ${this.value}px`;
}
else if(this.name=="blur"){
Blur.textContent=`BLUR: ${this.value}px`;
}
else{
color.textContent=`COLOR: ${this.value}`;
}
document.documentElement.style.setProperty(`--${this.name}`,this.value+suffix);
}
inputs.forEach((input)=>{
input.addEventListener("input",change);
})