Skip to content

Commit

Permalink
Added travis confid and prettier to the project
Browse files Browse the repository at this point in the history
  • Loading branch information
apvarun committed May 31, 2018
1 parent e7218a2 commit 512ba0d
Show file tree
Hide file tree
Showing 10 changed files with 445 additions and 403 deletions.
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"useTabs": false,
"printWidth": 80,
"tabWidth": 2,
"singleQuote": false,
"trailingComma": "es5",
"parser": "babylon",
"noSemi": false
}
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
deploy:
skip_cleanup: true
on:
branch: production
44 changes: 29 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,49 @@
# Changelog

All the changes made to toastify-js library.

## [1.2.1] - 2018-05-31

* Added support for Classes. Now custom classes can be added to the toast while creating it.

## [1.2.0] - 2018-03-05
- Fix issue when `destination` and `close` options is used at the same time

* Fix issue when `destination` and `close` options is used at the same time

## [1.1.0] - 2018-02-18
- Browser support extended to IE10+ without any polyfills

* Browser support extended to IE10+ without any polyfills

## [1.0.0] - 2018-02-17
- Support for modules

* Support for modules

## [0.0.6] - 2017-09-09
- Support for changing background [Options]
- Optimized toast positioning logic
- Added changelog for library update tracking

* Support for changing background [Options]
* Optimized toast positioning logic
* Added changelog for library update tracking

## [0.0.5] - 2017-09-06
- Support for toast messages on mobile screens
- Tweaked close icon

* Support for toast messages on mobile screens
* Tweaked close icon

## [0.0.4] - 2017-09-05
- Support for positioning of toasts on the page

* Support for positioning of toasts on the page

## [0.0.3] - 2017-09-05
- Close buton for toasts [Options]

* Close buton for toasts [Options]

## [0.0.2] - 2017-09-04
- Option to add on-click link for toasts
- Updated comments for code readability

* Option to add on-click link for toasts
* Updated comments for code readability

## [0.0.1] - 2017-09-02
- Initial Release
- Added Preview page
- Optimized function structure

* Initial Release
* Added Preview page
* Optimized function structure
78 changes: 50 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![forthebadge](https://forthebadge.com/images/badges/made-with-javascript.svg)
![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)

[![toastify-js](https://img.shields.io/badge/toastify--js-1.2.0-brightgreen.svg)](https://www.npmjs.com/package/toastify-js)
[![toastify-js](https://img.shields.io/badge/toastify--js-1.2.2-brightgreen.svg)](https://www.npmjs.com/package/toastify-js)

Toastify is a lightweight, vanilla JS toast notification library.

Expand All @@ -13,32 +13,36 @@ Toastify is a lightweight, vanilla JS toast notification library.

## Features

- Multiple stacked notifications
- Customizable
- No blocking of execution thread
* Multiple stacked notifications
* Customizable
* No blocking of execution thread

### Customization options

- Notification Text
- Duration
- Toast background color
- Close icon display
- Display position
* Notification Text
* Duration
* Toast background color
* Close icon display
* Display position

## Installation

#### Toastify now supports installation via NPM

- Run the below command to add toastify-js to your exisitng or new project.
* Run the below command to add toastify-js to your exisitng or new project.

```
npm install --save toastify-js
```

or

```
yarn add toastify-js -S
```

- Import toastify-js into your module to start using it.
* Import toastify-js into your module to start using it.

```
import Toastify from 'toastify-js'
```
Expand All @@ -56,47 +60,65 @@ And the script at the bottom of the page
```html
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
```

> Files are delivered via the CDN service provided by [jsdeliver](https://www.jsdelivr.com/)
## Documentation

```javascript
Toastify({
text: "This is a toast",
duration: 3000,
destination: 'https://github.com/apvarun/toastify-js',
newWindow: true,
close: true,
gravity: "top", // `top` or `bottom`
positionLeft: true, // `true` or `false`
   backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)"
text: "This is a toast",
duration: 3000,
destination: "https://github.com/apvarun/toastify-js",
newWindow: true,
close: true,
gravity: "top", // `top` or `bottom`
positionLeft: true, // `true` or `false`
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
```

> Toast messages will be centered on devices with screen width less than 360px.
+ See the [changelog](https://github.com/apvarun/toastify-js/blob/master/CHANGELOG.md)
* See the [changelog](https://github.com/apvarun/toastify-js/blob/master/CHANGELOG.md)

### Add own custom classes

If you want to use custom classes (like info or warning for example) you can do that via
If you want to use custom classes on the toast for customizing (like info or warning for example), you can do that as follows:

```javascript
Toastify({
text: "This is a toast",
   backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
classes: "info"
text: "This is a toast",
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
classes: "info",
}).showToast();

```

Multiple classes also can be assigned as a string, with spaces between class names.

## Browsers support

| [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/edge.png" alt="IE / Edge" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />IE / Edge | [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/firefox.png" alt="Firefox" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />Firefox | [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome.png" alt="Chrome" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />Chrome | [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari.png" alt="Safari" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />Safari | [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/opera.png" alt="Opera" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />Opera |
| --------- | --------- | --------- | --------- | --------- |
| IE10, IE11, Edge| last 10 versions| last 10 versions| last 10 versions| last 10 versions
| ![][ie]<br />IE / Edge | ![][firefox]<br />Firefox | ![][chrome]<br />Chrome | ![][safari]<br />Safari | ![][opera]<br />Opera |
| ---------------------- | ------------------------- | ----------------------- | ----------------------- | --------------------- |
| IE10, IE11, Edge | last 10 versions | last 10 versions | last 10 versions | last 10 versions |

## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->

<!-- prettier-ignore -->
| [![rndevfx](https://avatars2.githubusercontent.com/u/5052076?v=3&s=80)](https://github.com/rndevfx) | [![Wachiwi](https://avatars1.githubusercontent.com/u/4199845?v=3&s=80)](https://github.com/Wachiwi) |
| :--:|:--: |
| [rndevfx](https://github.com/rndevfx) | [Wachiwi](https://github.com/Wachiwi) |

<!-- ALL-CONTRIBUTORS-LIST:END -->

## License

MIT © [Varun A P](https://github.com/apvarun)

[ie]: https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/edge.png
[firefox]: https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/firefox.png
[chrome]: https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome.png
[safari]: https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari.png
[opera]: https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/opera.png
35 changes: 23 additions & 12 deletions example/script.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
* {
box-sizing: border-box;
}
html,
body {

html, body {
height: 100%;
}

body {
font-family: Helvetica, Arial, sans-serif;
background-size: 100%;
margin: 0;
padding: 0;
color: #424242;
}

.container {
overflow: hidden;
display: flex;
Expand All @@ -22,10 +24,12 @@ body {
background-color: whitesmoke;
background-image: url("./pattern.png");
}
.hidden{

.hidden {
display: none;
}
.docs{

.docs {
display: flex;
justify-content: center;
flex-direction: column;
Expand All @@ -36,22 +40,27 @@ body {
width: 60%;
border-radius: 4px;
}
.docs h2{

.docs h2 {
margin-top: 0px;
}
code p{

code p {
margin: 2px;
}
.pad-left{

.pad-left {
padding-left: 20px;
}
.buttons{

.buttons {
margin: 20px;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.button{

.button {
overflow: hidden;
margin: 10px;
padding: 12px 12px;
Expand All @@ -74,11 +83,13 @@ code p{
background-color: Snow;
border: 1px solid #5477f5;
}
.button:hover{

.button:hover {
color: #FFFFFF;
background: linear-gradient(135deg, #73a5ff, #5477f5);
border: 1px solid transparent;
}
.repo{

.repo {
margin: 10px;
}
}
Loading

0 comments on commit 512ba0d

Please sign in to comment.