cakefoot/src/index_coolmath.html

43 lines
1.5 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="embed_style.css" type="text/css" />
</head>
<body>
<p id="loading">
Loading...
</p>
<!-- Emscripten's module object will update this canvas with WebGL content. -->
<canvas id="canvas"></canvas>
<!-- This file is built by Emscripten when compiling the program -->
<script src="cakefoot_coolmath.js"></script>
<!-- Coolmath API requirements -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script type="text/javascript" src="https://www.coolmathgames.com/sites/default/files/cmg-ads.js"></script>
<script>
/* Coolmath API custom events. Pause/unpause the game for ads */
document.addEventListener("adBreakStart", () => {
console.log("AdBreak Started")
_pause_for_ads();
});
document.addEventListener("adBreakComplete", () => {
console.log("adBreak Complete")
_unpause_for_ads();
});
/* Fix keyboard input inside an iframe (see https://github.com/emscripten-core/emscripten/issues/5796) */
document.getElementById("canvas").addEventListener("click", () => {
window.focus();
});
</script>
</body>
</html>