Skip to content

Commit

Permalink
AmaranJS 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanersu committed Sep 13, 2014
1 parent 883b7cb commit e9817e4
Show file tree
Hide file tree
Showing 23 changed files with 684 additions and 692 deletions.
39 changes: 39 additions & 0 deletions Gulpfile.js
@@ -0,0 +1,39 @@
var gulp = require("gulp"),
sass = require("gulp-ruby-sass"),
autoprefixer = require("gulp-autoprefixer"),
rename = require('gulp-rename'),
minifycss = require('gulp-minify-css'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
coffee = require('gulp-coffee');

// Gulp sass task
gulp.task('css',function(){
gulp.src("src/sass/**/*.sass")
.pipe(sass())
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
//.pipe(gulp.dest('dist/css'))
.pipe(rename({ suffix: '.min' }))
.pipe(minifycss())
.pipe(concat('amaran.min.css'))
.pipe(gulp.dest('dist/css'));
});



// Gulp coffee task
gulp.task('js',function(){
gulp.src("src/coffee/**/*.coffee")
.pipe(coffee())
.pipe(uglify())
.pipe(concat('jquery.amaran.min.js'))
.pipe(gulp.dest('dist/js'));
});

// Gulp watch task
gulp.task('watch',function(){
gulp.watch('src/sass/**/*.sass',['css']);
gulp.watch('src/coffee/**/*.coffee',['js']);
});

gulp.task('default',['watch']);
219 changes: 45 additions & 174 deletions README.md
@@ -1,228 +1,99 @@
New version coming soon with lots of changes.
AmaranJS jQuery Notification Plugin
============
Nice, sleek and stylish notifications.

https://github.com/hakanersu/AmaranJS/tree/coffee-sass
## What is new and What is changed


[Demo & Documentation](http://hakanersu.github.io/AmaranJS/)
* Blur Theme ,Rounded Theme and Read More theme removed.
* All javascript codes ported to coffee and css to sass.
* [Animate.css](http://daneden.github.io/animate.css/) and options added for alternative css3 effects.

### Important Change v0.2.0
* "default" theme changed to "awesome"
* Old default theme changed to "default" theme aka http://codepen.io/hakanersu/pen/Dxatp
## Some Features

### TODO
* Default theme will change to http://codepen.io/hakanersu/pen/Dxatp
* Callback functions will added to themes.
Here is the some basic features of AmaranJS.But i recommend that review the examples and check demos.

###Minimal Setup
Copy amaran folder in to your project folder.
* Easy notification creation.
* Unique notification animations.
* Included stylish themes.
* Easily adapt your own themes.
* Callbacks

It’s not required, but i recommend placing CSS files in ```<head>``` and JavaScript files and initialization code in the footer of your site (before the closing ```</body>``` tag).
## Installation

```
<link rel="stylesheet" href="amaran/css/jquery.amaran.min.css">
<link rel="stylesheet" href="amaran/css/themes/all-themes.css">
```
Go to dist directory and copy all the folders to a new destination, which will be your project home.

It’s not required, but i recommend placing CSS files in ```<head>``` and JavaScript files and initialization code in the footer of your site (before the closing ```</body>``` tag).

jQuery required for **Amaran JS**.If you already have **jquery.js** on your site, don’t include it a second time, or use **jQuery.noConflict();** mode.
jQuery required for **Amaran JS**.If you already have jquery.js on your site, don’t include it a second time, or use **jQuery.noConflict();** mode

```html
<link rel="stylesheet" href="/css/amaran.min.css">
```
You can add jQuery via Google CDN

```
```html
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
```

Place Amaran JS after jQuery

```html
<script src="/js/jquery.amaran.js"></script>
```
<script src="amaran/js/jquery.amaran.js"></script>
```

So minimalistic setup look like this

```
```html
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
<link rel="stylesheet" href="amaran/css/jquery.amaran.min.css">
<link rel="stylesheet" href="amaran/css/themes/all-themes.css">
<link rel="stylesheet" href="/css/amaran.min.css">
</head>
<body>
<p>My Content</p>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="amaran/js/jquery.amaran.js"></script>
<script src="/js/jquery.amaran.js"></script>
</body>
</html>
```

###Recomended Setup
### Optional Steps

I recommend Font Awesome Icons and Open Sans for better looking notifications.Specially for default theme.
Just place these two css files inside your ```<head>``` section.
* Awesome theme uses fontawesome if you want to use awesome theme you have to include fontawesome.

```
```html
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css'>
```
So recomended setup should look like this;

* If you want to use [Animate.css](http://daneden.github.io/animate.css/) effects you have to include [Animate.css](http://daneden.github.io/animate.css/) . [Animate.css](http://daneden.github.io/animate.css/) already included dist/css folder.

```html
<link rel="stylesheet" href="/css/animate.min.css">
```
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="amaran/css/jquery.amaran.min.css">
<link rel="stylesheet" href="amaran/css/themes/all-themes.css">
</head>
<body>
<p>My Content</p>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="amaran/js/jquery.amaran.js"></script>
</body>
</html>
```

###Basic Usage

We are ready to create our first example.Very very simple usage of Amaran JS.
## Usage
AmaranJS included 4 theme (for now).

First of all we must add our code inside jQuery document ready function.```$(function(){ });```

```
Very basic usage ,not include any theme.
```javascript
$(function(){
$.amaran({'message':'My first example!'});
});
```

If you add this code inside ```$(function(){ })``` function it will automatically popsup when page loads.

I know not funcy as demos lets create themed example.I will cover more about themes in next section.

```
$.amaran({
content:{
message:'My first funcy example!',
size:'1.4 GB',
file:'my_birthday.mp4',
icon:'fa fa-download'
},
theme:'default ok'
});
```
If you want to use included themes , you have to pass content object with desired fields.

Lets see full example.
Awesome theme usage.

```
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="amaran/css/jquery.amaran.min.css">
<link rel="stylesheet" href="amaran/css/themes/all-themes.css">
</head>
<body>
<p>My Content</p>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="amaran/js/jquery.amaran.js"></script>
<script>
$(function(){
$.amaran({
content:{
message:'Your Download is Ready!',
size:'1.4 GB',
file:'my_birthday.mp4',
icon:'fa fa-download'
},
theme:'default ok'
});
});
</script>
</body>
</html>
```

###Using Themes

We have currently 5 themes.Some of them have variations like "default" theme.Lets look at themes.

####default theme

Default theme has 7 variations.

// image will include here

Usage;

```
```javascript
$.amaran({
content:{
message:'Your Download is Ready!',
message:'My first funcy example!',
size:'1.4 GB',
file:'my_birthday.mp4',
icon:'fa fa-download'
},
theme:'default ok'
theme:'awesome ok'
});
```

You can specify a theme by passing ```theme : ''``` option to Amaran JS object.

For "default" theme you can call theme and variation with theme ```'default <VARIATION NAME>'``` e.g : ```theme:'default ok'``` or ```theme:'default error'```

For "default" theme we have 3 content options message,size and file.message represent first line,size second line and file reperesent third line.

With icon options you can specify icon."default" theme using Font Awesome icons.Icons list can be found in this ```http://fontawesome.io/icons/``` adress.

e.g For envelope icon just pass ```icons:'fa fa-envelope'```

**Creating your own variations**

```
.amaran.default.<VARIATION NAME> p.bold{
color:<COLOR CODE>;
}
.amaran.default.<VARIATION NAME> .icon {
background-color:<COLOR CODE>;
color:#fff;
}
```
Just change ```<VARIATION NAME>``` with your variation name and ```<COLOR CODE>``` with your color code and add in your main css file or you can add inside ```amaran/css/theme/default.css```
e.q

```
.amaran.default.pink p.bold{
color:#D704DE;
}
.amaran.default.pink .icon {
background-color:#D704DE;
color:#fff;
}
```

// image will include here

**user theme**

"user" theme has 4 variations

// image will include here

Usage :

```
$.amaran({
content:{
img:'http://api.randomuser.me/0.2/portraits/men/36.jpg',
user:'John Walker',
message:'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cupiditate, ducimus?'
},
theme:'user green',
});
```

Documentation not ready as MD i will add soon.
[Usage Documentation](http://hakanersu.github.io/AmaranJS/amaranjs/#basic-usage)
Documentation a bit outdated.
2 changes: 1 addition & 1 deletion amaranjs.jquery.json
Expand Up @@ -9,7 +9,7 @@
"jquery",
"plugin"
],
"version": "0.2.0",
"version": "0.5.0",
"author": {
"name": "Hakan ERSU",
"url": "http://blog.hakanersu.com/"
Expand Down
9 changes: 9 additions & 0 deletions dist/css/amaran.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions dist/css/animate.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/js/jquery.amaran.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion package.json
Expand Up @@ -4,5 +4,15 @@
"description": "Stylish Notifications",
"author": "Hakan ERSU",
"homepage": "http://hakanersu.github.io/AmaranJS/",
"version": "0.2.0"
"version": "0.5.0",
"devDependencies": {
"gulp": "~3.8.7",
"gulp-ruby-sass": "~0.7.1",
"gulp-autoprefixer": "0.0.8",
"gulp-rename": "~1.2.0",
"gulp-minify-css": "~0.3.7",
"gulp-concat": "~2.3.4",
"gulp-uglify": "~0.3.1",
"gulp-coffee": "~2.1.1"
}
}

0 comments on commit e9817e4

Please sign in to comment.