-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
56 lines (35 loc) · 1.05 KB
/
main.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
let boxes = document.querySelectorAll(".btn")
let text = document.querySelector("h1")
let big = document.querySelector(".big");
let A = document.querySelector("#A")
let B = document.querySelector("#B")
let C = document.querySelector("#C")
boxes.forEach(element => {
element.addEventListener("click", ()=> {
changecolor(element)
})
});
let changecolor = (colors)=>{
let bgcolor = getComputedStyle (colors).backgroundColor
big.style.backgroundColor = bgcolor
}
A.addEventListener("keyup", function(){
text.style.fontSize = `${A.value}px`;
})
B.addEventListener("keyup", function(){
big.style.borderRadius = `${B.value}px`;
})
C.addEventListener("keyup", function(){
text.style.fontWeight = `${C.value}`;
})
function getSelectValue()
{
var selectedValue = document.getElementById("list").value;
text.style.fontFamily = `${list.value}`;
// console.log(selectedValue);
}
// function color(d){
// let a = getComputedStyle(d)
// let b = a.backgroundColor;
// big.style.backgroundColor = d;
// }