forked from Hartrik/sand-game-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
60 lines (57 loc) · 2.37 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sand Game JS</title>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<script defer src="dist/sand-game-js.umd.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<script>
// global variables, accessible from browser console
var sandGame = null;
var brushes = null;
$(() => {
let root = $('#sand-game-root');
root.empty();
// const component = SandGameJS.initStandard(root);
const component = SandGameJS.initTest(root);
sandGame = component.getSandGame();
component.addOnInitialized(s => {
sandGame = s;
});
brushes = SandGameJS.Brushes;
console.log('Globals: sandGame, brushes');
console.log('Example: sandGame.graphics().drawLine(10, 10, 300, 150, 2, brushes.SAND);');
});
</script>
</head>
<body>
<main role="main" class="container">
<h1>Sand Game JS</h1>
<div id="sand-game-root">
<!-- Sand Game JS placeholder -->
<div style="user-select: none;">
<div>
<button disabled class="badge badge-secondary" type="button" style="min-width: 4em; padding: 0.4em 0.4em; border: none; background-color: rgb(230, 230, 230); color: black;"> </button>
</div>
<div style="height: 70vh; display: flex; align-items: center; justify-content: center; margin-top: 4pt; padding: 2em; outline: 1px solid #b7b7b7;">
<div>
Loading...
</div>
</div>
<div style="height: 20vh"></div>
</div>
</div>
</main>
<footer class="container" style="font-size: small">
<p>
<a href="https://github.com/Hartrik/sand-game-js">https://github.com/Hartrik/sand-game-js</a>
</p>
</footer>
</body>
</html>