diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 34e8388..0000000 --- a/.jshintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "boss": true, - "curly": true, - "eqeqeq": true, - "eqnull": true, - "expr": true, - "immed": true, - "noarg": true, - "onevar": true, - "quotmark": "double", - "smarttabs": true, - "trailing": true, - "unused": true, - "node": true -} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index baa0031..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 2406556..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,69 +0,0 @@ -module.exports = function(grunt) { - - grunt.initConfig({ - - // Import package manifest - pkg: grunt.file.readJSON("boilerplate.jquery.json"), - - // Banner definitions - meta: { - banner: "/*\n" + - " * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n" + - " * <%= pkg.description %>\n" + - " * <%= pkg.homepage %>\n" + - " *\n" + - " * Made by <%= pkg.author.name %>\n" + - " * Under <%= pkg.licenses[0].type %> License\n" + - " */\n" - }, - - // Concat definitions - concat: { - dist: { - src: ["src/jquery.boilerplate.js"], - dest: "dist/jquery.boilerplate.js" - }, - options: { - banner: "<%= meta.banner %>" - } - }, - - // Lint definitions - jshint: { - files: ["src/jquery.boilerplate.js"], - options: { - jshintrc: ".jshintrc" - } - }, - - // Minify definitions - uglify: { - my_target: { - src: ["dist/jquery.boilerplate.js"], - dest: "dist/jquery.boilerplate.min.js" - }, - options: { - banner: "<%= meta.banner %>" - } - }, - - // CoffeeScript compilation - coffee: { - compile: { - files: { - "dist/jquery.boilerplate.js": "src/jquery.boilerplate.coffee" - } - } - } - - }); - - grunt.loadNpmTasks("grunt-contrib-concat"); - grunt.loadNpmTasks("grunt-contrib-jshint"); - grunt.loadNpmTasks("grunt-contrib-uglify"); - grunt.loadNpmTasks("grunt-contrib-coffee"); - - grunt.registerTask("default", ["jshint", "concat", "uglify"]); - grunt.registerTask("travis", ["jshint"]); - -}; diff --git a/bower.json b/bower.json deleted file mode 100644 index 828a319..0000000 --- a/bower.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "jquery-boilerplate", - "version": "3.3.3", - "homepage": "http://jqueryboilerplate.com", - "authors": [ - "Zeno Rocha " - ], - "description": "A jump-start for jQuery plugins development.", - "main": "src/jquery.boilerplate.js", - "keywords": [ - "jquery", - "plugin", - "boilerplate", - "jquery-plugin", - "jquery-boilerplate" - ], - "license": "MIT" -} diff --git a/dist/jquery.boilerplate.js b/dist/jquery.boilerplate.js deleted file mode 100644 index 8c51fca..0000000 --- a/dist/jquery.boilerplate.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * jQuery Boilerplate - v3.3.2 - * A jump-start for jQuery plugins development. - * http://jqueryboilerplate.com - * - * Made by Zeno Rocha - * Under MIT License - */ -// the semi-colon before function invocation is a safety net against concatenated -// scripts and/or other plugins which may not be closed properly. -;(function ( $, window, document, undefined ) { - - // undefined is used here as the undefined global variable in ECMAScript 3 is - // mutable (ie. it can be changed by someone else). undefined isn't really being - // passed in so we can ensure the value of it is truly undefined. In ES5, undefined - // can no longer be modified. - - // window and document are passed through as local variable rather than global - // as this (slightly) quickens the resolution process and can be more efficiently - // minified (especially when both are regularly referenced in your plugin). - - // Create the defaults once - var pluginName = "defaultPluginName", - defaults = { - propertyName: "value" - }; - - // The actual plugin constructor - function Plugin ( element, options ) { - this.element = element; - // jQuery has an extend method which merges the contents of two or - // more objects, storing the result in the first object. The first object - // is generally empty as we don't want to alter the default options for - // future instances of the plugin - this.settings = $.extend( {}, defaults, options ); - this._defaults = defaults; - this._name = pluginName; - this.init(); - } - - Plugin.prototype = { - init: function () { - // Place initialization logic here - // You already have access to the DOM element and - // the options via the instance, e.g. this.element - // and this.settings - // you can add more functions like the one below and - // call them like so: this.yourOtherFunction(this.element, this.settings). - console.log("xD"); - }, - yourOtherFunction: function () { - // some logic - } - }; - - // A really lightweight plugin wrapper around the constructor, - // preventing against multiple instantiations - $.fn[ pluginName ] = function ( options ) { - this.each(function() { - if ( !$.data( this, "plugin_" + pluginName ) ) { - $.data( this, "plugin_" + pluginName, new Plugin( this, options ) ); - } - }); - - // chain jQuery functions - return this; - }; - -})( jQuery, window, document ); diff --git a/dist/jquery.boilerplate.min.js b/dist/jquery.boilerplate.min.js deleted file mode 100644 index 5876b13..0000000 --- a/dist/jquery.boilerplate.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * jQuery Boilerplate - v3.3.2 - * A jump-start for jQuery plugins development. - * http://jqueryboilerplate.com - * - * Made by Zeno Rocha - * Under MIT License - */ -!function(a){function b(b,e){this.element=b,this.settings=a.extend({},d,e),this._defaults=d,this._name=c,this.init()}var c="defaultPluginName",d={propertyName:"value"};b.prototype={init:function(){console.log("xD")},yourOtherFunction:function(){}},a.fn[c]=function(d){return this.each(function(){a.data(this,"plugin_"+c)||a.data(this,"plugin_"+c,new b(this,d))}),this}}(jQuery,window,document); \ No newline at end of file diff --git a/jquery.sliphover.json b/jquery.sliphover.json index fc2fc71..31e2565 100644 --- a/jquery.sliphover.json +++ b/jquery.sliphover.json @@ -1,46 +1,42 @@ { - "name": "boilerplate", - "title": "jQuery Boilerplate", - "description": "A jump-start for jQuery plugins development.", - "keywords": [ - "jquery", - "boilerplate", - "plugins" - ], - "version": "3.3.3", - "author": { - "name": "Zeno Rocha", - "email": "zno.rocha@gmail.com", - "url": "https://github.com/zenorocha" - }, - "maintainers": [ - { - "name": "Zeno Rocha", - "email": "zno.rocha@gmail.com", - "url": "https://github.com/zenorocha" - }, - { - "name": "Addy Osmani", - "email": "addyosmani@gmail.com", - "url": "https://github.com/addyosmani" - }, - { - "name": "Helder Santana", - "email": "heldr@me.com", - "url": "https://github.com/heldr" - } - ], - "licenses": [ - { - "type": "MIT", - "url": "http://zenorocha.mit-license.org/" - } - ], - "bugs": "https://github.com/jquery-boilerplate/boilerplate/issues", - "homepage": "http://jqueryboilerplate.com", - "docs": "https://github.com/jquery-boilerplate/boilerplate#readme", - "download": "https://github.com/jquery-boilerplate/boilerplate/archive/master.zip", - "dependencies": { - "jquery": ">=1.4" - } -} + "name": "sliphover", + "title": "SlipHover", + "description": "Apply direction aware 2D/3D hover effect to images", + "keywords": [ + "direction-aware", + "animation", + "effect", + "hover", + "image", + "caption", + "overlay", + "gallery" + ], + "version": "2.0.0", + "author": { + "name": "wayou", + "email": "liuwayong@gmail.com", + "url": "https://github.com/wayou" + }, + "maintainers": [ + { + "name": "wayou", + "email": "liuwayong@gmail.com", + "url": "https://github.com/wayou" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-color/blob/2.1.2/MIT-LICENSE.txt" + } + ], + "bugs": "https://github.com/wayou/sliphover/issues", + "homepage": "http://wayou.github.io/SlipHover/", + "docs": "http://wayou.github.io/SlipHover/", + "demo":"http://wayou.github.io/SlipHover/", + "download": "https://github.com/wayou/SlipHover/zipball/master", + "dependencies": { + "jquery": ">=1.5" + } +} \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index aca3a74..0000000 --- a/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "private": true, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-cli": "~0.1.13", - "grunt-contrib-jshint": "~0.8.0", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-uglify": "~0.3.2", - "grunt-contrib-coffee": "~0.9.0" - }, - "scripts": { - "test": "grunt travis --verbose" - } -} diff --git a/src/jquery.sliphover.min.js b/src/jquery.sliphover.min.js new file mode 100644 index 0000000..46d56b7 --- /dev/null +++ b/src/jquery.sliphover.min.js @@ -0,0 +1 @@ +!function(a,b){function g(b,c){this.element=b,this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.version="v1.2.0",this.init()}var e="sliphover",f={target:"img",caption:"title",duration:"fast",fontColor:"#fff",textAlign:"center",verticalMiddle:!0,backgroundColor:"rgba(0,0,0,.7)",reverse:!1,height:"100%",withLink:!0};g.prototype={init:function(){var b=this,c=this.settings.target;a(this.element).off("mouseenter.sliphover",c).on("mouseenter.sliphover",c,function(c){var d=a(c.target),e=b.createContainer(d);e.off("mouseenter.sliphover mouseleave.sliphover").on("mouseenter.sliphover mouseleave.sliphover",function(c){var f=b.getDirection(a(this),c);if(f=b.settings.reverse?f=(f+2)%4:f,"mouseenter"===c.type){var g=e.find(".sliphover-overlay");g.length||(g=b.createOverlay(b,f,d),a(this).html(g)),b.slideIn(b,g)}else b.removeOverlay(b,a(this),f)})})},createContainer:function(b){var c=b.offset().top,d=b.offset().left,e=b.outerWidth(),f=b.outerHeight();zIndex=b.css("z-index");var g=a("
",{"class":"sliphover-container"}).css({width:e,height:f,position:"absolute",overflow:"hidden",top:c,left:d,zIndex:zIndex==+zIndex?zIndex+1:999});return a("body").append(g),g},createOverlay:function(c,d,e){var f,g,h,i,j;switch(d){case 0:g=0,f="100%";break;case 1:g="100%",f=0;break;case 2:g=0,f="-100%";break;case 3:g="-100%",f=0;break;default:b.console.error("error when get direction of the mouse")}if(i=c.settings.verticalMiddle?a("
").css({display:"table-cell",verticalAlign:"middle"}).html(e.attr(c.settings.caption)):e.attr(c.settings.caption),j=e.parent("a"),j.length&&c.settings.withLink){var k=j.attr("href");h=a("",{"class":"sliphover-overlay",href:k||"#"}).css({textDecoration:"none"})}else h=a("
",{"class":"sliphover-overlay"});return h.css({width:"100%",height:c.settings.height,position:"absolute",left:g,bottom:f,display:c.settings.verticalMiddle?"table":"inline",textAlign:c.settings.textAlign,color:c.settings.fontColor,backgroundColor:c.settings.backgroundColor}).html(i),h},slideIn:function(a,b){b.stop().animate({left:0,bottom:0},a.settings.duration)},removeOverlay:function(a,c,d){var e,f=c.find(".sliphover-overlay");switch(d){case 0:e={bottom:"100%",left:0};break;case 1:e={bottom:0,left:"100%"};break;case 2:e={bottom:"-100%",left:0};break;case 3:e={bottom:0,left:"-100%"};break;default:b.console.error("error when get direction of the mouse")}f.stop().animate(e,a.settings.duration,function(){c.remove()})},getDirection:function(a,b){var c=a.width(),d=a.height(),e=(b.pageX-a.offset().left-c/2)*(c>d?d/c:1),f=(b.pageY-a.offset().top-d/2)*(d>c?c/d:1),g=Math.round((Math.atan2(f,e)*(180/Math.PI)+180)/90+3)%4;return g}},a.fn[e]=function(b){return this.each(function(){a.data(this,"plugin_"+e)||a.data(this,"plugin_"+e,new g(this,b))}),this}}(jQuery,window,document); \ No newline at end of file