Skip to content

Commit cf2907e

Browse files
committed
feat: Support fullscreen.
1 parent e844d39 commit cf2907e

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

examples/showcase/src/app.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
* {
22
margin: 0px;
33
padding: 0px;
4+
5+
-webkit-touch-callout: none;
6+
-webkit-user-select: none;
7+
-moz-user-select: none;
8+
-ms-user-select: none;
9+
user-select: none;
410
}
511

612
#app {
713
width: 100vw;
814
height: 100vh;
915
display: block;
16+
background-color: #000000;
1017
}
1118

1219
#app > div {

examples/showcase/src/main.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,18 @@ window.addEventListener("DOMContentLoaded", () => {
2222
});
2323

2424
(window as any).app = app;
25+
26+
document.addEventListener("contextmenu", (event) => event.preventDefault());
27+
28+
element.addEventListener("dblclick", function () {
29+
if (element.requestFullscreen) {
30+
element.requestFullscreen();
31+
} else if ((element as any).mozRequestFullScreen) {
32+
(element as any).mozRequestFullScreen();
33+
} else if ((element as any).webkitRequestFullscreen) {
34+
(element as any).webkitRequestFullscreen();
35+
} else if ((element as any).msRequestFullscreen) {
36+
(element as any).msRequestFullscreen();
37+
}
38+
});
2539
});

0 commit comments

Comments
 (0)