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 ----------------- //
|
||||
|
||||
var isCompleted = "Completed";
|
||||
var isNotCompleted = "Not Completed";
|
||||
var isCompleted = "";
|
||||
var isNotCompleted = "";
|
||||
var currentData = DATA_UNKNOWN;
|
||||
var completionSymbol = SYMBOL_FALSE;
|
||||
|
||||
|
|
@ -19,8 +19,8 @@ var divEnd = [
|
|||
"</div>"
|
||||
].join("\n");
|
||||
|
||||
var strongStart = "<strong>"
|
||||
var strongEnd = "</strong>"
|
||||
var strongStart = "";
|
||||
var strongEnd = "";
|
||||
|
||||
// ---------------- Hollow Knight Data Constant Objects ----------------- //
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ function HKCheckCompletion(jsonObject) {
|
|||
if (i === "completionPercentage") {
|
||||
if (HKPlayerData.completionPercentage >= 112) currentDataTrue(HKPlayerData.completionPercentage);
|
||||
else currentDataFalse(HKPlayerData.completionPercentage);
|
||||
fillHTML(DIV_ID.intro, "Hollow Knight Completion", " %");
|
||||
fillHTML(DIV_ID.intro, "Hollow Knight Completion: ", " %");
|
||||
}
|
||||
|
||||
// ---------------- Bosses (Base Game) --------------------- //
|
||||
|
|
@ -329,7 +329,7 @@ function HKCheckCompletion(jsonObject) {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
|||
18
index.html
18
index.html
|
|
@ -43,13 +43,27 @@
|
|||
- 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>
|
||||
|
||||
<div style="margin-bottom: 20px;"></div>
|
||||
|
||||
<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>
|
||||
|
||||
|
|
@ -101,5 +115,7 @@
|
|||
<h2>Godmaster Content Pack:</h2>
|
||||
<div id="hk-godmaster"></div>
|
||||
|
||||
</div> <!-- end content -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
10
style.css
10
style.css
|
|
@ -4,9 +4,19 @@ html {
|
|||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
#content {
|
||||
width: max-content;
|
||||
}
|
||||
h1 {
|
||||
margin: 0.6rem 0;
|
||||
}
|
||||
#h1-title {
|
||||
;
|
||||
}
|
||||
#save-area {
|
||||
width: 100%;
|
||||
height: calc(0.1 * 100vh);
|
||||
}
|
||||
h2 {
|
||||
margin: 0.6rem 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue