percent box initial (prefill)

This commit is contained in:
ReznoRMichael 2021-01-31 14:26:27 +01:00
parent 80ca653599
commit aee60e754a
4 changed files with 31 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -683,3 +683,16 @@ input[type="radio"] {
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
} }
.percent-box {
display: inline-block;
text-align: center;
font-size: 1.1rem;
vertical-align: middle;
color: #d9f3ff;
margin: 0 0.5rem 0rem 0.5rem;
padding: 0.2rem 1.2rem 0.2rem 1.2rem;
background: #1e4d6c;
border: 2px solid #3e6d8c;
border-radius: 4px;
}

View file

@ -575,4 +575,17 @@ input[type="radio"] {
.tooltip:hover .tooltip-text { .tooltip:hover .tooltip-text {
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
}
.percent-box {
display: inline-block;
text-align: center;
font-size: 1.1rem;
vertical-align: middle;
color: #d9f3ff;
margin: 0 0.5rem 0rem 0.5rem;
padding: 0.2rem 1.2rem 0.2rem 1.2rem;
background: #1e4d6c;
border: 2px solid #3e6d8c;
border-radius: 4px;
} }

View file

@ -275,11 +275,12 @@ function PrefillHTML(jsObj) {
h2 = jsObj[i].h2; h2 = jsObj[i].h2;
h2id = "h2-" + jsObj[i].id; h2id = "h2-" + jsObj[i].id;
mp = " " + jsObj[i].maxPercent + "%"; mp = `<div class='percent-box'>${(i === "intro") ? 0: jsObj[i].maxPercent}%</div>`;
if (!jsObj[i].hasOwnProperty("maxPercent") || i === "intro") mp = ""; if (!jsObj[i].hasOwnProperty("maxPercent")) mp = "";
document.getElementById("generated").innerHTML += "<div id='" + id + "'" + cl + ">" + "</div>"; document.getElementById("generated").innerHTML += "<div id='" + id + "'" + cl + ">" + "</div>";
document.getElementById(id).innerHTML += "<h2 id='" + h2id + "'>" + h2 + mp + "</h2>"; // document.getElementById(id).innerHTML += "<h2 id='" + h2id + "'>" + h2 + mp + "</h2>";
document.getElementById(id).innerHTML += `<h2 id='${h2id}'>${h2}${mp}</h2>`;
} }
} }