Full Screen mode (#1212)

This commit is contained in:
Mohit kumar Bajoria 2020-04-06 03:17:13 +05:30 committed by GitHub
parent 81b38d8808
commit 2de4fe29ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 42 additions and 7 deletions

View file

@ -144,6 +144,14 @@ export function resetCursor() {
document.documentElement.style.cursor = "";
}
export const isFullScreen = () =>
document.fullscreenElement?.nodeName === "HTML";
export const allowFullScreen = () =>
document.documentElement.requestFullscreen();
export const exitFullScreen = () => document.exitFullscreen();
export const getShortcutKey = (shortcut: string, prefix = " — "): string => {
const isMac = /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
if (isMac) {