-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
40 lines (39 loc) · 1.2 KB
/
Copy pathindex.html
File metadata and controls
40 lines (39 loc) · 1.2 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
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>CheerpJ Test</title>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
<style>
/* Make sure the page occupies the full window */
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
</style>
</head>
<body>
<script>
(async function () {
await cheerpjInit();
// Use the full width and height of the browser window
cheerpjCreateDisplay(window.innerWidth, window.innerHeight);
// await cheerpjRunJar("/app/src/Application.jar", "GUI");
await cheerpjRunMain("GUI", "/app/src/application.jar");
})();
// Optionally, update the display size when the window is resized.
window.addEventListener("resize", function () {
// If CheerpJ uses a specific display element, update its dimensions.
var display = document.getElementById("cheerpjDisplay");
if (display) {
display.style.width = window.innerWidth + "px";
display.style.height = window.innerHeight + "px";
}
});
</script>
</body>
</html>