-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
44 lines (44 loc) · 1.36 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css" />
<title>Document</title>
</head>
<body>
<div>
<strong>Logo width:</strong>
<span id="range-display">300px</span>
<input id="range-selector" type="range" style="width: 100%" min="16" max="8192" step="1" value="300" oninput="sliderOnChange()" />
</div>
<div>
<div class="grid">
<div class="item bg-white">
<img src='src/icon_black.svg' />
<img src='src/text_black.svg' />
</div>
<div class="item bg-black">
<img src='src/icon_white.svg' />
<img src='src/text_white.svg' />
</div>
<div class="item bg-brown400">
<img src='src/icon_black.svg' />
<img src='src/text_black.svg' />
</div>
<div class="item bg-brown500">
<img src='src/icon_white.svg' />
<img src='src/text_white.svg' />
</div>
</div>
</div>
<script>
const rangeSelector = document.querySelector('#range-selector');
const rangeDisplay = document.querySelector('#range-display');
const sliderOnChange = () => {
document.documentElement.style.setProperty('--slider-val', rangeSelector.value + 'px');
rangeDisplay.innerHTML = rangeSelector.value + 'px';
}
</script>
</body>
</html>