A simple and lightweight javascript library to create a toast on your website.
Read documentation: https://togi-simaremare.my.id/ttoast/
- Download js files and place it to your project folder OR you can use jsdelivr CDN
- Include the js file into your project (ex. in index.html)
<script src="https://cdn.jsdelivr.net/gh/togihon/TToast@update/ttoast.js"></script>
- To show a toast, use this code:
TToast({
text: 'Your text',
position: 'bottom|center',
fontsize: 'normal',
color: 'Font Color',
background: 'Background color',
icon: 'fas fa-check',
})
All attributes must be written in lowercase.
text: this will be shown to the userpositionmust be written inpos1|pos2format.
pos1 : top, middle, bottom
pos2 : left, center, rightfontSize: small, normal, largecolorandbackground: you can use all color format (HEX, RGB, RBGA, etc.)icon: this one is optional. But, if you want to use this you have to include an icon kit. For example i use FontAwesome so the kit is already included in my project. To show acheck iconin FontAwesome we use<i class="fas fa-check"></i>.
But, iniconattribute, just fill the class name (fas fa-check).
