-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfull_screen.php
More file actions
38 lines (31 loc) · 1.22 KB
/
full_screen.php
File metadata and controls
38 lines (31 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
if(! class_exists('Webview')) {
require_once __DIR__ .'/webview.stub.php';
}
$webview = new Webview();
$webview->set_title("Hello World");
$webview->set_html(<<<HTML
<html>
<body style="margin: 0; padding: 0">
<div style="background: white; width: 100vw; height: 100vh; padding: 10px">
<h1> Fullscreen Demo </h1>
<p> Window maximizing doesn't work without user interaction. </p>
<p> But we can set the window size to the <b>available screen</b> size. </p>
<p> For mac, this is the size of the screen minus the dock & the menu bar. </p>
<p> For windows, this is the size of the screen minus the taskbar. </p>
<p> For linux, this is the size of the screen minus the panel. </p>
<p> When the user actually wants to go fullscreen, we can use the <code>requestFullscreen</code> method. </p>
<button onclick="document.querySelector('body').requestFullscreen()"> Fullscreen </button>
<script>
window.onload = function() {
window.setWindowSize(window.screen.width, window.screen.height)
};
</script>
</body>
</html>
HTML);
$webview->bind("setWindowSize", function($width, $height) use ($webview) {
$webview->set_size($width, $height);
});
$webview->run();
unset($webview);