Skip to content

Commit fda874e

Browse files
authored
Create index.html
1 parent c9bb91b commit fda874e

1 file changed

Lines changed: 129 additions & 0 deletions

File tree

gameFiles/balatro/index.html

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<!doctype html>
2+
<html lang="en-us">
3+
<base href="https://cdn.jsdelivr.net/gh/sea-bean-unblocked/ghost-assets-for-games@main/balatro/">
4+
5+
<head>
6+
<meta charset="utf-8">
7+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, minimum-scale=1, maximum-scale=1">
9+
<title>Balatro</title>
10+
11+
<link rel="stylesheet" type="text/css" href="theme/love.css">
12+
13+
<body>
14+
<center>
15+
<div>
16+
<h1>Balatro - Bloxcraft UBG GAMES</h1>
17+
<h2>We did NOT make Balatro</h2>
18+
<h3>Loading... Please Wait.</h3>
19+
<p>Hint: Click the "Play In Newtab" button to play in newtab</p>
20+
<canvas id="loadingCanvas" oncontextmenu="event.preventDefault()" width="800" height="600"></canvas>
21+
<canvas id="canvas" oncontextmenu="event.preventDefault()" width="100%" height="100%"></canvas>
22+
</div>
23+
</center>
24+
25+
<script type='text/javascript'>
26+
window.callad = () => {
27+
window.parent.postMessage({
28+
type: 'adcall'
29+
}, '*');
30+
}
31+
var canvas = document.getElementById("loadingCanvas");
32+
canvas.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
33+
canvas.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
34+
35+
function goFullScreen() {
36+
var canvas = document.getElementById("canvas");
37+
if (canvas.requestFullScreen)
38+
canvas.requestFullScreen();
39+
else if (canvas.webkitRequestFullScreen)
40+
canvas.webkitRequestFullScreen();
41+
else if (canvas.mozRequestFullScreen)
42+
canvas.mozRequestFullScreen();
43+
}
44+
45+
function FullScreenHook() {
46+
var canvas = document.getElementById("canvas");
47+
canvas.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
48+
canvas.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
49+
}
50+
var loadingContext = document.getElementById('loadingCanvas').getContext('2d');
51+
52+
function drawLoadingText(text) {
53+
var canvas = loadingContext.canvas;
54+
55+
loadingContext.fillStyle = "rgb(142, 195, 227)";
56+
loadingContext.fillRect(0, 0, canvas.scrollWidth, canvas.scrollHeight);
57+
58+
loadingContext.font = '2em arial';
59+
loadingContext.textAlign = 'center'
60+
loadingContext.fillStyle = "rgb( 11, 86, 117 )";
61+
loadingContext.fillText(text, canvas.scrollWidth / 2, canvas.scrollHeight / 2);
62+
63+
}
64+
65+
window.onload = function() {
66+
window.focus();
67+
};
68+
window.onclick = function() {
69+
window.focus();
70+
};
71+
72+
window.addEventListener("keydown", function(e) {
73+
74+
if ([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
75+
e.preventDefault();
76+
}
77+
}, false);
78+
79+
var Module = {
80+
arguments: ["./game.love"],
81+
INITIAL_MEMORY: 256000000,
82+
printErr: console.error.bind(console),
83+
canvas: (function() {
84+
var canvas = document.getElementById('canvas');
85+
86+
canvas.addEventListener("webglcontextlost", function(e) {
87+
alert('WebGL context lost. You will need to reload the page.');
88+
e.preventDefault();
89+
}, false);
90+
91+
return canvas;
92+
})(),
93+
setStatus: function(text) {
94+
if (text) {
95+
drawLoadingText(text);
96+
} else if (Module.remainingDependencies === 0) {
97+
document.getElementById('loadingCanvas').style.display = 'none';
98+
document.getElementById('canvas').style.visibility = 'visible';
99+
}
100+
},
101+
totalDependencies: 0,
102+
remainingDependencies: 0,
103+
monitorRunDependencies: function(left) {
104+
this.remainingDependencies = left;
105+
this.totalDependencies = Math.max(this.totalDependencies, left);
106+
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies - left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
107+
}
108+
};
109+
Module.setStatus('Downloading...');
110+
window.onerror = function(event) {
111+
112+
Module.setStatus('Exception thrown, see JavaScript console');
113+
Module.setStatus = function(text) {
114+
if (text) Module.printErr('[post-exception status] ' + text);
115+
};
116+
};
117+
118+
var applicationLoad = function(e) {
119+
Love(Module);
120+
}
121+
</script>
122+
<script type="text/javascript" src="game.js?v=d7e34743-2fea-4de6-8a0e-1103b5fcf07f"></script>
123+
<script async type="text/javascript" src="love.js" onload="applicationLoad(this)"></script>
124+
125+
126+
127+
</body>
128+
129+
</html>

0 commit comments

Comments
 (0)