Skip to content
This repository was archived by the owner on May 14, 2019. It is now read-only.

Commit

Permalink
Refactor API big commit 🏭
Browse files Browse the repository at this point in the history
  • Loading branch information
hnqso committed Apr 19, 2016
1 parent acd22ff commit 8d2b08d
Show file tree
Hide file tree
Showing 28 changed files with 312 additions and 2,069 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

### v3.0.0

The major change is the API. We took one step back to its core principle of "keep it simple".

```js
var props = {
container: '.cards',
item: '.card',
guter: 8
};
var grid = new Minigrid(props);
grid.mount();
```

– Back to 2kb 🎉
- `mount()` method to initialize Minigrid
- Animation was removed due to issues when dealing with many items which is the most of the user cases
- Remove the custom loading causing issues when loaded with require
- Round `posX`, `poxY` values #48
- Fixes the issue when working with multiple grids/selectors #43
- Works when loaded via module #40

### v2.2.0

- Add containerLoaded and itemLoaded options #37
Expand Down
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
**Be nice** 😎

Bare in mind that minigrid's main concept is simplicity. The goal is to keep
the API always at 2kb. Bug fixes are more than welcome! For any new feature
please [submit an issue](https://github.com/henriquea/minigrid/issues) first
before send any pull request.
Bare in mind that minigrid's main concept is simplicity. The goal is to keep the API always at 2kb. Bug fixes are more than welcome! For any new feature please [submit an issue](https://github.com/henriquea/minigrid/issues) first before send any pull request.

🍺

Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ Minigrid is a minimal 2kb zero dependency cascading grid layout.

Website & Documentation: [http://alves.im/minigrid](http://alves.im/minigrid/).

## Limitations

Minigrid was built having in mind "cards" with same width and different heights.
If your cards have different width sizes or you need more control I'd recommend [Isotope](http://isotope.metafizzy.co).

## Contributing

Plese see [CONTRIBUTING](CONTRIBUTING.md).
Expand Down
4 changes: 2 additions & 2 deletions dist/minigrid.min.js

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

158 changes: 0 additions & 158 deletions examples/basic.html

This file was deleted.

39 changes: 0 additions & 39 deletions examples/styles.css

This file was deleted.

10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,10 @@
},
"homepage": "http://alves.im/minigrid",
"devDependencies": {
"babel-core": "^5.8.24",
"babel-loader": "^5.3.2",
"browserify": "^11.0.1",
"eslint": "^1.4.3",
"eslint-loader": "^1.0.0",
"extract-text-webpack-plugin": "^0.8.2",
"file-loader": "^0.8.4",
"html-loader": "^0.3.0",
"json-loader": "^0.5.3",
"phantomjs": "1.9.2-6",
"tape": "^4.0.2",
"tape-run": "^1.1.0",
"url-loader": "^0.5.6"
"tape-run": "^1.1.0"
}
}
3 changes: 2 additions & 1 deletion site/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
.DS_Store
node_modules
58 changes: 58 additions & 0 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
- [GitHub](https://github.com/henriquea/minigrid)
- [npm](https://www.npmjs.com/package/minigrid)

# Minigrid

Minimal 2kb zero dependency cascading grid layout without pain.

## Usage

It works on a grid container with a group of grid items.

```
<div class="cards">
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
</div>
```

Then:

```
var grid = new Minigrid({
container: '.cards',
item: '.card',
gutter: 6
});
grid.mount();
```

## Installation

Get it from <strong>npm</strong>.

```
npm install minigrid
```

Or 1998 script include tag from **npmcdn**.

```
npm install minigrid
```

## Upgrade

Upgrading from v1.x or v2.x?

Please read the [CHANGELOG](https://github.com/henriquea/minigrid/blob/master/CONTRIBUTING.md) for API changes.

## Limitations

Minigrid was built having in mind "cards" with same width and different heights. If your cards have different width sizes or you need more power I’d recommend [Isotope](http://isotope.metafizzy.co/).

- **Minigrid** v3.0.0
- [GitHub](https://github.com/henriquea/minigrid)
- [npm](https://www.npmjs.com/package/minigrid)
- [@healves82](https://twitter.com/healves82)
28 changes: 28 additions & 0 deletions site/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var fs = require('fs');
var index = fs.readFileSync('./README.md', 'utf8');
var template = fs.readFileSync('./template.ejs', 'utf8');

var minify = require('html-minifier').minify;
var ejs = require('ejs');
var remark = require('remark');
var html = require('remark-html');
var yamlConfig = require('remark-yaml-config');
var processor = remark().use(yamlConfig).use(html);
var doc = processor.process([
'---',
'remark:',
' commonmark: true',
'---',
'',
index
].join('\n'));

var data = { content: doc };
var options = {};
var rendered = ejs.render(template, data, options);

var html = minify(rendered, {
collapseWhitespace: true
});

fs.writeFileSync('index.html', html);
Loading

0 comments on commit 8d2b08d

Please sign in to comment.