Skip to content

Commit

Permalink
better scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
Axwabo committed Feb 7, 2024
1 parent 9944cf3 commit 9c41be6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Interactive SCP-914 recipe list for SCP:SL.">
<meta name="author" content="Axwabo">
<meta name="keywords" content="SCP, SCPSL, SCP:SL, SCP Secret Lab, SCP Secret Laboratory, 914, SCP-914, SCP SL, Secret Lab, SCP Universe, SCP games, SCP:CB, SCP: Containment Breach, SCPCB, SCP CB, Containment Breach, SCP 914, SCP:SL 914, SCPSL Recipes, SCP:SL Recipes">
Expand Down
9 changes: 5 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ function loadApp() {
function getScale() {
const w = window.innerWidth;
const h = window.innerHeight;
return Math.max(0.7, w > h ? h / 1080 : w / 1920);
return Math.max(0.4, w > h ? h / 1080 : w / 1920);
}

function onResize() {
Expand Down Expand Up @@ -530,6 +530,7 @@ function selectItem(div) {
}
targetIsSecondary = false;
const clone = div.cloneNode(true);
clone.querySelector(".basicIcon")?.classList.add("scale-05");
clone.setAttribute("data-item-name", item);
const cont = $(s ? "#secondaryItem" : "#primaryItem").html("").append(clone);
clone.addEventListener("click", () => {
Expand Down Expand Up @@ -937,8 +938,7 @@ function unitPriceGraph() {
preventGuiFromClosing = true;
closeContextMenu();
$("#unitGraphCont").addClass("visible");
if ($("#appInfoCont.visible").get(0))
$("#appInfoCont").removeClass("visible");
$("#appInfoCont, #outputCont").removeClass("visible");
}

function closeGraph(overrideClicks = false) {
Expand Down Expand Up @@ -970,7 +970,7 @@ function addKeycard(infoCont, i) {
const img = document.createElement("img");
img.src = acc.img;
img.draggable = false;
img.classList.add("basicIcon, scale-035");
img.classList.add("basicIcon", "scale-035");
img.alt = level;
accessCont.append(img);
}
Expand Down Expand Up @@ -1010,6 +1010,7 @@ function addAmmo(infoCont, i) {
if (item.category !== "firearm" || item.ammo !== i.name)
continue;
const clone = interactableItemClone(item.name, null, "info");
clone.querySelector(".basicIcon")?.classList.add("scale-05");
firearmsCont.append(clone);
}
infoCont.append(firearmsCont);
Expand Down
25 changes: 16 additions & 9 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ body {
#langToggle {
visibility: hidden;
border: none;
font-size: 40px;
font-size: 30px;
background-color: rgba(0, 0, 0, 0.5);
color: rgb(200, 200, 200);
user-select: none;
Expand All @@ -84,7 +84,7 @@ body {

#appInfoBtn {
visibility: hidden;
font-size: 40px;
font-size: 30px;
background-color: transparent;
width: 1.5em;
height: 1.5em;
Expand Down Expand Up @@ -161,6 +161,7 @@ body {

#overlays > div {
width: calc(100% - 100px);
min-height: 90%;
padding: 2.5% 32px 2.5% 68px;
display: grid;
justify-content: center;
Expand All @@ -174,6 +175,12 @@ body {
display: none;
}

#unitGraphCont {
gap: 0.5em;
justify-content: start !important;
justify-items: start !important;
}

.iconCont {
display: flex;
justify-content: center;
Expand All @@ -198,6 +205,7 @@ body {
}

.itemInfo {
user-select: none;
opacity: 0;
transition: 0.3s;
background-color: rgba(0, 0, 0, 0.75);
Expand Down Expand Up @@ -304,7 +312,7 @@ body {
background-color: rgb(10, 10, 10);
position: absolute;
z-index: 10;
padding: 0.3rem;
padding: 0.2rem;
overflow: hidden;
}

Expand All @@ -313,12 +321,11 @@ body {
background-color: rgb(30, 30, 30);
color: white;
cursor: pointer;
font-size: 1.5rem;
width: 100%;
transition-duration: 0.2s;
transition-property: background-color, color, outline-color;
white-space: nowrap;
outline: 0.1em solid transparent;
min-height: 2em;
}

.ctxButton:not(:first-child) {
Expand Down Expand Up @@ -357,9 +364,9 @@ body {

#notice {
width: 100vw;
font-size: 2rem;
font-size: 20px;
display: block;
margin-top: 1em;
margin-top: 0.5em;
}

.chanceCont {
Expand Down Expand Up @@ -390,16 +397,16 @@ body {
}

#graphTitle {
font-size: 2em;
font-size: 1.5em;
font-weight: bold;
text-align: center;
color: rgb(255, 180, 0);
}

#unitGraphTable {
border-collapse: collapse;
/*display: block;*/
overflow: scroll;
min-width: 20em;
}

tr, td {
Expand Down

0 comments on commit 9c41be6

Please sign in to comment.