Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSaints committed Mar 21, 2014
0 parents commit dda50c5
Show file tree
Hide file tree
Showing 10 changed files with 313 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Created by http://www.gitignore.io

### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp


### Bower ###
bower_components


### Node ###
lib-cov
lcov.info
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results
build
.grunt

node_modules


### SASS ###
### Sass Ignores - "Sassy CSS" http://sass-lang.com/
*.sass-cache


### Compass ###
.sass-cache


### SublimeText ###
# workspace files are user-specific
*.sublime-workspace

# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project
20 changes: 20 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'

uglify:
options:
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */'
dist:
files:
'dist/morphist.min.js': ['dist/morphist.js']

jshint:
all: ['dist/morphist.js']

grunt.loadNpmTasks 'grunt-contrib-jshint';
grunt.loadNpmTasks 'grunt-contrib-uglify';

grunt.registerTask('default', ['uglify', 'test']);
grunt.registerTask('test', ['jshint']);
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright © 2013 Ian Lai <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Morphist
========

A simple jQuery slider / slideshow / carousel plugin for child objects powered by Animate.css and inspired by a Dota 2 hero, Morphling.
It is a spin-off project of [Morphext](https://github.com/MrSaints/Morphext).


Install
-------

Download from the [project page](https://github.com/MrSaints/Morphist).

Install with [Bower](http://bower.io/): `bower install --save Morphist`


Usage
-----

TBA


Prerequisites
-------------
- [jQuery](http://www.jquery.com/)
- [Animate.css](http://daneden.github.io/animate.css/)


License
-------
Morphist is licensed under the MIT license [(http://ian.mit-license.org/)](http://ian.mit-license.org/).
33 changes: 33 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "Morphist",
"version": "1.0.0",
"description": "A simple jQuery slider / slideshow / carousel plugin for child objects powered by Animate.css and inspired by a Dota 2 hero, Morphling.",
"authors": [
"Ian Lai <[email protected]>"
],
"main": [
"dist/morphist.js",
"dist/morphist.css"
],
"keywords": [
"jquery",
"cycle",
"slider",
"slideshow",
"animate.css",
"carousel"
],
"license": "http://ian.mit-license.org/",
"private": false,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"animate.css": "~3.1.0",
"jquery": "~2.1.0"
}
}
7 changes: 7 additions & 0 deletions dist/morphist.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.morphist > * {
display: none;
}

.morphist > .animated {
display: inline-block;
}
79 changes: 79 additions & 0 deletions dist/morphist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*!
* Morphist v1.0.0 - Text Rotating Plugin for jQuery
* https://github.com/MrSaints/Morphist
*
* Built on jQuery Boilerplate
* http://jqueryboilerplate.com/
*
* Copyright 2014 Ian Lai and other contributors
* Released under the MIT license
* http://ian.mit-license.org/
*/
;(function ($, window, document, undefined) {
var pluginName = "Morphist",
defaults = {
animateIn: "bounceIn",
animateOut: "rollOut",
speed: 2000
};

function Plugin (element, options) {
this.element = $(element);

this.settings = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = pluginName;
this.init();
}

Plugin.prototype = {
init: function () {
var $that = this;
this.children = this.element.children();

this.element.addClass('morphist');

this.index = -1;

this.cycle();
},
animate: function () {
var $that = this;

++this.index;
this.prev = this.index;

this.children.eq(this.index).addClass('animated ' + this.settings.animateIn);

setTimeout(function () {
$that.cycle();
}, this.settings.speed);
},
cycle: function () {
var $that = this;

if ((this.index + 1) === this.children.length)
this.index = -1;

if (typeof this.prev !== "undefined" && this.prev !== null) {
this.children.eq(this.prev)
.addClass(this.settings.animateOut)
.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$(this).removeClass();
$that.animate();
});
return;
}

this.animate();
}
};

$.fn[pluginName] = function (options) {
return this.each(function() {
if (!$.data(this, "plugin_" + pluginName)) {
$.data(this, "plugin_" + pluginName, new Plugin(this, options));
}
});
};
})(jQuery, window, document);
1 change: 1 addition & 0 deletions dist/morphist.min.js

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

34 changes: 34 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Morphist 1.0.0 Example / Demo</title>
<meta name="description" content="A simple jQuery slider / slideshow / carousel plugin for child objects powered by Animate.css and inspired by a Dota 2 hero, Morphling.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
<link rel="stylesheet" href="dist/morphist.css">
</head>
<body>
<div style="text-align:center">
I am a...
<ul id="js-rotating">
<li>So Simple</li>
<li>Very Doge</li>
<li>Much Wow</li>
<li>Such Cool</li>
</ul>
...child object rotator.
</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="bower_components/jquery/jquery.min.js"><\/script>')</script>
<script src="dist/morphist.js"></script>
<script>
$("#js-rotating").Morphist({
animateIn: 'tada',
animateOut: 'bounceOut'
});
</script>
</body>
</html>
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Morphist",
"version": "1.0.0",
"description": "A simple jQuery slider / slideshow / carousel plugin for child objects powered by Animate.css and inspired by a Dota 2 hero, Morphling.",
"main": "Gruntfile.coffee",
"scripts": {
"test": "grunt test"
},
"repository": {
"type": "git",
"url": "git://github.com/MrSaints/Morphist.git"
},
"author": "Ian Lai <[email protected]>",
"licenses": [
{
"type": "MIT",
"url": "http://ian.mit-license.org/"
}
],
"bugs": {
"url": "https://github.com/MrSaints/Morphist/issues"
},
"homepage": "https://github.com/MrSaints/Morphist",
"devDependencies": {
"grunt": "^0.4.4",
"grunt-contrib-jshint": "^0.9.2",
"grunt-contrib-uglify": "^0.4.0"
}
}

0 comments on commit dda50c5

Please sign in to comment.