-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
25 lines (23 loc) · 1.13 KB
/
index.html
File metadata and controls
25 lines (23 loc) · 1.13 KB
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
<!-- Graphics Example Code.
index.html - The web page document containing the canvas (drawing surface). It launches your JavaScript files. //-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="icon" href="assets/fav.ico">
<title>WebGL</title></head>
<body style="background: DarkGray">
<!-- Begin typing your web page's text here. //-->
<!-- The following code embeds a WebGL canvas panel powered by a tree of Components from tiny-graphics. //-->
<div id="main-section" class="document-builder"></div>
<script type=module>
// ********************* THE ENTRY POINT OF YOUR JAVASCRIPT PROGRAM STARTS HERE *********************
// Indicate which element on the page you want the Canvas_Widget to replace with a 3D WebGL area:
const element_to_replace = document.querySelector ("#main-section");
import {main_scene, additional_scenes} from './main-scene.js';
const root = new main_scene (); // This line creates your scene.
root.animated_children.push (...additional_scenes.map (scene => new scene ()));
root.render_layout (element_to_replace);
</script>
</body>
</html>