Skip to content

Commit

Permalink
v4
Browse files Browse the repository at this point in the history
  • Loading branch information
aliraza556 committed Aug 5, 2024
1 parent 9bc1b96 commit 1364d01
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/ui/fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,22 @@ export class Fullscreen {
this.button
.querySelectorAll('.fullscreen__title')
.forEach((el) => (el.textContent = 'Contract'));
document.getElementById('AncientBeast').requestFullscreen();
const element = document.getElementById('AncientBeast');
if (element.requestFullscreen) {
element.requestFullscreen();
} else if ((element as any).webkitRequestFullscreen) { // Safari
(element as any).webkitRequestFullscreen();
} else if ((element as any).msRequestFullscreen) { // IE11
(element as any).msRequestFullscreen();
} else {
// Fallback for iOS
element.style.position = 'fixed';
element.style.top = '0';
element.style.left = '0';
element.style.width = '100%';
element.style.height = '100%';
element.style.zIndex = '9999';
}
}
}
}
Expand Down

0 comments on commit 1364d01

Please sign in to comment.