Add bridge page controller and helpers.

This commit is contained in:
Denis Švara
2026-01-06 15:54:10 +01:00
parent b84da94016
commit 177afe1a41
5 changed files with 164 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
let top = 0
export const viewport = {
get top() {
return top
},
get height() {
return visualViewport.height
}
}
function update() {
requestAnimationFrame(() => {
top = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-inset-top"))
})
}
visualViewport.addEventListener("resize", update)
update()