1.0.0 • Published 6 years ago

socket-not-connected v1.0.0

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

Socket Not Connected

A widget that notifies when a websocket can't connect

Installing using yarn

yarn add socket-not-connected

Usage

Just add the socket-not-connected.js file after jQuery and ReconnectingWebSocket to your html and in any script add:

var socket = socketNotConnected(url-socket);

Settings

OptionTypeDefaultDescription
attemptsint3Numbers of reconect attempts of the socket after it show the modal
overlayBackgroundColorstringrgba(0,0,0,.7)The background color of the overlay of the modal
textColorstringinheritColor of the text
contentBackgroundColorstring#fffBackground color of the modal
linkColorstring#f11442Color of the link

Example

var socket = socketNotConnected(url-socket, {
  overlayBackgroundColor: 'rgba(51,51,51,.7)',
  textColor: '#333',
  linkColor: '#ef7731'
});

Brought to you by the lovely folks at Axiacore

1.0.0

6 years ago