1.0.5 • Published 4 years ago

istatus v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Installation

npm install istatus --save

or

yarn add istatus

or use CDN

<script src="https://cdn.jsdelivr.net/npm/istatus@1.0.5/build/istatus.min.js">

Usage

ES6 Module

import iStatus from 'iStatus';

iStatus();

CommonJs

const iStatus = require('iStatus');

iStatus();

Browsers

<script src='https://cdn.jsdelivr.net/npm/istatus@1.0.5/build/istatus.min.js'></script>

<script>
    window.onload = function () {
        iStatus();
    }
</script>

Available default themes

{
  "basic": {
    "theme" : "basic",
    "mode" : "light",
    "icon" : {
      "connected": "check",
      "disconnected": "cross"
    },
    "message" : {
      "connected" : "Internet connected",
      "disconnected" : "Internet disconnected"
    },
    "runEvery" : 30,
    "deleteAfter" : 10,
    "position" : "bottomLeft"
  }
}

How to use iStatus ?

The most basic way is to use default settings.

iStatus();

or you may extend default theme settings

iStatus({
    "theme": "basic",
    "mode": "dark"
});

or

iStatus({
    "theme": "basic",
    "message": {
        "connected": "Connected",
        "disconnected": "Disconnected"
    },
    "runEvery": 60,
    "deleteAfter": 15,
    "position": "topRight"
});

or use fontawesome like icons/images

iStatus({
    "theme": "basic",
    "icon": {
        "connected": "fas fa-wifi",
        "disconnected": "fas fa-wifi-slash"
    }
});

Notification configuration

PropertyDescriptionTypeDefaultOptions
themeName of the theme to use. Ex: CSS class namestringbasicFuture developments
modeLight/Dark UI for notification.stringlight"light", "dark"
iconSmall message icons inside the notification. Note: Higher precendence over property "image". If used, will overwrite "image"stringconnected: "check symbol", disconnected: "cross symbol"Can pass fontawesome like class names Ex: fas fa-wifi or fas fa-wifi-slash
messageNotification message to show inside the notification.stringconnected: "Internet connected", disconnected: "Internet disconnected"Pass own message as an object. Check how to use section.
runEveryWill check internet status every mentioned number of seconds. Suitable value is 30 or above.number30Type in seconds.
deleteAfterWill remove notification once status changes to connected automatically.number10Type in seconds.
positionAlign the notification in four different positions.stringbottomLeftbottomLeft, bottomRight, topLeft, topRight

Contributing

If you're changing the core library:

  1. Clone repository and run npm install.
  2. Make changes in the src and add theme configuration inside the themeConfig.js file, if any.
  3. Test build at your end properly.
  4. Submit pull request.

If you're changing the documentation:

  1. Make changes in the readme.md file and explain everything well.
  2. Preview changes and make sure everything is aligned.
  3. Submit pull request
1.0.2

4 years ago

1.0.1

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago