Pure JavaScript Library For Clean Toast Notifications – prophet.js

Category: Javascript , Notification | October 8, 2016
Author:binarybaba
Views Total:1,055 views
Official Page:Go to website
Last Update:October 8, 2016
License:MIT

Preview:

Pure JavaScript Library For Clean Toast Notifications – prophet.js

Description:

prophet.js is a simple JavaScript library used for display nice, clean, animated, temporary toast notifications in the webpage. The toast notification will destroy itself in a given amount of time. Currently comes with 4 types: default, error, tip and success.

Basic usage:

Add the following JavaScript and CSS files into the webpage.

<link href="prophet.css" rel="stylesheet">
<script src="prophet.js"></script>

Create a default toast message.

var toast = new Message('Message here!')

Show the message.

toast.show();

Execute a function after the toast message is removed or when the user clicks on it.

var toast = new Message("Message Here", function(id){
    // do something
    });
    toast.show();
}

Available options.

var toast = new Message('Message here!',{
    id:i++, // i defined somewhere up above
    duration: 8000, // The time each toast message stays on the web page before disappearing
    type: 'success', // success, error and default
    class : 'thin-border' // extra CSS class(es).
})

You Might Be Interested In:


Leave a Reply