katbugjs/index.html

220 lines
5.3 KiB
HTML
Executable file

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="manifest" href="./manifest.json">
<title>Catbug: in the see-through zone!</title>
<style>
body
{
background: #000000;
}
*{padding: 0; margin: 0;}
@font-face
{
font-family: kong;
src: url("assets/kong.ttf") format('truetype');
font-weight: normal;
font-style: normal;
}
#loadFont
{
font-family: 'kong';
visibility: hidden;
height:0px;
}
#dpad
{
position:fixed;
bottom: 10px;
left: 10px;
background: rgba(0,0,0,0);
z-index:2;
width:200px;
height:200px;
visibility:hidden;
}
#upButton
{
position:absolute;
top: 0px;
left: 33%;
width:33%;
height:33%;
background: rgba(0,0,0,0.4);
border-width: 1px;
border-style: solid;
border-color: #444444;
}
#downButton
{
position:absolute;
bottom:0px;
left:33%;
width:33%;
height:33%;
background: rgba(0,0,0,0.4);
border-width: 1px;
border-style: solid;
border-color: #444444;
}
#leftButton
{
position:absolute;
top: 33%;
left: 0px;
width:33%;
height:33%;
background: rgba(0,0,0,0.4);
border-width: 1px;
border-style: solid;
border-color: #444444;
}
#rightButton
{
position:absolute;
top: 33%;
right: 0px;
width:33%;
height:33%;
background: rgba(0,0,0,0.4);
border-width: 1px;
border-style: solid;
border-color: #444444;
}
#nwButton
{
position:absolute;
top: 0px;
left:0px;
width:33%;
height:33%;
background: rgba(0,0,0,0.4);
border-width: 1px;
border-style: solid;
border-color: #444444;
}
#neButton
{
position:absolute;
top: 0px;
right: 0px;
width:33%;
height:33%;
background: rgba(0,0,0,0.4);
border-width: 1px;
border-style: solid;
border-color: #444444;
}
#swButton
{
position:absolute;
bottom: 0px;
left: 0px;
width:33%;
height:33%;
background: rgba(0,0,0,0.4);
border-width: 1px;
border-style: solid;
border-color: #444444;
}
#seButton
{
position:absolute;
bottom: 0px;
right: 0px;
width:33%;
height:33%;
background: rgba(0,0,0,0.4);
border-width: 1px;
border-style: solid;
border-color: #444444;
}
#spaceButton
{
position: fixed;
bottom: 10px;
right: 10px;
background:rgba(0,0,0,0.4);
width: 50px;
height: 50px;
border-color: #444444;
border-width: 1px;
border-style: solid;
visibility:hidden;
}
#qButton
{
position: fixed;
top: 10px;
right: 10px;
background:rgba(0,0,0,0.4);
width: 50px;
height: 50px;
border-color: #444444;
border-width: 1px;
border-style: solid;
visibility:hidden;
}
canvas
{
position: absolute;
font-family: 'kong';
background: #444444;
display: block;
margin: 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: auto;
max-width: 640px;
-ms-interpolation-mode: nearest-neighbor;
image-rendering: -webkit-optimize-contrast;
image-rendering: -moz-crisp-edges;
image-rendering: -o-cristp-edges;
image-rendering: pixelated;
}
</style>
<script type="text/javascript" src="Catbug.js"></script>
<script type="text/javascript" src="Engine.js"></script>
<script type="text/javascript" src="Pickup.js"></script>
<script type="text/javascript" src="Touch.js"></script>
<script type="text/javascript">
function main()
{
var gCanvas = document.getElementById("screen");
window.screen = gCanvas.getContext("2d");
renderer.loadgfx();
if (navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini|Mobile/i))
{
prepareTouchInput();
}
loop();
}
</script>
</head>
<body onload="main();">
<div id="loadFont">loading font...</div>
<div id="dpad">
<div id="upButton"></div>
<div id="downButton"></div>
<div id="rightButton"></div>
<div id="leftButton"></div>
<div id="nwButton"></div>
<div id="neButton"></div>
<div id="swButton"></div>
<div id="seButton"></div>
</div>
<div id="qButton"></div>
<div id="spaceButton"></div>
<canvas id="screen" width="320" height="180"></canvas>
</body>
</html>