forked from argonjs/tools.argonjs.io
-
Notifications
You must be signed in to change notification settings - Fork 1
/
calibrate.js
29 lines (24 loc) · 850 Bytes
/
calibrate.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
window.onload = () => {
const phoneSelect = document.getElementById("phoneSelect");
const fovDiv = document.getElementById("fovDiv");
const fovSlider = document.getElementById("fovSlider");
let fov = 90;
phoneSelect.addEventListener("change", (event) => {
const newValue = Number(event.target.value);
if (newValue < 0) {
fovDiv.hidden = false;
fov = Number(fovSlider.value);
window.localStorage.setItem("fov", fov);
} else {
fovDiv.hidden = true;
fov = newValue;
window.localStorage.setItem("fov", fov);
}
console.log(fov);
});
fovSlider.addEventListener("change", (event) => {
fov = Number(event.target.value);
window.localStorage.setItem("fov", fov);
console.log(fov);
});
};