support checking, error page, and glm
wowa
This commit is contained in:
parent
08a7619f05
commit
7105166b5c
7 changed files with 3173 additions and 8 deletions
|
@ -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();
|
Entrypoint.Main();
|
||||||
}
|
}
|
|
@ -1,11 +1,97 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Error</title>
|
<title>Runtime Error</title>
|
||||||
<meta charset="UTF-8" />
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h2>Your browser does not support a necessary feature to run this application.</h2>
|
<div id="content">
|
||||||
<p>Please upgrade your browser to the most recent version or install a modern browser, such as Mozilla Firefox or Google Chrome.</p>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,3 +1,10 @@
|
||||||
|
var Entrypoint = (function () {
|
||||||
|
function Entrypoint() {
|
||||||
|
}
|
||||||
|
Entrypoint.Main = function () {
|
||||||
|
};
|
||||||
|
return Entrypoint;
|
||||||
|
}());
|
||||||
var FileCache = (function () {
|
var FileCache = (function () {
|
||||||
function FileCache() {
|
function FileCache() {
|
||||||
}
|
}
|
||||||
|
@ -5,3 +12,4 @@ var FileCache = (function () {
|
||||||
};
|
};
|
||||||
return FileCache;
|
return FileCache;
|
||||||
}());
|
}());
|
||||||
|
FileCache.dbHandle = null;
|
||||||
|
|
29
client/glm.js
Normal file
29
client/glm.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -3,11 +3,15 @@
|
||||||
<head>
|
<head>
|
||||||
<title>CircleScape</title>
|
<title>CircleScape</title>
|
||||||
<meta charset="UTF-8" />
|
<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>
|
<script type="text/javascript" src="game.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<canvas id="cs">
|
<canvas id="cs"></canvas>
|
||||||
Your browser does not support the canvas tag.
|
<div id="modal" class="hidden">
|
||||||
</canvas>
|
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
3002
client/src/Matrix.d.ts
vendored
Normal file
3002
client/src/Matrix.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,13 @@
|
||||||
body {
|
body {
|
||||||
background: #000;
|
background: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#cs {
|
||||||
|
display: block;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
Loading…
Reference in a new issue