SHARE
TWEET

Untitled

a guest Apr 7th, 2020 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1">
  6.     <title>COVID-19 STATS</title>
  7.     <link rel="shortcut icon" href="favicon.ico" />
  8.     <link rel="stylesheet" href="style.css" />
  9. </head>
  10. <body>
  11.  
  12.   <h1>Statystyka dotycząca korona wirusa w Polsce</h1>
  13.   <div class="latest"></div>
  14.  
  15.   <div class="DescriptionBox">
  16.     <div class="table">
  17.       <table>
  18.         <tr>
  19.           <th>Data</th>
  20.           <th>Liczba przypadków</th>
  21.           <th>Przyrost</th>
  22.           <th>Zgony</th>
  23.           <th>Wyleczonych</th>
  24.         </tr>
  25.        </table>
  26.       </div>
  27.   </div>
  28.  
  29.  
  30. <script>
  31.    fetch("https://pomber.github.io/covid19/timeseries.json").then(res=>res.json()).then(res=>{
  32.     const { date, confirmed, deaths, recovered } = res.Poland[res.Poland.length - 1];
  33.     let span=document.querySelector(".latest")
  34.     span.innerHTML+=`<div class="date"> ${date} </div>
  35.     <div class="confirmed"> ${confirmed} </div>
  36.     <div class="recovered"> ${recovered} </div>
  37.     <div class="deaths"> ${deaths} </div>`;
  38.  
  39.     res["Poland"].reverse().forEach(({ date, confirmed, recovered, deaths }) =>{
  40.     let table=document.querySelector("table")
  41.     table.innerHTML+=`<tr>
  42.     <td> ${date} </td>
  43.     <td> ${confirmed} </td>
  44.     <td> PRZYROST DZIENNY </td>
  45.     <td> ${deaths} </td>
  46.     <td> ${recovered} </td>
  47.     </tr>`;}
  48.     );
  49.   }
  50. )
  51. </script>
  52.  
  53. </body>
  54. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top