mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
consistent style for checkboxes
This commit is contained in:
parent
2754a644ae
commit
31e703d126
@ -336,3 +336,43 @@ a:visited {
|
||||
.smallfont {
|
||||
font-size: $defaultFontSize * 0.8125;
|
||||
}
|
||||
|
||||
.bbcheckbox {
|
||||
position: relative;
|
||||
display: inline;
|
||||
label {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: black;
|
||||
border-width: 1px;
|
||||
border-color: white;
|
||||
border-style: solid;
|
||||
&:after {
|
||||
content: '';
|
||||
width: 9px;
|
||||
height: 5px;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
border: 3px solid white;
|
||||
border-top: none;
|
||||
border-right: none;
|
||||
opacity: 0;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
input[type=checkbox] {
|
||||
visibility: hidden;
|
||||
&:checked + label:after {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -2527,16 +2527,31 @@ Bladeburner.prototype.updateContractsUIElement = function(el, action) {
|
||||
for:autolevelCheckboxId, innerText:"Autolevel",color:"white",
|
||||
tooltip:"Automatically increase contract level when possible"
|
||||
}));
|
||||
var autolevelCheckbox = createElement("input", {
|
||||
type:"checkbox", id:autolevelCheckboxId, margin:"4px",
|
||||
|
||||
const checkboxDiv = createElement("div", { class: "bbcheckbox" });
|
||||
const checkboxInput = createElement("input", {
|
||||
type:"checkbox",
|
||||
id: autolevelCheckboxId,
|
||||
checked: action.autoLevel,
|
||||
changeListener: () => {
|
||||
action.autoLevel = autolevelCheckbox.checked;
|
||||
}
|
||||
action.autoLevel = checkboxInput.checked;
|
||||
},
|
||||
});
|
||||
el.appendChild(autolevelCheckbox);
|
||||
const checkmarkLabel = createElement("label", { for: autolevelCheckboxId });
|
||||
checkboxDiv.appendChild(checkboxInput);
|
||||
checkboxDiv.appendChild(checkmarkLabel);
|
||||
|
||||
el.appendChild(checkboxDiv);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
<div class="bbcheckbox">
|
||||
<input type="checkbox" value="None" id="bbcheckbox" name="check" checked />
|
||||
<label for="bbcheckbox"></label>
|
||||
</div>
|
||||
*/
|
||||
|
||||
Bladeburner.prototype.updateOperationsUIElement = function(el, action) {
|
||||
removeChildrenFromElement(el);
|
||||
var isActive = el.classList.contains(ActiveActionCssClass);
|
||||
@ -2663,14 +2678,21 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) {
|
||||
for:autolevelCheckboxId, innerText:"Autolevel",color:"white",
|
||||
tooltip:"Automatically increase operation level when possible"
|
||||
}));
|
||||
var autolevelCheckbox = createElement("input", {
|
||||
type:"checkbox", id:autolevelCheckboxId, margin:"4px",
|
||||
|
||||
const checkboxDiv = createElement("div", { class: "bbcheckbox" });
|
||||
const checkboxInput = createElement("input", {
|
||||
type:"checkbox",
|
||||
id: autolevelCheckboxId,
|
||||
checked: action.autoLevel,
|
||||
changeListener: () => {
|
||||
action.autoLevel = autolevelCheckbox.checked;
|
||||
}
|
||||
action.autoLevel = checkboxInput.checked;
|
||||
},
|
||||
});
|
||||
el.appendChild(autolevelCheckbox);
|
||||
const checkmarkLabel = createElement("label", { for: autolevelCheckboxId });
|
||||
checkboxDiv.appendChild(checkboxInput);
|
||||
checkboxDiv.appendChild(checkmarkLabel);
|
||||
|
||||
el.appendChild(checkboxDiv);
|
||||
}
|
||||
|
||||
Bladeburner.prototype.updateBlackOpsUIElement = function(el, action) {
|
||||
|
Loading…
Reference in New Issue
Block a user