support checking, error page, and glm

wowa
This commit is contained in:
Malloc of Kuzkycyziklistan 2017-04-18 11:27:51 -05:00
parent 08a7619f05
commit 7105166b5c
7 changed files with 3173 additions and 8 deletions

View file

@ -1,5 +1,31 @@
document.onload = function() {
window.onload = function() {
var support = {
canvas: true,
webgl: true,
idb: true
};
if(!document.getElementById("cs").getContext)
support.canvas = false;
// check for webgl support
var canvas = document.getElementById("cs");
if(!(canvas.getContext("webgl") || canvas.getContext("experimental-webgl")))
support.webgl = false;
// check for indexedDB support
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBransaction;
window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange;
if(!window.indexedDB)
support.idb = false;
if(!support.canvas || !support.webgl || !support.idb) {
window.location.href = "error.html?err="+ (+support.canvas)
+""+ (+support.webgl)
+""+ (+support.idb);
return;
}
Entrypoint.Main();
}

View file

@ -1,11 +1,97 @@
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<title>Runtime Error</title>
<meta charset="UTF-8" />
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
background: #eee;
width: 100vw;
}
a {
text-decoration: none;
font-weight: bold;
color: #00b;
}
a:visited {
color: #00b;
}
a:hover {
font-style: italic;
}
#content {
width: 25%;
min-width: 300px;
max-width: 600px;
margin: 0 auto;
padding: 30px 0;
}
ul {
list-style: none;
padding: 0;
}
li {
padding-left: 16px;
}
li:before {
padding-right: 8px;
font-weight: bold;
}
.check:before {
color: #060;
content: "✔";
}
.cross:before {
color: #600;
content: "✖";
font-style: initial !important;
}
.cross {
font-weight: bold;
font-style: italic;
}
</style>
<script type="text/javascript">
window.onload = function() {
var url = window.location.href;
url = url.substr(url.lastIndexOf("?") + 1);
var features = url.split("&")[0].split("=")[1];
for(var i = 1; i <= features.length; ++i)
document.getElementById("supchk"+ i).className = features[i-1] == "1" ? "mark check" : "mark cross";
}
</script>
</head>
<body>
<h2>Your browser does not support a necessary feature to run this application.</h2>
<p>Please upgrade your browser to the most recent version or install a modern browser, such as Mozilla Firefox or Google Chrome.</p>
<div id="content">
<h2>
Your browser does not support the required features to run this application.
</h2>
<p>
The required features are:
<ul>
<li id="supchk1" class="cross">Canvas</li>
<li id="supchk2" class="cross">WebGL</li>
<li id="supchk3" class="cross">IndexedDB</li>
</ul>
</p>
<p>
Please upgrade your browser to the most recent version or install a modern browser,
such as <a href="https://www.mozilla.org">Mozilla Firefox</a> or <a href="https://www.google.com/chrome/">Google Chrome</a>.
</p>
</div>
</body>
</html>

View file

@ -1,3 +1,10 @@
var Entrypoint = (function () {
function Entrypoint() {
}
Entrypoint.Main = function () {
};
return Entrypoint;
}());
var FileCache = (function () {
function FileCache() {
}
@ -5,3 +12,4 @@ var FileCache = (function () {
};
return FileCache;
}());
FileCache.dbHandle = null;

29
client/glm.js Normal file

File diff suppressed because one or more lines are too long

View file

@ -3,11 +3,15 @@
<head>
<title>CircleScape</title>
<meta charset="UTF-8" />
<script type="text/javascript" src="check.js"></script>
<script type="text/javascript" src="glm.js"></script>
<script type="text/javascript" src="game.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<canvas id="cs">
Your browser does not support the canvas tag.
</canvas>
<canvas id="cs"></canvas>
<div id="modal" class="hidden">
</div>
</body>
</html>

3002
client/src/Matrix.d.ts vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,13 @@
body {
background: #000;
}
#cs {
display: block;
width: 100vw;
height: 100vh;
}
.hidden {
display: none;
}