const listener = () => {
const MIN_KEYBOARD_HEIGHT = 300
const isMobile = window.innerWidth < 768
const isKeyboardOpen = isMobile && window.screen.height - MIN_KEYBOARD_HEIGHT > window.visualViewport.height
document.documentElement.classList.toggle('show-keyboard', isKeyboardOpen)
}
window.visualViewport.addEventListener('resize', listener)