2.1.3 • Published 3 years ago
frontle-toast v2.1.3
Frontle Toast
Toast UI in Frontle

Usage
// at css file
.toastBackground{
background-color: grey;
}
.toastColor{
color: white;
}
// at js file
import frontle_toast from "browser_modules/frontle-toast/module.js";
const Toast = frontle_toast.Toast;
let toast = new Toast('<div>this is a toast<div>');
toast.toastClass = 'toastBackground toastColor';
toast.start = () => {
console.log('toast start!');
}
toast.open();Install
Frontle
frontle install frontle-toastDownload files
https://github.com/Artifriends-inc/Frontle-Toast
API
new toast(html)
Create a toast object
let toast = new Toast('<div>this is a toast<div>');.toastClass
Set the css class of a toast
toast.toastClass = 'toastBackground toastColor';.transitionSeconds
Set the toast animation time
toast.transitionSeconds = 0.3;.holdSeconds
Set the toast hold time
toast.holdSeconds = 3;.awake
This lifecycle runs before toast rendering.
toast.awake = () => { console.log('before rendering') }.start
This lifecycle runs after toast rendered
toast.start = () => { console.log('after rendering') }.end
This lifecycle runs before toast termination
toast.end = () => { console.log('before termination') }.sleep
This lifecycle runs after toast termination
toast.sleep = () => { console.log('after termination') }.open()
Open toast
toast.open();.close()
Close toast
toast.close();People
The original author of frontle-toast is MushStory