remove mobile support

This commit is contained in:
maaa 2024-06-24 21:42:46 +02:00
parent e95c4fba7f
commit b1a0603940
1 changed files with 0 additions and 84 deletions

View File

@ -72,90 +72,6 @@ let indiv = false
let mobile = false let mobile = false
let selectLatestNote = false let selectLatestNote = false
if (/Android|iPhone|iPod/i.test(navigator.userAgent)) {
mobile = true
noteBoxDiv.classList.add("mobile");
noteBoxDiv.style.width = "0px";
notesBar.style.width = "85%"
noteBoxDiv.readOnly = true
noteBox.style.fontSize = "18px"
noteBoxDiv.classList.add("hidden")
let touchstartX, touchstartY, touchendX, touchendY
notesBar.addEventListener("touchstart", function (event) {
touchstartX = event.changedTouches[0].screenX;
touchstartY = event.changedTouches[0].screenY;
}, false);
notesBar.addEventListener("touchend", function (event) {
touchendX = event.changedTouches[0].screenX;
touchendY = event.changedTouches[0].screenY;
if (touchendX < touchstartX - 75) {
handleGesture();
}
}, false);
noteBox.addEventListener("touchstart", function (event) {
touchstartX = event.changedTouches[0].screenX;
touchstartY = event.changedTouches[0].screenY;
}, false);
noteBox.addEventListener("touchend", function (event) {
touchendX = event.changedTouches[0].screenX;
touchendY = event.changedTouches[0].screenY;
if (touchendX > touchstartX + 75) {
handleGesture();
} else if (touchendX < touchstartX - 75) {
enableMarkdown();
}
}, false);
markdown.addEventListener("touchstart", function (event) {
touchstartX = event.changedTouches[0].screenX;
touchstartY = event.changedTouches[0].screenY;
}, false);
markdown.addEventListener("touchend", function (event) {
touchendX = event.changedTouches[0].screenX;
touchendY = event.changedTouches[0].screenY;
if (touchendX > touchstartX + 75) {
disableMarkdown();
} else if (touchendX < touchstartX - 75) {
disableMarkdown();
}
}, false);
}
function handleGesture() {
if (indiv) {
indiv = false
notesBar.style.width = "85%"
noteBoxDiv.style.width = "0px"
if (selectedNote !== 0) {
noteBoxDiv.readOnly = true
}
notesDiv.classList.remove("hidden")
noteBoxDiv.classList.add("hidden")
burgerButton.classList.remove("hidden")
backButton.classList.add("hidden")
newNote.classList.remove("hidden")
} else {
indiv = true
noteBoxDiv.style.width = "100%";
notesBar.style.width = "0px"
if (selectedNote !== 0) {
noteBoxDiv.readOnly = false
}
notesDiv.classList.add("hidden")
noteBoxDiv.classList.remove("hidden")
burgerButton.classList.add("hidden")
backButton.classList.remove("hidden")
newNote.classList.add("hidden")
}
}
noteBox.value = "" noteBox.value = ""
noteBox.readOnly = true noteBox.readOnly = true