-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
25 lines (22 loc) · 1.71 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
<!-- Graphics Example Code.
index.html - The web page document containing the canvas (drawing surface). It launches your JavaScript files. //-->
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"/> <link rel="icon" href="assets/fav.ico"> </head>
<body style="background: DarkGray"> <!-- Begin typing your web page here. //-->
<!-- The following code embeds a WebGL canvas panel, loads certain scene(s), and displays panel(s) of their controls. //-->
<div id="main-canvas" class="canvas-widget"></div>
<script type=module > // ********************* THE ENTRY POINT OF YOUR WHOLE 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-canvas" );
import { Main_Scene, Additional_Scenes, Canvas_Widget } from './main-scene.js'; // Import the file that defines a scene.
const scenes = [ Main_Scene, ...Additional_Scenes ].map( scene => new scene() ); // This line creates your scene.
new Canvas_Widget( element_to_replace, scenes );
</script>
<!-- The following code embeds a code navigator widget with links to classes. //-->
<div id="main-code" class="code-widget"></div>
<script type=module >
// Indicate which element on the page you want the Code_Widget to replace with a code readout:
const element_to_replace = document.querySelector( "#main-code" );
import { Main_Scene, Additional_Scenes, Code_Widget, defs } from './main-scene.js'; // Import the file that defines a scene.
new Code_Widget( element_to_replace, Main_Scene, Additional_Scenes, defs );
</script>
</body></html>