-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
45 lines (40 loc) · 1.34 KB
/
script.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
var header = document.getElementById("header");
var navigationHeader = document.getElementById("navigation_header");
var tittles = document.getElementById("tittles");
var questions = document.getElementById("questions");
var showSidebar = false;
function toggleSidebar() {
showSidebar = !showSidebar;
if (showSidebar) {
navigationHeader.style.marginLeft = "-10vw";
navigationHeader.style.animationName = "showSidebar";
tittles.style.filter = "blur(2px)";
questions.style.filter = "blur(2px)";
} else {
navigationHeader.style.marginLeft = "-100vw";
navigationHeader.style.animationName = "";
tittles.style.filter = "";
questions.style.filter = "";
}
}
function closeSideBar() {
if (showSidebar) {
toggleSidebar();
}
}
window.addEventListener("resize", function (event) {
if (this.window.innerWidth > 768 && showSidebar) {
toggleSidebar();
}
})
const slideValue = document.querySelector("span");
const inputSlider = document.getElementById("inivel");
inputSlider.oninput = (() => {
let value = inputSlider.value;
slideValue.textContent = value;
slideValue.style.left = (value * 2) + "%";
slideValue.classList.add("show");
});
inputSlider.onblur = (() => {
slideValue.classList.remove("show");
});