Ver código fonte

Fix the displaying of fullscreen coins.

Lee Morgan 4 anos atrás
pai
commit
7559a6a041
2 arquivos alterados com 18 adições e 8 exclusões
  1. 6 3
      views/main/index.css
  2. 12 5
      views/main/index.html

+ 6 - 3
views/main/index.css

@@ -279,8 +279,11 @@ body{
         position: fixed;
         z-index: 100;
     }
-    
-    .fullscreenCurrency{
+
+    .paper{
+        width: 100%;
+    }
+
+    .coin{
         width: 100%;
-        max-height: 100%;
     }

+ 12 - 5
views/main/index.html

@@ -401,14 +401,21 @@
                 .catch((err)=>{});
 
             //Get currency data
-            let displayImage = (image)=>{
+            let displayImage = (image, cType)=>{
                 let div = document.createElement("div");
-                div.classList.add("fullImageBackground")
+                div.classList.add("fullImageBackground");
                 div.onclick = ()=>{document.body.removeChild(div)};
                 document.body.appendChild(div);
 
                 image.className = "";
-                image.classList.add("fullscreenCurrency");
+                image.style.margin = "auto";
+                if(cType === "paper"){
+                    image.style.height = "";
+                    image.style.width = "100%";
+                }else{
+                    image.style.width = "";
+                    image.style.height = "100%";
+                }
                 div.appendChild(image);
             }
 
@@ -437,10 +444,10 @@
                         currency.querySelector(".info").innerText = `${currencies[i].value} ${code ? code : ""}`;
                         frontImage.src = currencies[i].frontImage;
                         frontImage.onload = ()=>{imageSize(frontImage)};
-                        frontImage.onclick = ()=>{displayImage(frontImage.cloneNode(true))};
+                        frontImage.onclick = ()=>{displayImage(frontImage.cloneNode(true), currencies[i].type)};
                         backImage.src = currencies[i].backImage;
                         backImage.onload = ()=>{imageSize(backImage)};
-                        backImage.onclick = ()=>{displayImage(backImage.cloneNode(true))};
+                        backImage.onclick = ()=>{displayImage(backImage.cloneNode(true), currencies[i].type)};
                         currency.querySelector(".comment").innerText = currencies[i].comment;
                         container.appendChild(currency);
                     }