-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
38 lines (31 loc) · 916 Bytes
/
index.js
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
import {renderPlanet} from "./src/planetRendering.js";
import {createControls} from "./src/orbitControls.js";
import {setupButtons} from "./src/controlRendering.js";
import {showScreenshotArea} from "./src/screenshotHandling.js";
const path = window.location.pathname;
const pathSegments = path.split('/');
const planetName = pathSegments[1];
// //fetch planet name
// fetch ("", {
// method: "GET",
// headers: {
// "Content-Type": "application/json"
//
// }
// })
//
// //fetch planet data from planet name
// fetch ("", {
// method: "GET",
// headers: {
// "Content-Type": "application/json"
//
// }
// })
document.addEventListener("DOMContentLoaded", () => {
setupButtons(); // Initialize the buttons
// You can also call the rendering function here
// renderPlanet("Data\\star_data3.json");
renderPlanet(planetName);
// renderPlanet(1920);
});