mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-12 23:20:25 +08:00
added max option to custom background image size
This commit is contained in:
parent
230da777cb
commit
48c7835f2b
4 changed files with 22 additions and 3 deletions
|
@ -1375,7 +1375,7 @@ export function setCustomBackground(value, nosave) {
|
|||
}
|
||||
|
||||
export function setCustomBackgroundSize(value, nosave) {
|
||||
if (value != "cover" && value != "contain") {
|
||||
if (value != "cover" && value != "contain" && value!= "max") {
|
||||
value = "cover";
|
||||
}
|
||||
config.customBackgroundSize = value;
|
||||
|
|
|
@ -769,6 +769,13 @@ $(".pageSettings .section.customBackgroundSize .inputAndButton .contain").on(
|
|||
}
|
||||
);
|
||||
|
||||
$(".pageSettings .section.customBackgroundSize .inputAndButton .max").on(
|
||||
"click",
|
||||
(e) => {
|
||||
UpdateConfig.setCustomBackgroundSize("max");
|
||||
}
|
||||
);
|
||||
|
||||
$(".pageSettings .section.customBackgroundSize .inputAndButton input").keypress(
|
||||
(e) => {
|
||||
if (e.keyCode == 13) {
|
||||
|
|
|
@ -163,7 +163,11 @@ export function applyCustomBackground() {
|
|||
}
|
||||
|
||||
export function applyCustomBackgroundSize() {
|
||||
if (Config.customBackgroundSize != "") {
|
||||
if (Config.customBackgroundSize == "max"){
|
||||
$(".customBackground").css({
|
||||
backgroundSize: "100% 100%" ,
|
||||
});
|
||||
} else if (Config.customBackgroundSize != "") {
|
||||
$(".customBackground").css({
|
||||
backgroundSize: Config.customBackgroundSize,
|
||||
});
|
||||
|
|
|
@ -2925,7 +2925,7 @@
|
|||
<div class="text">
|
||||
Set an image url to be a custom background image. Cover fits
|
||||
the image to cover the screen. Contain fits the image to be
|
||||
fully visible.
|
||||
fully visible. Max fits the image corner to corner.
|
||||
</div>
|
||||
<div>
|
||||
<div class="inputAndButton">
|
||||
|
@ -2961,6 +2961,14 @@
|
|||
>
|
||||
contain
|
||||
</div>
|
||||
<div
|
||||
class="button"
|
||||
customBackGroundSize="max"
|
||||
tabindex="0"
|
||||
onclick="this.blur();"
|
||||
>
|
||||
max
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue