worky on mobile now!
This commit is contained in:
parent
90e732f25e
commit
c7ad1e812c
2 changed files with 88 additions and 0 deletions
|
|
@ -43,6 +43,26 @@ window.addEventListener("load", () => {
|
|||
|
||||
document.querySelectorAll("head style").forEach(style => style.remove());
|
||||
jsDiv = document.getElementsByClassName("js")[0]
|
||||
|
||||
if (matchMedia("(any-hover: none), not (pointer: fine)").matches) {
|
||||
for (let node of document.getElementById("users").children) {
|
||||
const a = node.children[0]
|
||||
if (a.hasAttribute("href")) {
|
||||
a.setAttribute("data-href", a.href)
|
||||
a.setAttribute("tabindex", "0")
|
||||
a.removeAttribute("href")
|
||||
}
|
||||
}
|
||||
for (let node of document.getElementById("services").children) {
|
||||
const a = node.children[0]
|
||||
if (a.hasAttribute("href")) {
|
||||
a.setAttribute("data-href", a.href)
|
||||
a.setAttribute("tabindex", "0")
|
||||
a.removeAttribute("href")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tui.home()
|
||||
}
|
||||
});
|
||||
|
|
@ -232,6 +252,20 @@ const tui = {
|
|||
} else if (onMainList) {
|
||||
jsDiv.children[1].children[0].innerHTML = ""
|
||||
}
|
||||
|
||||
if (onMainList) {
|
||||
for (let node of document.getElementsByClassName("hyper"))
|
||||
node.remove()
|
||||
|
||||
if (focused.hasAttribute("data-href")) {
|
||||
const link = document.createElement("a")
|
||||
link.className = "title2 hyper"
|
||||
link.href = focused.getAttribute("data-href")
|
||||
link.innerHTML = "Go to site"
|
||||
jsDiv.children[1].appendChild(link)
|
||||
}
|
||||
}
|
||||
|
||||
indexFocus()
|
||||
break
|
||||
}
|
||||
|
|
@ -264,6 +298,19 @@ document.addEventListener("mouseover", (e) => {
|
|||
}
|
||||
})
|
||||
|
||||
document.addEventListener("mousedown", (e) => {
|
||||
if (!jsDiv) {return}
|
||||
if (e.target.tagName.toLowerCase() === "a" || e.target.tagName.toLowerCase() === "d") {
|
||||
e.target.focus()
|
||||
if (side == 0 && focusListSecond.includes(document.activeElement)) {
|
||||
side = 1
|
||||
} else if (side == 1 && focusListMain.includes(document.activeElement)) {
|
||||
side = 0
|
||||
}
|
||||
tui.updateFocus()
|
||||
}
|
||||
})
|
||||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (!jsDiv) { return }
|
||||
let focused = document.activeElement
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue