-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
134 lines (126 loc) · 4.02 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Food Kit (powered by Three.js)</title>
<style>
html, body {
margin: 0;
height: 100%;
}
#mainCanvas {
width: 100%;
height: 100%;
display: block;
/* https://stackoverflow.com/questions/47344626/put-a-table-in-a-canvas-in-html */
position: absolute;
z-index: 0;
}
#info {
position: absolute;
left: 1em;
top: 1em;
background: rgba(0,0,0,.8);
padding: .5em;
color: white;
font-family: monospace;
}
#menuMobile {
position: absolute;
left: 10px;
top: 10px;
display: none;
z-index: 2;
}
/* MENU RELATED */
.menu {
width: 100%;
/* https://stackoverflow.com/questions/47344626/put-a-table-in-a-canvas-in-html */
position: absolute;
z-index: 1;
}
/* https://stackoverflow.com/questions/558721/css-classes-subclasses */
.menu .columnSide { width: 40%; }
.menu .columnMain { width: 20%; }
.menu .columnMain .title {
padding: 10px;
padding-left: 0;
padding-right: 0;
color: white;
font-family: Courier;
font-size: 12pt;
font-weight: bold;
text-align: center;
}
.menu .columnMain .menuButton {
width: 100%;
min-width: 200px;
min-height: 30px;
color: black;
font-family: Courier;
font-size: 12pt;
font-weight: bold;
text-align: center;
}
/* https://www.w3schools.com/howto/howto_css_three_columns.asp */
/* Responsive layout - when the screen is less than 600px wide,
* make the three columns stack on top of each other instead of next to each other
*/
@media screen and (max-width: 1100px) {
.menu .columnSide { width: 10%; }
.menu .columnMain { width: 80%; }
.menu .columnMain .title { font-size: 24pt; }
.menu .columnMain .menuButton { min-height: 60px; font-size: 24pt; }
/* see also:
* https://github.com/nrsharip/iss-web/blob/e8ca66ade3933dfac4795ba7c44e067c26a079e2/moex/templates/moex/index.html#L27
* https://github.com/nrsharip/iss-web/blob/e8ca66ade3933dfac4795ba7c44e067c26a079e2/moex/templates/moex/index.html#L86
* https://github.com/nrsharip/iss-web/blob/e8ca66ade3933dfac4795ba7c44e067c26a079e2/moex/templates/moex/index.html#L238
*/
#menuMobile { display: block; }
}
</style>
</head>
<body>
<canvas id="mainCanvas"></canvas>
<!-- <div id="info"></div> -->
<img id="menuMobile" src="assets/images/menu_shadedDark33.png">
<!-- https://stackoverflow.com/questions/47344626/put-a-table-in-a-canvas-in-html -->
<table id="mainMenu" class="menu">
<tr>
<td class="columnSide"></td>
<td class="columnMain">
<div class="title">
<a href="https://kenney.nl/assets/food-kit">Food Kit</a> (powered by <a href="https://threejs.org/">Three.js</a>)
</div>
</td>
<td class="columnSide"></td>
</tr>
<tr>
<td class="columnSide"></td>
<td class="columnMain">
<button id="startButton" class="menuButton">START</button>
<!-- https://stackoverflow.com/questions/14750078/style-disabled-button-with-css -->
<button class="menuButton" disabled>Single player</button>
<button class="menuButton" disabled>Multiplayer player</button>
<button class="menuButton" disabled>Settings</button>
<button class="menuButton" disabled>About</button>
<button class="menuButton" disabled>Quit</button>
</td>
<td class="columnSide"></td>
</tr>
</table>
<script src="./js/lib/ammo.js/7a574978fb28164a0a1510831eae52958edb4265/ammo.wasm.js"></script>
<!-- Since Import maps are not yet supported by all browsers, it is necessary to add the polyfill es-module-shims.js. -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<!-- see https://unpkg.com/browse/[email protected]/ -->
<!-- see https://www.npmjs.com/package/three -->
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js"
}
}
</script>
<script type="module" src="js/index.js"></script>
</body>
</html>