-
-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a81026
commit 3c37df4
Showing
11 changed files
with
135 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- '8' | ||
- '12' | ||
env: | ||
email: false | ||
global: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Muuri | ||
|
||
[![gzip size](http://img.badgesize.io/https://unpkg.com/muuri@0.7.1/dist/muuri.min.js?compression=gzip)](https://unpkg.com/muuri@0.7.1/dist/muuri.min.js) | ||
[![gzip size](http://img.badgesize.io/https://unpkg.com/muuri@0.8.0/dist/muuri.min.js?compression=gzip)](https://unpkg.com/muuri@0.8.0/dist/muuri.min.js) | ||
[![npm](https://img.shields.io/npm/v/muuri.svg)](http://npm.im/muuri) | ||
|
||
Muuri is a JavaScript layout engine that allows you to build all kinds of layouts and make them responsive, sortable, filterable, draggable and/or animated. Comparing to what's out there Muuri is a combination of [Packery](http://packery.metafizzy.co/), [Masonry](http://masonry.desandro.com/), [Isotope](http://isotope.metafizzy.co/) and [Sortable](https://github.com/RubaXa/Sortable). Wanna see it in action? Check out the [demo](http://haltu.github.io/muuri/) on the website. | ||
|
@@ -34,20 +34,18 @@ Muuri uses [Web Animations](https://developer.mozilla.org/en-US/docs/Web/API/Web | |
|
||
### 1. Get Muuri | ||
|
||
Download: | ||
* [muuri.js](https://unpkg.com/[email protected]/dist/muuri.js) - for development (not minified, with comments). | ||
* [muuri.min.js](https://unpkg.com/[email protected]/dist/muuri.min.js) - for production (minified, no comments). | ||
|
||
Or link directly: | ||
|
||
```html | ||
<script src="https://unpkg.com/[email protected]/dist/muuri.min.js"></script> | ||
Install via [npm](https://www.npmjs.com/): | ||
```bash | ||
npm install muuri | ||
``` | ||
|
||
Or install with [npm](https://www.npmjs.com/): | ||
Or download: | ||
* [muuri.js](https://unpkg.com/[email protected]/dist/muuri.js) - for development (not minified, with comments). | ||
* [muuri.min.js](https://unpkg.com/[email protected]/dist/muuri.min.js) - for production (minified, no comments). | ||
|
||
```bash | ||
npm install muuri | ||
Or link directly: | ||
```html | ||
<script src="https://unpkg.com/[email protected]/dist/muuri.min.js"></script> | ||
``` | ||
|
||
### 2. Get Web Animations Polyfill (if needed) | ||
|
@@ -63,8 +61,8 @@ npm install web-animations-js | |
Add Muuri on your site and make sure to include the Web Animations Polyfill before Muuri (if needed). | ||
|
||
```html | ||
<script src="https://unpkg.com/[email protected].1/web-animations.min.js"></script> | ||
<script src="https://unpkg.com/muuri@0.7.1/dist/muuri.min.js"></script> | ||
<script src="https://unpkg.com/[email protected].2/web-animations.min.js"></script> | ||
<script src="https://unpkg.com/muuri@0.8.0/dist/muuri.min.js"></script> | ||
``` | ||
|
||
### 4. Add the markup | ||
|
@@ -231,7 +229,8 @@ The default options are stored in `Muuri.defaultOptions` object, which in it's d | |
userSelect: 'none', | ||
userDrag: 'none', | ||
tapHighlightColor: 'rgba(0, 0, 0, 0)', | ||
touchCallout: 'none' | ||
touchCallout: 'none', | ||
contentZooming: 'none' | ||
}, | ||
dragPlaceholder: { | ||
enabled: false, | ||
|
@@ -297,6 +296,7 @@ var gridB = new Muuri('.grid-b', { | |
* [dragSortPredicate](#dragsortpredicate-) | ||
* [dragReleaseDuration](#dragreleaseduration-) | ||
* [dragReleaseEasing](#dragreleaseeasing-) | ||
* [dragCssProps](#dragcssprops-) | ||
* [dragPlaceholder](#dragplaceholder-) | ||
* [containerClass](#containerclass-) | ||
* [itemClass](#itemclass-) | ||
|
@@ -905,6 +905,55 @@ var grid = new Muuri(elem, { | |
}); | ||
``` | ||
|
||
### dragCssProps | ||
|
||
Drag specific CSS properties that Muuri sets to the draggable item elements. Muuri automatically prefixes the properties before applying them to the element. `touchAction` property is required to be always defined, but the other properties are optional and can be omitted by setting their value to an empty string if you want to e.g. define them via CSS only. | ||
|
||
* Default value: `{touchAction: 'none', userSelect: 'none', userDrag: 'none', tapHighlightColor: 'rgba(0, 0, 0, 0)', touchCallout: 'none', contentZooming: 'none'}`. | ||
* Accepted types: object. | ||
|
||
You can define the following properties: | ||
|
||
* **touchAction** — *string* | ||
* Default value: `'none'`. | ||
* https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action | ||
* **userSelect** — *string* | ||
* Default value: `'none'`. | ||
* https://developer.mozilla.org/en-US/docs/Web/CSS/user-select | ||
* Optional. | ||
* **userDrag** — *string* | ||
* Default value: `'none'`. | ||
* http://help.dottoro.com/lcbixvwm.php | ||
* Optional. | ||
* **tapHighlightColor** — *string* | ||
* Default value: `'rgba(0, 0, 0, 0)'`. | ||
* https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-tap-highlight-color | ||
* Optional. | ||
* **touchCallout** — *string* | ||
* Default value: `'none'`. | ||
* https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-touch-callout | ||
* Optional. | ||
* **contentZooming** — *string* | ||
* Default value: `'none'`. | ||
* https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-content-zooming | ||
* Optional. | ||
|
||
```javascript | ||
// Only set the required touch-action CSS property via the options if you for | ||
// example want to set the other props via CSS instead. | ||
var grid = new Muuri(elem, { | ||
dragEnabled: true, | ||
dragCssProps: { | ||
touchAction: 'pan-y', | ||
userSelect: '', | ||
userDrag: '', | ||
tapHighlightColor: '', | ||
touchCallout: '', | ||
contentZooming: '' | ||
} | ||
}); | ||
``` | ||
|
||
### dragPlaceholder | ||
|
||
If you want a placeholder item to appear for the duration of an item's drag & drop procedure you can enable and configure it here. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.