-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.html
4 lines (4 loc) · 2.35 KB
/
index.html
1
2
3
4
<!DOCTYPE html><html lang="en"><head>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-160780833-1"></script>
<script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}
gtag('js', new Date()); gtag('config', 'UA-160780833-1');</script> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Covid-19 App By Ankit Sharma</title> <link rel="stylesheet" href="style.css"/></head><body> <div class="main-container"> <header class="header"> <div class="toggler"> <span></span> <span></span> <span></span> </div><div class="close"> <svg class="navbar--svg_close" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="18px" height="18px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve" style="display: block;"> <line fill="none" x1="5.4" y1="15.6" x2="5.4" y2="15.6"></line> <line fill="none" stroke="#fff" stroke-width="1.5" stroke-miterlimit="10" x1="0.5" y1="0.6" x2="19.4" y2="19.4"></line> <line fill="none" stroke="#fff" stroke-width="1.5" stroke-miterlimit="10" x1="19.4" y1="0.6" x2="0.6" y2="19.4"></line> </svg> </div><ul> <li> <a href="index.html">Overview</a> </li><li> <a href="countrywise.html">Countrywise Data</a> </li><li> <a href="datewise.html">DateWise Data</a> </li><li> <a href="datavisualization.html">Data Visualizations</a> </li></ul> </header> <h2 class="heading text-center">Covid-19 Worldwide Data</h2> <img id="affectedImg" src="" alt=""/> <h3>Confirmed Cases</h3> <div id="confirmedCases"></div><h3>Recovered Cases</h3> <div id="recoveredCases"></div><h3>Death Cases</h3> <div id="deathCases"></div></div><script src="script-min.js"></script> <script>document.addEventListener("DOMContentLoaded", ()=>{fetchApiData();}); function fetchApiData(){fetch(apiUrl) .then(response=> response.json()) .then(data=>{response=data; setData();}) .catch(err=> console.log(err));}function setData(){setImage(); setCases();}function setCases(){var confirmedNumber=response["confirmed"]["value"]; var recoveredNumber=response["recovered"]["value"]; var deathNumber=response["deaths"]["value"]; confirmed.textContent=confirmedNumber; recovered.textContent=recoveredNumber; deaths.textContent=deathNumber;}function setImage(){console.log(response); affectedImage.src=response["image"];}</script></body></html>