diff --git a/README.md b/README.md new file mode 100644 index 0000000..26036d0 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# BSToast5 + +> BSToast5 is a JavaScript helper for improving Bootstrap 5 toasts. Add (and remove) toasts to a page dynamically. Bootstrap 5 is required. + +--- + +## Features + +- Add (inject) and remove toasts into a page + +## Screenshots + +[![screenshot](wiki/screenshot-1-h240.png)](wiki/screenshot-1.png) + +--- + +## Background + +This tool is an odd one, it might just be one of those tools that are only useful to me. +I wanted to search (a set of given) directories for files that match a wildcard pattern. +Then I wanted to run a file (from that list) at random. +For example: you wanted to watch a random episode of your favourite show. + +--- + +## Releases & Builds + +See [Releases](/Ray/bstoast5) + +## Documentation + +See [Usage](wiki/USAGE.md) + +## Acknowledgements + +This software uses a number of dependencies and assets from third-parties. +These developers and artists deserve due credit for their work and for their commitment to sharing their work freely. +Each product is released under their own particular license, for more information please visit their websites. + +- [Bootstrap](https://getbootstrap.com/) + +## License + +This project is licensed under the least restrictive terms of its dependencies, viz. MIT License. \ No newline at end of file diff --git a/wiki/USAGE.md b/wiki/USAGE.md new file mode 100644 index 0000000..0ba0cf1 --- /dev/null +++ b/wiki/USAGE.md @@ -0,0 +1,66 @@ +# BSToast5 + +## Usage + +This is the usage guide for **BSToast5**, version **0.1.0.001**. + +--- + +## `Create(options)` + +Creates a toast on the page. The default position is the **top-right**. + +### Options + +```javascript +{ + Icon: null, + Title: "", + Time: "", + Message: "", + Animation: true, + AutoHide: true, + Delay: 2000, + Position: "top:0; right:0; margin:20px;" +} +``` + +### Parameters + +| Name | Type | Description | +|------|------|-------------| +| `Icon` | `html` | HTML for the top-left image. | +| `Title` | `string` | Label displayed at the top of the toast. | +| `Time` | `string` | Text displayed at the top-right of the toast, typically the time. | +| `Message` | `string` | Text body of the toast. | +| `Animation` | `bool` | Whether the toast opens with an animation. | +| `AutoHide` | `bool` | Whether the toast automatically closes after a delay. | +| `Delay` | `int` | Delay before automatically closing the toast, in milliseconds. | +| `Position` | `css` | CSS class or CSS positioning used for the toast container. | + +### Example + +```javascript +BSToast5.Create({ + Icon: null, + Title: "Burnt Bread", + Time: "Some time ago", + Message: "Oh noes! I'm toast!", + Animation: true, + AutoHide: true, + Delay: 2500, + Position: "top-0 end-0 p-3" +}); +``` + +--- + +## `Clear()` + +Closes all toasts currently displayed on the page. + +### Example + +```javascript +BSToast5.Clear(); +``` \ No newline at end of file diff --git a/wiki/screenshot-1-h240.png b/wiki/screenshot-1-h240.png new file mode 100644 index 0000000..2d49f6c Binary files /dev/null and b/wiki/screenshot-1-h240.png differ diff --git a/wiki/screenshot-1.png b/wiki/screenshot-1.png new file mode 100644 index 0000000..545bc2f Binary files /dev/null and b/wiki/screenshot-1.png differ