Skip to content

Commit

Permalink
fullscreen mode tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
aliraza556 committed Aug 11, 2024
1 parent 42528ac commit 2ff990c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/ui/fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export class Fullscreen {
if (isFullscreen) {
button.classList.add('fullscreenMode');
}

this.button.addEventListener('click', () => this.toggle());
}

toggle() {
Expand All @@ -23,8 +25,22 @@ export class Fullscreen {
.querySelectorAll('.fullscreen__title')
.forEach((el) => (el.textContent = 'Contract'));
document.getElementById('AncientBeast').requestFullscreen();
this.simulateF11KeyPress();
}
}

private simulateF11KeyPress() {
const evt = new KeyboardEvent('keydown', {
key: 'F11',
code: 'F11',
keyCode: 122,
which: 122,
bubbles: true,
cancelable: true,
});

document.dispatchEvent(evt);
}
}

/**
Expand Down

0 comments on commit 2ff990c

Please sign in to comment.