Skip to content

Commit e3bf730

Browse files
Day 3 challenge added
1 parent 4f14a9c commit e3bf730

File tree

4 files changed

+93
-1
lines changed

4 files changed

+93
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ visit this [link](https://shubhendrapatel.github.io/JavaScript-30/) for showcase
33

44
| Row 1 | Row2 | Row3 |
55
| ------------- | ------------- |-------------|
6+
67
|- [x] Challange 1 | - [ ] Challange 11 | - [ ] Challange 21|
78
|- [x] Challange 2 | - [ ] Challange 12 | - [ ] Challange 22|
8-
|- [ ] Challange 3 | - [ ] Challange 13 | - [ ] Challange 23|
9+
|- [x] Challange 3 | - [ ] Challange 13 | - [ ] Challange 23|
910
|- [ ] Challange 4 | - [ ] Challange 14 | - [ ] Challange 24|
1011
|- [ ] Challange 5 | - [ ] Challange 15 | - [ ] Challange 25|
1112
|- [ ] Challange 6 | - [ ] Challange 16 | - [ ] Challange 26|
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<link rel="stylesheet" href="style.css" />
8+
<title>Blur The Image</title>
9+
</head>
10+
<body>
11+
<h1>Update CSS variables with <span class="js">JS</span></h1>
12+
13+
<div class="controls">
14+
<label for="spacing">Spacing:</label>
15+
<input
16+
type="range"
17+
value="10"
18+
max="200"
19+
data-sizing="px"
20+
name="spacing"
21+
/>
22+
23+
<label for="blur">Blur:</label>
24+
<input type="range" value="10" max="200" data-sizing="px" name="blur" />
25+
26+
<label for="base-color">Base Color</label>
27+
<input type="color" name="base-color" value="#07a872" />
28+
</div>
29+
30+
<img src="https://picsum.photos/500/500" alt="dummy image" />
31+
32+
<script src="script.js"></script>
33+
</body>
34+
</html>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(function () {
2+
inputs = document.querySelectorAll("input");
3+
4+
inputs.forEach((input) => {
5+
input.addEventListener("change", handleChanges);
6+
input.addEventListener("mousemove", handleChanges);
7+
});
8+
9+
function handleChanges() {
10+
if (this.value === this.dataset.last_value) {
11+
return;
12+
}
13+
const suffix = this.dataset.sizing || "";
14+
15+
document.documentElement.style.setProperty(
16+
`--${this.name}`,
17+
this.value + suffix
18+
);
19+
20+
this.dataset.last_value = this.value;
21+
}
22+
})();
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
:root {
2+
--base-color: #07a872;
3+
--spacing: 10px;
4+
--blur: 10px;
5+
}
6+
7+
body {
8+
padding: 0;
9+
margin: 0;
10+
11+
display: flex;
12+
flex-direction: column;
13+
justify-content: center;
14+
align-items: center;
15+
16+
height: 100vh;
17+
width: 100vw;
18+
19+
background: radial-gradient(circle, #9b1414 21%, #09203f 100%);
20+
color: white;
21+
}
22+
23+
h1 .js {
24+
color: var(--base-color);
25+
}
26+
27+
.controls {
28+
margin-bottom: 20px;
29+
}
30+
31+
img {
32+
padding: var(--spacing);
33+
background-color: var(--base-color);
34+
filter: blur(var(--blur));
35+
}

0 commit comments

Comments
 (0)