-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
56 lines (48 loc) · 1.79 KB
/
index.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 x = document.getElementById("x-axis").addEventListener("change", (e) => {
// return console.log(e.target.value);
// });
// let y = document.getElementById("y-axis").addEventListener("change", (e) => {
// return console.log(e.target.value);
// });
// let blur = document.getElementById("blur").addEventListener("change", (e) => {
// return console.log(e.target.value);
// });
// let color = document.getElementById("color").addEventListener("change", (e) => {
// return console.log(e.target.value);
// });
// document.getElementById(
// "output"
// ).style.cssText = `text-shadow:${x} ${y} ${blur} ${color}`;
let x = document.getElementById("x-axis").value;
let y = document.getElementById("y-axis").value;
let blur = document.getElementById("blur").value;
let color = document.getElementById("color").value;
document.getElementById("x-axis").addEventListener("input", (e) => {
x = e.target.value;
document.getElementById(
"output"
).style.textShadow = `${x}px ${y}px ${blur}px ${color}`;
});
document.getElementById("y-axis").addEventListener("input", (e) => {
y = e.target.value;
document.getElementById(
"output"
).style.textShadow = `${x}px ${y}px ${blur}px ${color}`;
});
document.getElementById("blur").addEventListener("input", (e) => {
blur = e.target.value;
document.getElementById(
"output"
).style.textShadow = `${x}px ${y}px ${blur}px ${color}`;
});
document.getElementById("color").addEventListener("input", (e) => {
color = e.target.value;
document.getElementById(
"output"
).style.textShadow = `${x}px ${y}px ${blur}px ${color}`;
});
document.body.addEventListener("input", () => {
document.getElementById(
"code"
).innerHTML = `<p>text-shadow:</p> ${x}px ${y}px ${blur}px ${color};`;
});