diff --git a/frontend/frontend.js b/frontend/frontend.js index b82a211..99b01b1 100644 --- a/frontend/frontend.js +++ b/frontend/frontend.js @@ -1,10 +1,13 @@ -$('#pregame-embed').val( - `${location.href}/gfx/pregame/index.html${ - window.apiKey !== null ? '?apikey=' + window.apiKey : '' - }` -) -$('#loading-embed').val( - `${location.href}/gfx/loading/index.html${ - window.apiKey !== null ? '?apikey=' + window.apiKey : '' - }` -) +async function initUI () { + const port = await window.constants.getWebServerPort() + const location = `http://localhost:${port}/pages/op-module-valorant-pregame/gfx` + + const apiKey = await window.constants.getApiKey() + + document.querySelector('#loading-embed').value = `${location}/loading/index.html${apiKey !== null ? '?apikey=' + apiKey: ''}` + document.querySelector('#loading-gfx').value = `${location}/loading/index.html${apiKey !== null ? '?apikey=' + apiKey: ''}` + + document.querySelector('#pregame-embed').value = `${location}/pregame/index.html${apiKey !== null ? '?apikey=' + apiKey: ''}` + document.querySelector('#pregame-gfx').src = `${location}/pregame/index.html${apiKey !== null ? '?apikey=' + apiKey: ''}` +} +initUI() \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 842d600..c113d4f 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,7 +5,7 @@

Valorant PreGame & Loading

PreGame