Small JS Library for displaying a notification-banner.
Include
<link rel="stylesheet" href="dist/UABanner.min.css" />
<script type="text/javascript" src="dist/UABanner.min.js"></script>
in your header
Constructor:
UABanner(String title, String text, Int timeout, Array buttons, Int width);
or
UABanner(Object options);
Possible values for the options object:
title
: String, requiredtext
: Stringwidth
: Int, default: 800, min: 200timeout
: Int, default: (buttons specified? yes => No timeout, no => 4000ms); In Milisecondsbuttons
: Array of UAButton objects
Constructor:
UAButton(String text, String style, Function pressedEventHandler);
or
UAButton(Object options);
Possible values for the options object:
text
: String, requiredstyle
: String, default: UAButton.NORMALpressedEventHandler
: Function
var banner = new UABanner({
title: "Title",
text : "Text",
width: 500,
buttons: [
new UAButton({
text: "Ok",
style: UAButton.NORMAL,
pressedEventHandler: function(e) {
// ...
}
}),
// ...
]
});
banner.show();
For a demo open demo/index.html in your browser or check out this link: https://lukasbischof.github.io/UABanner/demo/index.html
To test the current code, use the command yarn run webpack:watch
to continuously rebuild the current version.
To make a release version, run yarn run build
to generate a minified version in the dist folder.