summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--derelict.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/derelict.js b/derelict.js
index 53358d6..155df23 100644
--- a/derelict.js
+++ b/derelict.js
@@ -205,8 +205,7 @@ function processKillmails(obj, killmails, icon) {
toggleAll()
}
-function init() {
- const container = document.getElementById("container")
+export function init({id, container, toolbar}) {
const renderer = new THREE.WebGLRenderer({antialias: true})
const renderer2d = new CSS2DRenderer()
@@ -218,13 +217,12 @@ function init() {
container.appendChild(renderer.domElement)
container.appendChild(renderer2d.domElement)
- const url = new URL(window.location.href)
const loader = new THREE.TextureLoader()
const skybox = loader.loadAsync("https://i.imgur.com/rDGOLFC.jpg") // TODO: Don't use imgur as CDN.
let icon = loadWreckIcon()
- fetch(url.pathname.replace("view", "battles"))
+ fetch(`/battles/${id}`)
.then(response => response.json())
.then(killmails => {
const url = km => `${ESI}/killmails/${km.id}/${km.hash}/?datasource=tranquility`
@@ -237,5 +235,3 @@ function init() {
icon.then(icon => processKillmails({skybox, renderer, renderer2d, container}, killmails, icon))
})
}
-
-init()