begin layout

This commit is contained in:
SpikeHD 2022-04-25 21:00:57 -07:00
parent 82b81bbd6b
commit 23a4feac74
5 changed files with 76 additions and 7 deletions

View File

@ -10,9 +10,41 @@
<body> <body>
<div id="base"> <div id="base">
<span>Select a banner to use as a base:</span> <span>Select a banner to use as a base:</span>
<select id="bannerDefaultSelect"> <select id="bannerDefaultSelect" onchange="handleBaseBannerChange()">
</select> </select>
</div> </div>
<div id="bannerEditor">
<div id="mainChar">
<span>Select the main character</span>
<select id="mainCharSelect"></select>
</div>
<div id="secondaryChars">
<span id="secondaryCharSelects">Select secondary characters</span>
<select id="secondaryCharList"></select>
</div>
<div id="bannerConfig">
<div>
<span>Banner Type</span>
<select>
</select>
</div>
<div>
<span>Banner Cost Item</span>
<select>
</select>
</div>
<div>
<span>Banner Start</span>
<input type="date" id="bannerStartDate" />
</div>
<div>
<span>Banner End</span>
<input type="date" id="bannerEndDate" />
</div>
</div>
</div>
</body> </body>
</html> </html>

View File

@ -1,3 +1,18 @@
async function fillDefaultBanners() { async function fillDefaultBanners() {
getBannerData() await getBannerData()
const selectList = document.getElementById('bannerDefaultSelect')
for (const banner in bannerObj) {
const data = bannerObj[banner]
const option = document.createElement('option')
option.value = banner
option.innerText = banner
selectList.appendChild(option)
}
}
async function handleBaseBannerChange() {
} }

View File

@ -1,5 +1,5 @@
document.addEventListener('DOMContentLoaded', async () => { document.addEventListener('DOMContentLoaded', async () => {
fillDefaultBanners() await fillDefaultBanners()
console.log('loaded') console.log('loaded')
}) })

View File

@ -1,11 +1,12 @@
Neutralino.init() Neutralino.init()
const filesystem = Neutralino.filesystem const filesystem = Neutralino.filesystem
let bannerObj
async function getBannerData() { async function getBannerData() {
const bannerData = await filesystem.readFile('resources/banner_creator/data/banners.txt') const bannerData = await filesystem.readFile('resources/banner_creator/data/banners.txt')
const lines = bannerData.split('\n') const lines = bannerData.split('\n')
let bannerObj = {} bannerObj = {}
for (const line of lines) { for (const line of lines) {
const values = line.split(' ') const values = line.split(' ')
@ -17,6 +18,4 @@ async function getBannerData() {
fourStars: values.slice(3) fourStars: values.slice(3)
} }
} }
console.log(bannerObj)
} }

View File

@ -14,13 +14,36 @@ body {
flex-direction: column flex-direction: column
} }
#bannerEditor span,
#base span { #base span {
display: block; display: block;
} }
#bannerEditor select,
#base select { #base select {
display: block; display: block;
width: 60%; width: 60%;
height: 30px; height: 30px;
margin: 10px auto; margin: 10px auto;
} }
#bannerEditor {
display: flex;
flex-wrap: wrap;
flex: 1 0 50%;
justify-content: space-around;
}
#bannerEditor div {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
flex: 1 0 50%;
}
#bannerConfig {
height: 100%;
}