Skip to content

Commit

Permalink
[v1.1.1] - Added Documentation for timingfuntion
Browse files Browse the repository at this point in the history
  • Loading branch information
CGWebDev2003 committed Jan 3, 2024
1 parent 3110dee commit c914c10
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 24 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Released]

## [v1.1.9] - 2023/01/03
## [v1.1.1] - 2023/01/03

- Added Documentation for Timing function

## [v1.1.0] - 2023/01/03

- Added Timing Function

Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Toast Class Documentation

The `Toast` class is designed to create Neptune-style toasts, providing a visually appealing way to display messages on a web page. This documentation provides an overview of the class, its constructor, and usage examples.
The `Toast` class allows you to create Neptune-style toasts with configurable options such as icon, message text, style, position, and visibility time.

## Class: Toast

### Description

Create a new Neptune Toast with customizable configurations such as icon, message text, style, and position.
Create a new Neptune Toast with customizable configurations.

### Constructor

Expand All @@ -16,7 +16,8 @@ javascriptCopy code
icon: "YOUR ICON",
text: "Test Toast",
style: "primary",
position: "top-right"
position: "top-right",
time: 5000,
});`

#### Parameters
Expand All @@ -33,6 +34,8 @@ javascriptCopy code

- `position` (String): (Optional) The position of the toast on the screen, which can be one of the following: "left-top", "left-bottom", "right-top", or "right-bottom".

- `time` (Number): (Optional) The time (in milliseconds) until the toast becomes invisible. If not provided, the toast will remain visible until manually removed.

### Example

javascriptCopy code
Expand All @@ -41,10 +44,11 @@ javascriptCopy code
icon: "YOUR ICON",
text: "Test Toast",
style: "primary",
position: "top-right"
position: "top-right",
time: 5000,
});`

This example creates a new `Toast` instance with a specified icon, message text, style, and position.
This example creates a new `Toast` instance with a specified icon, message text, style, position, and visibility time.

### Toast Configuration

Expand All @@ -56,10 +60,12 @@ This example creates a new `Toast` instance with a specified icon, message text,

- Position: The position of the toast on the screen. Options include "left-top", "left-bottom", "right-top", or "right-bottom".

- Time: The time until the toast becomes invisible. If not provided, the toast will remain visible until manually removed.

### Error Handling

If the `text` parameter is not provided, an error message will be logged to the console, indicating that a message should be added to the toast.

### Usage

To use the `Toast` class, instantiate it with a configuration object, specifying the desired icon, message text, style, and position. The toast will then be appended to the specified parent element or `document.body` if no parent is provided.
To use the `Toast` class, instantiate it with a configuration object, specifying the desired icon, message text, style, position, and visibility time. The toast will then be appended to the specified parent element or `document.body` if no parent is provided. If a visibility time is specified, the toast will automatically be removed after that duration.
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "toast-cg",
"version": "1.1.0",
"description": "A lightweight toast package in Js and CSS",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"Toast",
"Js",
"Css"
],
"author": "Colin Grahm",
"license": "MIT",
"repository": {
"url": "https://github.com/CGWebDev2003/toast-cg"
}
"name": "toast-cg",
"version": "1.1.1",
"description": "A lightweight toast package in Js and CSS",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"Toast",
"Js",
"Css"
],
"author": "Colin Grahm",
"license": "MIT",
"repository": {
"url": "https://github.com/CGWebDev2003/toast-cg"
}
}

0 comments on commit c914c10

Please sign in to comment.