Add files via upload
This commit is contained in:
parent
709d5ef164
commit
c2b8358706
BIN
100_projects/77-control-brightness/bg.jpg
Normal file
BIN
100_projects/77-control-brightness/bg.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
19
100_projects/77-control-brightness/index.html
Normal file
19
100_projects/77-control-brightness/index.html
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>document</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="brightness-box">
|
||||||
|
<i class="far fa-sun"></i>
|
||||||
|
<input type="range" id="range" min="10" max="100" value="100">
|
||||||
|
<i class="fas fa-sun"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
6
100_projects/77-control-brightness/main.js
Normal file
6
100_projects/77-control-brightness/main.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
rangeInput = document.getElementById('range');
|
||||||
|
container = document.getElementsByClassName('container')[0];
|
||||||
|
|
||||||
|
rangeInput.addEventListener("change",function(){
|
||||||
|
container.style.filter = "brightness(" + rangeInput.value + "%)";
|
||||||
|
});
|
43
100_projects/77-control-brightness/style.css
Normal file
43
100_projects/77-control-brightness/style.css
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
*{
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.container{
|
||||||
|
background: url(bg.jpg) no-repeat center;
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.brightness-box{
|
||||||
|
width: 400px;
|
||||||
|
height: 60px;
|
||||||
|
background: #f9f9f9;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 0 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.brightness-box i{
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
#range{
|
||||||
|
width: 100%;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
background: #0a85ff;
|
||||||
|
height: 3px;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
#range::-webkit-slider-thumb{
|
||||||
|
-webkit-appearance: none;
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
background: #333;
|
||||||
|
border-radius: 50%;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user