diff --git a/README.md b/README.md index 06f40a0..066bf20 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stratum.js — Masonry Grid Library -> version 1.0.1 +> version 1.0.2 ### Table of contents @@ -9,17 +9,17 @@ - [Additional information](https://github.com/zaxoavoki/stratum.js#additional-information) - [Future updates](https://github.com/zaxoavoki/stratum.js#future-updates) - [Copyright and license](https://github.com/zaxoavoki/stratum.js#copyright-and-license) + - [Changes history](https://github.com/zaxoavoki/stratum.js#changes-history) ### How to install - - You can download it with [stratum.js CDN](https://cdn.rawgit.com/zaxoavoki/stratum.js/31373231/dist/stratum.min.js) - - You can find it in [npm](https://www.npmjs.com/package/stratum.js) + - Using [NPM](https://www.npmjs.com/package/stratum.js) - Use with npm: - - ``` - npm i stratum.js - ``` + ``` + npm i stratum.js + ``` + + - or download [the latest .min version](https://rawgit.com/zaxoavoki/stratum.js/master/dist/stratum.min.js) ### How to use @@ -42,12 +42,14 @@ parameter with three options: ### Additional information - You may need to add a grid element once, but you do not want it to be visible. In this case, simply specify for the child element to have `display: none` or add class with this CSS rule. + If you need to add a grid element, but you do not want it to be visible. In this case, simply specify for the child element to have `display: none` or add class with this CSS rule. + + **stratum.js** project is independent of any other packages. That's why it's light weight and is only + *1.7KiB* for minimized version and *7.31KiB* for normal. ### Future updates - - Older browsers supports - - Add responsive grid checker + - Add support of old browsers ### Copyright and license @@ -55,4 +57,9 @@ Code and documentation copyright 2018. Code released under the [MIT License](htt ##### Work together -You can improve this plugin with your ideas. Just tell me or send pull request. \ No newline at end of file +You can improve this plugin with your ideas. Just tell me or send pull request. + +#### Changes history + +`v1.0.2` - Added sliding effect for grid elements. +`v1.0.1` - Initiated project. \ No newline at end of file diff --git a/dist/stratum.js b/dist/stratum.js index b060a35..9d8053b 100644 --- a/dist/stratum.js +++ b/dist/stratum.js @@ -145,6 +145,7 @@ if (gridItem.children().css('display') !== 'none') { gridItem.css({ position: 'absolute', + transition: 'ease .5s', width: 100 / columns + '%', padding: padding }); @@ -187,8 +188,7 @@ }); }); - // Set grid height. - grid.css('height', Math.max.apply(null, sizes)); + grid.css('height', Math.max.apply(null, sizes)); // Set grid height } $(window).on('load resize', init); diff --git a/dist/stratum.min.js b/dist/stratum.min.js index 5d0ea06..616cd84 100644 --- a/dist/stratum.min.js +++ b/dist/stratum.min.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r;(r=jQuery).fn.stratum=function(e){var t=r.extend({padding:10,columns:3,smart:!1},e),n=r(this),i=void 0,o=t.columns,u=t.padding,a=t.smart,l=0,d=0;return this.each(function(){r(window).on("load resize",function(){i=[],n.css("position","relative"),n.children().each(function(e,t){var n=r(t),s=void 0;"none"!==(s=void 0!==n.data("grid-item")?n:n.wrap("
").parent()).children().css("display")&&s.css({position:"absolute",width:100/o+"%",padding:u});var c=s.outerHeight(!0);if(a){var f=void 0;if(i.length>=o){var p=Math.min.apply(null,i);f=i.indexOf(p),l=p,i[f]+=c}else l=0,f=e,i.push(c);d=100/o*(f%o)}else e%o==0?d=0:d+=100/o,i.length