add textarea
This commit is contained in:
parent
9eb0a271d0
commit
10b22b521e
3 changed files with 35 additions and 9 deletions
|
|
@ -6,8 +6,8 @@ const SYMBOL_TRUE = "✅ ";
|
||||||
|
|
||||||
// ---------------- Variables ----------------- //
|
// ---------------- Variables ----------------- //
|
||||||
|
|
||||||
var isCompleted = "Completed";
|
var isCompleted = "";
|
||||||
var isNotCompleted = "Not Completed";
|
var isNotCompleted = "";
|
||||||
var currentData = DATA_UNKNOWN;
|
var currentData = DATA_UNKNOWN;
|
||||||
var completionSymbol = SYMBOL_FALSE;
|
var completionSymbol = SYMBOL_FALSE;
|
||||||
|
|
||||||
|
|
@ -19,8 +19,8 @@ var divEnd = [
|
||||||
"</div>"
|
"</div>"
|
||||||
].join("\n");
|
].join("\n");
|
||||||
|
|
||||||
var strongStart = "<strong>"
|
var strongStart = "";
|
||||||
var strongEnd = "</strong>"
|
var strongEnd = "";
|
||||||
|
|
||||||
// ---------------- Hollow Knight Data Constant Objects ----------------- //
|
// ---------------- Hollow Knight Data Constant Objects ----------------- //
|
||||||
|
|
||||||
|
|
@ -235,7 +235,7 @@ function HKCheckCompletion(jsonObject) {
|
||||||
if (i === "completionPercentage") {
|
if (i === "completionPercentage") {
|
||||||
if (HKPlayerData.completionPercentage >= 112) currentDataTrue(HKPlayerData.completionPercentage);
|
if (HKPlayerData.completionPercentage >= 112) currentDataTrue(HKPlayerData.completionPercentage);
|
||||||
else currentDataFalse(HKPlayerData.completionPercentage);
|
else currentDataFalse(HKPlayerData.completionPercentage);
|
||||||
fillHTML(DIV_ID.intro, "Hollow Knight Completion", " %");
|
fillHTML(DIV_ID.intro, "Hollow Knight Completion: ", " %");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------- Bosses (Base Game) --------------------- //
|
// ---------------- Bosses (Base Game) --------------------- //
|
||||||
|
|
@ -329,7 +329,7 @@ function HKCheckCompletion(jsonObject) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fillHTML(divId = "", textPrefix = "Unknown Completion Element: ", textSuffix = "") {
|
function fillHTML(divId = "", textPrefix = "Unknown Completion Element: ", textSuffix = "") {
|
||||||
document.getElementById(divId).innerHTML += divStart + completionSymbol + strongStart + textPrefix + ": " + strongEnd + currentData + textSuffix + divEnd;
|
document.getElementById(divId).innerHTML += divStart + completionSymbol + strongStart + textPrefix + "" + strongEnd + currentData + textSuffix + divEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
function currentDataTrue(textData = isCompleted) {
|
function currentDataTrue(textData = isCompleted) {
|
||||||
|
|
|
||||||
22
index.html
22
index.html
|
|
@ -42,14 +42,28 @@
|
||||||
- Single Pale Ore locations?
|
- Single Pale Ore locations?
|
||||||
- Read JSON file from text input
|
- Read JSON file from text input
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<h1>Hollow Knight Completion % Check</h1>
|
<div id="content">
|
||||||
|
|
||||||
|
<h1 id="h1-title">Hollow Knight Completion % Check</h1>
|
||||||
|
|
||||||
<p class="smalltext">Check what you have left for completion.</p>
|
<p class="smalltext">Check what you have left for completion.</p>
|
||||||
|
|
||||||
<div style="margin-bottom: 20px;"></div>
|
<div style="margin-bottom: 20px;"></div>
|
||||||
|
|
||||||
<button id="startbutton" onclick="HKCheckCompletion( jsonObj );">Run Script</button>
|
<div>
|
||||||
|
<textarea name="save-area" id="save-area"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button id="save-area-read" onclick="HKReadTextArea();">Analyze</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-bottom: 20px;"></div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button id="startbutton" onclick="HKCheckCompletion( jsonObj );">Run Script</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div style="margin-bottom: 20px;"></div>
|
<div style="margin-bottom: 20px;"></div>
|
||||||
|
|
||||||
|
|
@ -101,5 +115,7 @@
|
||||||
<h2>Godmaster Content Pack:</h2>
|
<h2>Godmaster Content Pack:</h2>
|
||||||
<div id="hk-godmaster"></div>
|
<div id="hk-godmaster"></div>
|
||||||
|
|
||||||
|
</div> <!-- end content -->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
10
style.css
10
style.css
|
|
@ -4,9 +4,19 @@ html {
|
||||||
body {
|
body {
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
}
|
}
|
||||||
|
#content {
|
||||||
|
width: max-content;
|
||||||
|
}
|
||||||
h1 {
|
h1 {
|
||||||
margin: 0.6rem 0;
|
margin: 0.6rem 0;
|
||||||
}
|
}
|
||||||
|
#h1-title {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
#save-area {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(0.1 * 100vh);
|
||||||
|
}
|
||||||
h2 {
|
h2 {
|
||||||
margin: 0.6rem 0;
|
margin: 0.6rem 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue