Skip to content

SuperZombi/Notification_JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notification_JS

Quickly create a notification item

Usage Example | Preview

Usage:

HTML:

<head>
    <link href="https://superzombi.github.io/Notification_JS/notifications.css" rel="stylesheet">
    <script src="https://superzombi.github.io/Notification_JS/notifications.js"></script>
</head>

JavaScript:

notice = new Notifications('#notifications');
  
async function func_name(){
    await notice.Warning("Hello world!", false)
    await notice.Error("Hello world!", false, [['OK', show_more], 'Cancel'])
    await notice.Success("Hello world!", 3000)
}

Methods:

Warning(), Error(), Success(), Info() (text, autohide, ms, buttons)

text - string (Required)
autohide - boolean (default: true)
ms - integer (default: 5000) (milliseconds)
buttons - array ( [button_name] ) ( [[button_name, function]] )


Constructor:

Notifications()

Attribute Data type Default
element documentElement document.body

animationIN()

Attribute Data type Default
anim_name string or array or arguments ["scale", "opacity"]
List of available values:
["none", "opacity", "scale", "scale-right", "scale-left"]

Usage Example | Preview


clear() - Clear non active notifications

clearAll() - Clear all notifications


Plugins

Minimalism
<link href="https://superzombi.github.io/Notification_JS/plugins/minimalism.css" rel="stylesheet">


Example | Preview


Simplity
<link href="https://superzombi.github.io/Notification_JS/plugins/simplity.css" rel="stylesheet">


Example | Preview


Windows XP
<link href="https://superzombi.github.io/Notification_JS/plugins/windows.css" rel="stylesheet">


Example | Preview


💲Support the project

Donatello
Donation Alerts

(But now it's better to email me and I'll send you the details)