From a34d9af1185e47e855558e4814244a580cbf2be8 Mon Sep 17 00:00:00 2001 From: dstN Date: Wed, 6 May 2020 20:22:25 +0200 Subject: [PATCH] Hotfix UI, UI fixes, scrape another timeframe feature --- index.html | 150 +++++++++++++++++++++++++++-------------------------- main.js | 15 +++--- style.css | 31 +++++------ 3 files changed, 98 insertions(+), 98 deletions(-) diff --git a/index.html b/index.html index 1022361..306fc66 100644 --- a/index.html +++ b/index.html @@ -17,74 +17,74 @@

Transfermarkt Scraper

@@ -177,13 +177,15 @@

Transfermarkt Scraper

Scraping...

-

-    
-    
+    
+

+      
+      
+    
diff --git a/main.js b/main.js index 14d7a1b..846c024 100644 --- a/main.js +++ b/main.js @@ -86,10 +86,8 @@ function ajaxCall(startyear, endyear){ $("."+startyear+".before").append("

"+playerJSON+"

"); // parse json to browser }); $("."+startyear+".after").append("],"); - if(startyear++ < endyear) { - $(".loadingScrape").removeClass("visible"); - ajaxCall(startyear); + ajaxCall(startyear, endyear); } else { $(".loadingScrape").removeClass("visible"); @@ -99,10 +97,8 @@ function ajaxCall(startyear, endyear){ completeJSON = JSON.parse(completeJSON); completeJSON = JSON.stringify(completeJSON, undefined, 2); jsonoutput(syntaxHighlight(completeJSON)); - $(".copy").addClass("visible"); - $(".copy").prepend('

Scraping done!

'); - $(".copy button").addClass("visible"); - $("#copy").addClass("visible"); + $(".copy .copyinner").addClass("visible"); + $(".copy .loadingScrape").addClass("doneScrape").removeClass("loadingScrape").text("Scraping done!"); } }, error: function(error) { @@ -136,10 +132,11 @@ function copyFunction() { alert("Copied to clipboard!"); } function scrapeReset() { + $(".table .json").empty(); $(".copy pre").empty(); - $(".copy .doneScrape").remove(); - $(".copy, .copy pre, .copy button").removeClass("visible"); + $(".copyinner").removeClass("visible"); $(".form").addClass("visible"); + $(".copy .doneScrape").addClass("loadingScrape").text("Scraping..."); } function jsonoutput(input) { document.getElementById("copy").innerHTML = input; diff --git a/style.css b/style.css index fb69c6e..bddb2d0 100644 --- a/style.css +++ b/style.css @@ -10,6 +10,10 @@ body { margin: 0; padding: 0; } +h1 { + margin-top: 1rem; + margin-bottom: 1rem; +} ::selection { background: #e03100; color: #fff; @@ -22,18 +26,9 @@ body { display: none !important; visibility: hidden !important; } -.copy { - display: block !important; - visibility: visible !important; - position: absolute; - height: 100%; - width: 100%; - top: 0; - z-index: 0; -} .loadingScrape { - opacity: 0; visibility: hidden; + opacity: 0; color: #fff; text-align: center; text-shadow: 1px 1px 2px rgba(0,0,0,0.7), @@ -73,8 +68,6 @@ pre { max-height: 50vh !important; margin: auto; font-family: Console, monospace; - opacity: 0; - visibility: hidden; margin-bottom: 1rem; } .string { color: green; } @@ -105,8 +98,6 @@ button { background-position: 0 -100%; transition: 1.5s ease; filter: hue-rotate(140deg); - opacity: 0; - visibility: hidden; } button:focus { outline: 0 none; @@ -142,11 +133,21 @@ button:hover { display: block; margin-bottom: 10px; } +.copy { + position: absolute; + top: 0; + width: 100%; + height: 100%; + z-index: 0; +} +.copyinner { + opacity: 0; + visibility: hidden; +} .form { text-align: center; opacity: 0; visibility: hidden; - transition: all ease-in-out 1.5s; position: absolute; top: 0; width: 100%;