Initial commit
11
public/browserconfig.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="/images/ms-icon-70x70.png"/>
|
||||
<square150x150logo src="/images/ms-icon-150x150.png"/>
|
||||
<square310x310logo src="/images/ms-icon-310x310.png"/>
|
||||
<TileColor>#ffffff</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
||||
BIN
public/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
63
public/game.css
Normal file
BIN
public/images/android-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
public/images/android-icon-192x192.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
public/images/android-icon-36x36.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
public/images/android-icon-48x48.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/android-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/images/android-icon-96x96.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
public/images/apple-icon-114x114.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/images/apple-icon-120x120.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
public/images/apple-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
public/images/apple-icon-152x152.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
public/images/apple-icon-180x180.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
public/images/apple-icon-57x57.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/images/apple-icon-60x60.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
public/images/apple-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/images/apple-icon-76x76.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
public/images/apple-icon-precomposed.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
public/images/apple-icon.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
public/images/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/images/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
public/images/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
public/images/ms-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
public/images/ms-icon-150x150.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
public/images/ms-icon-310x310.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
public/images/ms-icon-70x70.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
151
public/index.html
Normal file
@ -0,0 +1,151 @@
|
||||
{{define "index"}}<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>QuakeJS Local</title>
|
||||
<link rel="stylesheet" href="game.css"></link>
|
||||
<script type="text/javascript" src="ioquake3.js"></script>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/images/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/images/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/images/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/images/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/images/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/images/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/images/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/images/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/images/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/images/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/images/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<script type="text/javascript">
|
||||
function getQueryCommands() {
|
||||
var search = /([^&=]+)/g;
|
||||
var query = window.location.search.substring(1);
|
||||
|
||||
var args = [];
|
||||
|
||||
var match;
|
||||
while (match = search.exec(query)) {
|
||||
var val = decodeURIComponent(match[1]);
|
||||
val = val.split(' ');
|
||||
val[0] = '+' + val[0];
|
||||
args.push.apply(args, val);
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
function resizeViewport() {
|
||||
if (!ioq3.canvas) {
|
||||
// ignore if the canvas hasn't yet initialized
|
||||
return;
|
||||
}
|
||||
if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
|
||||
document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
|
||||
document['fullScreenElement'] || document['fullscreenElement'])) {
|
||||
// ignore resize events due to going fullscreen
|
||||
return;
|
||||
}
|
||||
ioq3.setCanvasSize(ioq3.viewport.offsetWidth, ioq3.viewport.offsetHeight);
|
||||
}
|
||||
|
||||
ioq3.viewport = document.getElementById('viewport-frame');
|
||||
ioq3.elementPointerLock = true;
|
||||
ioq3.exitHandler = function (err) {
|
||||
if (err) {
|
||||
var form = document.createElement('form');
|
||||
form.setAttribute('method', 'POST');
|
||||
form.setAttribute('action', '/');
|
||||
|
||||
var hiddenField = document.createElement('input');
|
||||
hiddenField.setAttribute('type', 'hidden');
|
||||
hiddenField.setAttribute('name', 'error');
|
||||
hiddenField.setAttribute('value', err);
|
||||
form.appendChild(hiddenField);
|
||||
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = '/';
|
||||
}
|
||||
|
||||
window.addEventListener('resize', resizeViewport);
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.centered {
|
||||
position: fixed;
|
||||
top: 60%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -60%);
|
||||
z-index: 1;
|
||||
}
|
||||
.form input[type=text] {
|
||||
margin: 8px 0;
|
||||
display: inline-block;
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: inset 0 1px 3px #ddd;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
padding-top: 16px;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
.button {
|
||||
background-color: #fe121e;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 16px 32px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<div id="bg"></div>
|
||||
<div class="centered">
|
||||
<form class="form">
|
||||
<input type="text" id="playerName">
|
||||
<button onclick="join()" type="submit" class="button">Join</button>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
placeholder = "enter player name"
|
||||
if (localStorage.playerName) {
|
||||
placeholder = localStorage.playerName
|
||||
}
|
||||
document.getElementById("playerName").placeholder = placeholder
|
||||
function join(){
|
||||
var inputPlayerName = document.getElementById("playerName");
|
||||
if (inputPlayerName.value != "") {
|
||||
localStorage.setItem("playerName", inputPlayerName.value);
|
||||
}
|
||||
host = document.location.host
|
||||
if (!host.includes(":")) { host = host + ":80" }
|
||||
var args = ['+set', 'fs_cdn', host, '+connect', host];
|
||||
args.push.apply(args, ['+set', 'cl_allowDownload', '1'])
|
||||
args.push.apply(args, ['+name', localStorage.playerName])
|
||||
args.push.apply(args, getQueryCommands());
|
||||
var element = document.getElementById("main");
|
||||
element.parentNode.removeChild(element);
|
||||
ioq3.callMain(args);
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="viewport-frame"></div>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
30996
public/ioquake3.js
vendored
Normal file
41
public/manifest.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "App",
|
||||
"icons": [
|
||||
{
|
||||
"src": "\/images\/android-icon-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "\/images\/android-icon-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "\/images\/android-icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "\/images\/android-icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "\/images\/android-icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "\/images\/android-icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
}
|
||||
]
|
||||
}
|
||||