ui: fallback to window.inner*

* Android 上, avail* 还是屏幕的
This commit is contained in:
CrescentLeaf
2025-10-03 23:58:16 +08:00
parent c5ce13b13c
commit af694f6f6c

View File

@@ -29,9 +29,9 @@ ReactDOM.createRoot(document.getElementById('app') as HTMLElement).render(React.
const onResize = () => setTimeout(() => {
document.body.style.setProperty('--whitesilk-widget-message-maxwidth', breakpoint().down('md') ? "80%" : "70%")
// deno-lint-ignore no-window
document.body.style.setProperty('--whitesilk-window-width', (isMobileUI() ? window.screen.availWidth : window.innerWidth) + 'px')
document.body.style.setProperty('--whitesilk-window-width', window.innerWidth + 'px')
// deno-lint-ignore no-window
document.body.style.setProperty('--whitesilk-window-height', (isMobileUI() ? window.screen.availHeight : window.innerHeight) + 'px')
document.body.style.setProperty('--whitesilk-window-height', window.innerHeight + 'px')
}, 100)
// deno-lint-ignore no-window no-window-prefix
window.addEventListener('resize', onResize)