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 009fe23
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ui/fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export class Fullscreen {
if (isFullscreen) {
button.classList.add('fullscreenMode');
}
this.button.addEventListener('click', this.toggle.bind(this));
}

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

triggerF11() {
const event = new KeyboardEvent('keydown', {
key: 'F11',
code: 'F11',
keyCode: 122,
which: 122,
bubbles: true,
cancelable: true,
});
document.dispatchEvent(event);
}
}

/**
Expand Down

0 comments on commit 009fe23

Please sign in to comment.