export function getFullscreenElement() { return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullscreenElement || document.msFullscreenElement; } export function doFullscreen() { if (getFullscreenElement()) { document.exitFullscreen(); } else { document.documentElement.requestFullscreen().catch(err => console.error); } }