Skip to content

Commit

Permalink
add styles and library
Browse files Browse the repository at this point in the history
  • Loading branch information
Jignesh Kakadiya committed Apr 29, 2015
1 parent a4bcd35 commit b4f33cd
Show file tree
Hide file tree
Showing 33 changed files with 3,827 additions and 183 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
67 changes: 67 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforeBinaryOperators": [
","
],
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowYodaConditions": true,
"disallowKeywords": [ "with" ],
"disallowMultipleLineBreaks": true,
"disallowMultipleVarDecl": true,
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireBlocksOnNewline": 1,
"requireCommaBeforeLineBreak": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceAfterBinaryOperators": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"requireSpacesInForStatement": true,
"requireSpaceBetweenArguments": true,
"requireCurlyBraces": [
"do"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"case",
"return",
"try",
"catch",
"typeof"
],
"requirePaddingNewLinesBeforeLineComments": {
"allExcept": "firstAfterCurly"
},
"requirePaddingNewLinesAfterBlocks": true,
"safeContextKeyword": "_this",
"validateLineBreaks": "LF",
"validateIndentation": 4
}
87 changes: 87 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*global module:false*/
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") + "\\n" %>' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n\n'
},
jshint: {
files: ['Gruntfile.js', 'src/<%= pkg.name %>.js'],
options: {
browser: true,
devel: true
}
},
uglify: {
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['src/<%= pkg.name %>.js']
}
}
},
concat: {
options: {
banner: '<%= meta.banner %>'
},
lib: {
src: ['src/<%= pkg.name %>.js'],
dest: 'dist/<%= pkg.name %>.js'
},
minLib: {
src: ['dist/<%= pkg.name %>.min.js'],
dest: 'dist/<%= pkg.name %>.min.js'
}
},
postcss: {
options: {
map: false,
processors: [
require('autoprefixer-core')({browsers: ["chrome 41", "chrome 4", "firefox 37", "firefox 5", "ie 10", "ie_mob 11", "opera 12", "safari 8"]}).postcss,
require('csswring').postcss
]
},
dist: {
src: 'css/iconate.css',
dest: 'dist/iconate.min.css'
}
},
watch: {
css: {
files: ['css/*.css'],
tasks: ['postcss'],
options: {
spawn: false
}
},
js: {
files: ['src/*.js'],
tasks: ['concat'],
options: {
spawn: false
}
}
}
});

// Dependencies
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-postcss');

grunt.registerTask('build', [
'postcss',
'jshint',
'uglify',
'concat'
]);
grunt.registerTask('default', 'build');
};
113 changes: 113 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#iconate.js
*A call to transform your icons in cool trendy way (no svg required)*

`iconate.js` is tiny performant library for cross-browser icon transformation animations in your projects.

##[View Demo](http://bitshadow.github.io/iconate.js)

Installation
------------
- [Download zip](https://github.com/bitshadow/iconate.js/archive/master.zip).

**Note**: **iconate.js** also supports AMD and commonJS module pattern.


## Basic Usage
1. Include the Stylesheet and Javascript files on your html.

```
<head>
<link rel="stylesheet" href="iconate.min.css">
</head>
<body>
<!-- if you are using font-awesome -->
<i id="icon" class="fa fa-bars fa-lg"></i>
<!-- if you are using glyphicons -->
<span class="glyphicons glyphicons-menu-hamburger"></span>
/**
* Your Template
*/
<script type="text/javascript" src="iconate.min.js">
</body>
```

2. You can animate an icon on click event.

`Using Javascript:`
```
var iconElement = document.getElementById('icon'),
options = {
from: 'fa-bars',
to: 'fa-arrow-right',
animation: 'rubberBand'
};
iconElement.addEventListener('click', function() {
iconate(this, options);
});
```

`Using jQuery:`
```
var $icon = $('#icon'),
options = {
from: 'fa-bars',
to: 'fa-arrow-right',
animation: 'rubberBand'
};
$icon.click(function(e) {
iconate(this, options);
});
```


3. You can pass following AnimationTypes to iconate call.
* `rollOutRight`
* `rollOutLeft`
* `rubberBand`
* `zoomOut`
* `zoomIn`
* `fadeOut`
* `fadeOutRight`
* `fadeOutLeft`
* `fadeOutTop`
* `fadeOutBottom`
* `horizontalFlip`
* `verticalFlip`
* `bounceOutBottom`
* `bounceOutTop`
* `bounceOutLeft`
* `bounceOutRight`
* `rotateClockwise`
* `rotateAntiClockwise`
* `tada`


Public API
----------

### iconate(element, [, options] [, callback] )

Animate an icon element.
* `element` - Icon Element to perform operations on.
* `options` - Object containing options to control the animation.
* `from` - Current icon class name (ex. 'fa-bars' in case of font-awesome)
* `to` - Final icon class name (ex. 'fa-arrow-right')
* `animation` - You can choose any animation from above listed animation types. (ex. 'fadeOutRight')
* `callback` - Optional callback to execute after animation completes.

Browser Support
---------------

`iconate.js` works best on latest versions of Google Chrome, Firefox and Safari and opera and IE.

License
-------

Copyright (c) 2015 Jignesh Kakadiya, http://bitshadow.github.io
Licensed under the [MIT license](http://opensource.org/licenses/MIT).
Binary file added css/.DS_Store
Binary file not shown.
Loading

0 comments on commit b4f33cd

Please sign in to comment.