Live Coronavirus (COVID-19) Statistics Widget

Covid19stats.js is a jQuery plugin to create a coronavirus (COVID-19, SARS-CoV-2) statistics widget that fetches data from coronavirus-tracker-api and displays confirmed cases, deaths, and recovered patients by country.

How to use it:

1 Load the covid19.css for the basic styling of the widget.

<link href="dist/css/covid19.css" rel="stylesheet" />
  1. Create a container to hold the widget.
<div id="covid-widget"></div>
  1. Load the covid19stats.js after loading jQuery library.
<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/dist/js/covid19stats.js"></script>
  1. Initialize the plugin on the container element you just created and determine the ISO Country Code to filter coronavirus (COVID-19, SARS-CoV-2) statistics data by country.
$.covid19stats({
  element: "#covid-widget", 
  countryCode: "IT"
});

5 Determine whether to show confirmed cases, deaths, and recovered patients. Default: true.

$.covid19stats({
  element: "#covid-widget", 
  countryCode: "IT",
  showCases: true,
  showDeaths: false,
  showRecovered: true
});
  1. Determine whether to show a Coronavirus image in the widget. Default: true.
$.covid19stats({
  element: "#covid-widget", 
  countryCode: "IT",
  showImg: false
});
  1. Determine whether to show the ‘Covid19 Stats’ label. Default: true.
$.covid19stats({
  element: "#covid-widget", 
  countryCode: "IT",
  showRightLabel: false
});

Download Details:

Author: ExpDev07

Live Demo: https://coronavirus-tracker-api.herokuapp.com/

GitHub: https://github.com/ExpDev07/coronavirus-tracker-api

#coronavirus #javascript #jquery #covid-19

Live Coronavirus (COVID-19) Statistics Widget
10.65 GEEK