Skip to content

Commit

Permalink
update js for new structures
Browse files Browse the repository at this point in the history
  • Loading branch information
Himyu committed Sep 15, 2022
1 parent 57b902c commit e4d16f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
23 changes: 13 additions & 10 deletions frontend/frontend.js
Original file line number Diff line number Diff line change
@@ -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()
4 changes: 2 additions & 2 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h1>Valorant PreGame & Loading</h1>
<h2>PreGame</h2>
<div style="width: 480px; height: 270px; overflow: hidden">
<iframe
src="/pages/op-module-valorant-pregame/gfx/pregame/index.html"
id="pregame-gfx"
width="1920"
height="1080"
style="transform: scale(0.25); transform-origin: 0 0"
Expand All @@ -17,7 +17,7 @@ <h2>PreGame</h2>
<h2>Loading</h2>
<div style="width: 480px; height: 270px; overflow: hidden">
<iframe
src="/pages/op-module-valorant-pregame/gfx/loading/index.html"
id="loading-gfx"
width="1920"
height="1080"
style="transform: scale(0.25); transform-origin: 0 0"
Expand Down

0 comments on commit e4d16f1

Please sign in to comment.