mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-22 07:08:11 +00:00
get banner data
This commit is contained in:
parent
5873603821
commit
82b81bbd6b
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"applicationId": "js.grassclipper.app",
|
"applicationId": "js.grassclipper.app",
|
||||||
"version": "0.7.3",
|
"version": "0.7.2",
|
||||||
"resourcesURL": "https://github.com/Grasscutters/GrassClipper/releases/latest/download/resources.neu"
|
"resourcesURL": "https://github.com/Grasscutters/GrassClipper/releases/latest/download/resources.neu"
|
||||||
}
|
}
|
@ -1,13 +1,12 @@
|
|||||||
{
|
{
|
||||||
"applicationId": "js.grassclipper.app",
|
"applicationId": "js.grassclipper.app",
|
||||||
"version": "0.7.3",
|
"version": "0.7.2",
|
||||||
"defaultMode": "window",
|
"defaultMode": "window",
|
||||||
"port": 0,
|
"port": 0,
|
||||||
"documentRoot": "/resources/",
|
"documentRoot": "/resources/",
|
||||||
"url": "/",
|
"url": "/",
|
||||||
"enableServer": true,
|
"enableServer": true,
|
||||||
"enableNativeAPI": true,
|
"enableNativeAPI": true,
|
||||||
"tokenSecurity": "one-time",
|
|
||||||
"logging": {
|
"logging": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"writeToLogFile": true
|
"writeToLogFile": true
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "grassclipper",
|
"name": "grassclipper",
|
||||||
"version": "0.7.3",
|
"version": "0.7.2",
|
||||||
"repository": "https://github.com/Grasscutters/GrassClipper.git",
|
"repository": "https://github.com/Grasscutters/GrassClipper.git",
|
||||||
"author": "SpikeHD <spikegdofficial@gmail.com>",
|
"author": "SpikeHD <spikegdofficial@gmail.com>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
@ -2,12 +2,14 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css" href="style/banner.css" />
|
<link rel="stylesheet" type="text/css" href="style/banner.css" />
|
||||||
<script src="js/neutralino.js"></script>
|
<script src="../js/neutralino.js"></script>
|
||||||
|
<script src="js/helpers.js"></script>
|
||||||
<script src="js/banner_data.js"></script>
|
<script src="js/banner_data.js"></script>
|
||||||
|
<script src="js/banner_onload.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="base">
|
<div id="base">
|
||||||
<span>Select a banner to use as a base (or select no banner to start from scratch)</span>
|
<span>Select a banner to use as a base:</span>
|
||||||
<select id="bannerDefaultSelect">
|
<select id="bannerDefaultSelect">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
async function fillDefaultBanners() {
|
||||||
|
getBannerData()
|
||||||
|
}
|
5
resources/banner_creator/js/banner_onload.js
Normal file
5
resources/banner_creator/js/banner_onload.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
fillDefaultBanners()
|
||||||
|
|
||||||
|
console.log('loaded')
|
||||||
|
})
|
22
resources/banner_creator/js/helpers.js
Normal file
22
resources/banner_creator/js/helpers.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
Neutralino.init()
|
||||||
|
|
||||||
|
const filesystem = Neutralino.filesystem
|
||||||
|
|
||||||
|
async function getBannerData() {
|
||||||
|
const bannerData = await filesystem.readFile('resources/banner_creator/data/banners.txt')
|
||||||
|
const lines = bannerData.split('\n')
|
||||||
|
let bannerObj = {}
|
||||||
|
|
||||||
|
for (const line of lines) {
|
||||||
|
const values = line.split(' ')
|
||||||
|
|
||||||
|
bannerObj[values[0]] = {
|
||||||
|
assetName: values[1],
|
||||||
|
fiveStar: values[2],
|
||||||
|
// The rest are a list of 4 stars
|
||||||
|
fourStars: values.slice(3)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(bannerObj)
|
||||||
|
}
|
@ -3,6 +3,24 @@ html { user-select: none; }
|
|||||||
body {
|
body {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: 95vh;
|
height: 95vh;
|
||||||
margin: 0;
|
margin: 5%;
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#base {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column
|
||||||
|
}
|
||||||
|
|
||||||
|
#base span {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#base select {
|
||||||
|
display: block;
|
||||||
|
width: 60%;
|
||||||
|
height: 30px;
|
||||||
|
margin: 10px auto;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user