Initial commit

This commit is contained in:
Chris Marshall
2020-08-02 13:23:17 -04:00
committed by chris
commit ffca54fdb8
60 changed files with 34080 additions and 0 deletions

11
public/browserconfig.xml Normal file
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

63
public/game.css Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

151
public/index.html Normal file
View 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

File diff suppressed because one or more lines are too long

41
public/manifest.json Normal file
View 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"
}
]
}

File diff suppressed because one or more lines are too long