add textarea

This commit is contained in:
ReznoRMichael 2020-08-26 00:14:50 +02:00
parent 9eb0a271d0
commit 10b22b521e
3 changed files with 35 additions and 9 deletions

View file

@ -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) {

View file

@ -43,13 +43,27 @@
- 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>

View file

@ -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;
} }