update scheduled tasks page

This commit is contained in:
Luke Pulverenti 2015-10-12 15:09:56 -04:00
parent f73a917448
commit 1ac9bfe5aa
65 changed files with 8424 additions and 48 deletions

View file

@ -0,0 +1,54 @@
{
"name": "masonry",
"version": "3.3.2",
"description": "Cascading grid layout library",
"main": "masonry.js",
"dependencies": {
"get-size": "~1.2.2",
"outlayer": "~1.4.0",
"fizzy-ui-utils": "~1.0.1"
},
"devDependencies": {
"jquery-bridget": "1.1.x",
"doc-ready": "1.x",
"qunit": "^1.12",
"jquery": ">=1.4.3 <2"
},
"ignore": [
"examples/",
"test/",
"CONTRIBUTING.mdown",
"Gruntfile.js",
"package.json",
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"homepage": "http://masonry.desandro.com",
"authors": [
"David DeSandro"
],
"keywords": [
"masonry",
"layout",
"outlayer"
],
"license": "MIT",
"moduleType": [
"amd",
"globals",
"node"
],
"_release": "3.3.2",
"_resolution": {
"type": "version",
"tag": "v3.3.2",
"commit": "48ed97fd2ebf0c126833bef6b29aff51781701e2"
},
"_source": "git://github.com/desandro/masonry.git",
"_target": "~3.3.2",
"_originalSource": "masonry",
"_direct": true
}

View file

@ -0,0 +1,76 @@
# Masonry
_Cascading grid layout library_
Masonry works by placing elements in optimal position based on available vertical space, sort of like a mason fitting stones in a wall. Youve probably seen it in use all over the Internet.
See [masonry.desandro.com](http://masonry.desandro.com) for complete docs and demos.
## Install
### Download
+ [masonry.pkgd.js](https://github.com/desandro/masonry/raw/master/dist/masonry.pkgd.js) un-minified, or
+ [masonry.pkgd.min.js](https://github.com/desandro/masonry/raw/master/dist/masonry.pkgd.min.js) minified
### CDN
Link directly to [Masonry files on cdnjs](https://cdnjs.com/libraries/masonry).
``` html
<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.1/masonry.pkgd.js"></script>
<!-- or -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.1/masonry.pkgd.min.js"></script>
```
### Package managers
Bower: `bower install masonry --save`
[npm](https://www.npmjs.com/package/masonry-layout): `npm install masonry-layout --save`
## Initialize
With jQuery
``` js
$('.grid').masonry({
// options...
itemSelector: '.grid-item',
columnWidth: 200
});
```
With vanilla JavaScript
``` js
// vanilla JS
var grid = document.querySelector('.grid');
var msnry = new Masonry( grid, {
// options...
itemSelector: '.grid-item',
columnWidth: 200
});
```
With HTML
Add a class of `js-masonry` to your element. Options can be set in JSON in `data-masonry-options`.
``` html
<div class="grid js-masonry"
data-masonry-options='{ "itemSelector": ".grid-item", "columnWidth": 200 }'>
<div class="grid-item"></div>
<div class="grid-item"></div>
...
</div>
```
## License
Masonry is released under the [MIT license](http://desandro.mit-license.org). Have at it.
* * *
Copyright 2015 David DeSandro

View file

@ -0,0 +1,44 @@
{
"name": "masonry",
"version": "3.3.2",
"description": "Cascading grid layout library",
"main": "masonry.js",
"dependencies": {
"get-size": "~1.2.2",
"outlayer": "~1.4.0",
"fizzy-ui-utils": "~1.0.1"
},
"devDependencies": {
"jquery-bridget": "1.1.x",
"doc-ready": "1.x",
"qunit": "^1.12",
"jquery": ">=1.4.3 <2"
},
"ignore": [
"examples/",
"test/",
"CONTRIBUTING.mdown",
"Gruntfile.js",
"package.json",
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"homepage": "http://masonry.desandro.com",
"authors": [
"David DeSandro"
],
"keywords": [
"masonry",
"layout",
"outlayer"
],
"license": "MIT",
"moduleType": [
"amd",
"globals",
"node"
]
}

View file

@ -0,0 +1,83 @@
# Changelog
### v3.3.1
+ Updated Outlayer v1.4.1
+ Added jQuery events
+ Fixed Safari layout and transition bugs. Fixed [#698](https://github.com/desandro/masonry/issues/698)
## v3.3.0
+ Added `percentPosition` option. Fixed [#574](https://github.com/desandro/masonry/issues/574)
+ Removed first `instance` argument from `layoutComplete` and `removeComplete` events
+ Added use of [fizzy-ui-utils](https://github.com/metafizzy/fizzy-ui-utils)
### v3.2.3
+ Fixed pixel rounding errors related to Firefox, gutters. Fixed [#580](https://github.com/desandro/masonry/pull/580)
+ Moved poorly named `examples/` to better named `sandbox/`. Fixed [#539](https://github.com/desandro/masonry/issues/539)
+ Moved [`masonry-v2-shim.js` shim to its own repo](https://github.com/desandro/masonry-v2-3-shim)
### v3.2.2
+ Update [getSize](https://github.com/desandro/get-size) to v1.2.1 to fix IE8 bug
### v3.2.1
+ Fix missing dependencies in `package.json`
## v3.2.0
+ Add CommonJS support [#480](https://github.com/desandro/masonry/issues/480)
+ jQuery Bridget no longer in explicit dependency tree
### v3.1.5
+ Add dist/pkgd files
+ Upgrade to Outlayer v1.2
### v3.1.4
Fix stamp bug if multiple of columnWidth
### v3.1.3
Round if off by 1px
### v3.1.2
Fix IE8 bugs w/ hidden items
### v3.1.1
update Outlayer v1.1.2
## v3.1.0
Add better RequireJS support
### v3.0.3
Fix bug with `isFitWidth` and resizing
### v3.0.2
Add back `isFitWidth`
### v3.0.1
fixed empty container
## v3.0.0
+ Complete rewrite
+ Componentize with Bower
+ Remove jQuery as strict dependency
+ Remove smartresize jQuery plugin
+ imagesLoaded no longer included
+ jQuery animation has been removed. animationOptions has been removed. This means no animation for in IE8 and IE9.
+ Corner stamp is now integrated as `stamp` option and `stamp` method
+ `isRTL` option removed, use `isOriginLeft: false` instead
+ `isResizable` option renamed to `isResizeBound`
+ `layout` method renamed to `layoutItems`
+ `gutterWidth` option renamed to `gutter`

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,203 @@
/*!
* Masonry v3.3.2
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
* by David DeSandro
*/
( function( window, factory ) {
'use strict';
// universal module definition
if ( typeof define === 'function' && define.amd ) {
// AMD
define( [
'outlayer/outlayer',
'get-size/get-size',
'fizzy-ui-utils/utils'
],
factory );
} else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = factory(
require('outlayer'),
require('get-size'),
require('fizzy-ui-utils')
);
} else {
// browser global
window.Masonry = factory(
window.Outlayer,
window.getSize,
window.fizzyUIUtils
);
}
}( window, function factory( Outlayer, getSize, utils ) {
'use strict';
// -------------------------- masonryDefinition -------------------------- //
// create an Outlayer layout class
var Masonry = Outlayer.create('masonry');
Masonry.prototype._resetLayout = function() {
this.getSize();
this._getMeasurement( 'columnWidth', 'outerWidth' );
this._getMeasurement( 'gutter', 'outerWidth' );
this.measureColumns();
// reset column Y
var i = this.cols;
this.colYs = [];
while (i--) {
this.colYs.push( 0 );
}
this.maxY = 0;
};
Masonry.prototype.measureColumns = function() {
this.getContainerWidth();
// if columnWidth is 0, default to outerWidth of first item
if ( !this.columnWidth ) {
var firstItem = this.items[0];
var firstItemElem = firstItem && firstItem.element;
// columnWidth fall back to item of first element
this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth ||
// if first elem has no width, default to size of container
this.containerWidth;
}
var columnWidth = this.columnWidth += this.gutter;
// calculate columns
var containerWidth = this.containerWidth + this.gutter;
var cols = containerWidth / columnWidth;
// fix rounding errors, typically with gutters
var excess = columnWidth - containerWidth % columnWidth;
// if overshoot is less than a pixel, round up, otherwise floor it
var mathMethod = excess && excess < 1 ? 'round' : 'floor';
cols = Math[ mathMethod ]( cols );
this.cols = Math.max( cols, 1 );
};
Masonry.prototype.getContainerWidth = function() {
// container is parent if fit width
var container = this.options.isFitWidth ? this.element.parentNode : this.element;
// check that this.size and size are there
// IE8 triggers resize on body size change, so they might not be
var size = getSize( container );
this.containerWidth = size && size.innerWidth;
};
Masonry.prototype._getItemLayoutPosition = function( item ) {
item.getSize();
// how many columns does this brick span
var remainder = item.size.outerWidth % this.columnWidth;
var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil';
// round if off by 1 pixel, otherwise use ceil
var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth );
colSpan = Math.min( colSpan, this.cols );
var colGroup = this._getColGroup( colSpan );
// get the minimum Y value from the columns
var minimumY = Math.min.apply( Math, colGroup );
var shortColIndex = utils.indexOf( colGroup, minimumY );
// position the brick
var position = {
x: this.columnWidth * shortColIndex,
y: minimumY
};
// apply setHeight to necessary columns
var setHeight = minimumY + item.size.outerHeight;
var setSpan = this.cols + 1 - colGroup.length;
for ( var i = 0; i < setSpan; i++ ) {
this.colYs[ shortColIndex + i ] = setHeight;
}
return position;
};
/**
* @param {Number} colSpan - number of columns the element spans
* @returns {Array} colGroup
*/
Masonry.prototype._getColGroup = function( colSpan ) {
if ( colSpan < 2 ) {
// if brick spans only one column, use all the column Ys
return this.colYs;
}
var colGroup = [];
// how many different places could this brick fit horizontally
var groupCount = this.cols + 1 - colSpan;
// for each group potential horizontal position
for ( var i = 0; i < groupCount; i++ ) {
// make an array of colY values for that one group
var groupColYs = this.colYs.slice( i, i + colSpan );
// and get the max value of the array
colGroup[i] = Math.max.apply( Math, groupColYs );
}
return colGroup;
};
Masonry.prototype._manageStamp = function( stamp ) {
var stampSize = getSize( stamp );
var offset = this._getElementOffset( stamp );
// get the columns that this stamp affects
var firstX = this.options.isOriginLeft ? offset.left : offset.right;
var lastX = firstX + stampSize.outerWidth;
var firstCol = Math.floor( firstX / this.columnWidth );
firstCol = Math.max( 0, firstCol );
var lastCol = Math.floor( lastX / this.columnWidth );
// lastCol should not go over if multiple of columnWidth #425
lastCol -= lastX % this.columnWidth ? 0 : 1;
lastCol = Math.min( this.cols - 1, lastCol );
// set colYs to bottom of the stamp
var stampMaxY = ( this.options.isOriginTop ? offset.top : offset.bottom ) +
stampSize.outerHeight;
for ( var i = firstCol; i <= lastCol; i++ ) {
this.colYs[i] = Math.max( stampMaxY, this.colYs[i] );
}
};
Masonry.prototype._getContainerSize = function() {
this.maxY = Math.max.apply( Math, this.colYs );
var size = {
height: this.maxY
};
if ( this.options.isFitWidth ) {
size.width = this._getContainerFitWidth();
}
return size;
};
Masonry.prototype._getContainerFitWidth = function() {
var unusedCols = 0;
// count unused columns
var i = this.cols;
while ( --i ) {
if ( this.colYs[i] !== 0 ) {
break;
}
unusedCols++;
}
// fit container to columns that have been used
return ( this.cols - unusedCols ) * this.columnWidth - this.gutter;
};
Masonry.prototype.needsResizeLayout = function() {
var previousWidth = this.containerWidth;
this.getContainerWidth();
return previousWidth !== this.containerWidth;
};
return Masonry;
}));

View file

@ -0,0 +1,110 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>add items</title>
<style>
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.grid {
background: #DDD;
}
/* clearfix */
.grid:after {
display: block;
content: '';
clear: both;
}
.grid-sizer,
.grid-item {
width: 25%;
}
.grid-item {
border: 1px solid;
background: #09F;
height: 100px;
}
.grid-item--width2 { width: 50%; }
.grid-item--height2 { height: 160px; }
.grid-item--height3 { height: 220px; }
</style>
</head>
<body>
<h1>add items</h1>
<p>
<button class="prepend-button">Prepend button</button>
<button class="append-button">Append button</button>
</p>
<div class="grid">
<div class="grid-sizer"></div>
<div class="grid-item grid-item--width2"></div>
<div class="grid-item grid-item--height2"></div>
</div>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
function getItemElement() {
var elem = document.createElement('div');
var wRand = Math.random();
var hRand = Math.random();
var widthClass = wRand > 0.8 ? 'grid-item--width3' :
wRand > 0.6 ? 'grid-item--width2' : '';
var heightClass = hRand > 0.8 ? 'grid-item--height3' :
hRand > 0.5 ? 'grid-item--height2' : '';
elem.className = 'grid-item ' + widthClass + ' ' + heightClass;
return elem;
};
docReady( function() {
var msnry = window.msnry = new Masonry( '.grid', {
columnWidth: '.grid-sizer',
percentPosition: true
});
document.querySelector('.prepend-button').addEventListener( 'click', function() {
var itemElem = getItemElement();
msnry.element.insertBefore( itemElem, msnry.element.firstChild );
msnry.prepended( itemElem );
});
document.querySelector('.append-button').addEventListener( 'click', function() {
var itemElem = getItemElement();
msnry.element.appendChild( itemElem );
msnry.appended( itemElem );
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,62 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>basic</title>
<link rel="stylesheet" href="sandbox.css" />
</head>
<body>
<h1>basic</h1>
<div id="basic" class="container">
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
docReady( function() {
var container = document.querySelector('#basic');
var msnry = new Masonry( container, {
columnWidth: 60
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,119 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>bottom up</title>
<link rel="stylesheet" href="sandbox.css" />
<style>
#stamped .stamp1 {
width: 30%;
height: 100px;
left: 30%;
bottom: 20px;
}
#stamped .stamp2 {
width: 200px;
height: 50px;
left: 20px;
bottom: 50px;
}
</style>
</head>
<body>
<h1>bottom up</h1>
<div id="basic" class="container">
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
<div id="stamped" class="container">
<div class="stamp stamp1"></div>
<div class="stamp stamp2"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
docReady( function() {
( function() {
var container = document.querySelector('#basic');
var msnry = new Masonry( container, {
isOriginTop: false,
columnWidth: 60
});
})();
( function() {
var container = document.querySelector('#stamped');
var msnry = new Masonry( container, {
itemSelector: '.item',
isOriginTop: false,
columnWidth: 60,
gutter: 10,
stamp: '.stamp'
});
})();
});
</script>
</body>
</html>

View file

@ -0,0 +1,42 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>browserify</title>
<link rel="stylesheet" href="../sandbox.css" />
</head>
<body>
<h1>browserify</h1>
<div id="basic" class="container">
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
<script src="bundle.js"></script>
</body>
</html>

View file

@ -0,0 +1,19 @@
// vanilla js
var Masonry = require('../../masonry');
new Masonry( '#basic', {
columnWidth: 60
});
// jquery
// var $ = require('jquery');
// var jQBridget = require('jquery-bridget');
// var Masonry = require('../../masonry');
//
// $.bridget( 'masonry', Masonry );
//
// $('#basic').masonry({
// columnWidth: 60
// });

View file

@ -0,0 +1,69 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>element sizing</title>
<link rel="stylesheet" href="sandbox.css" />
<style>
/* #container { width: 501px; }*/
.item, .grid-sizer { width: 20%; }
.item.w2 { width: 40%; }
.item.w3 { width: 60%; }
</style>
</head>
<body>
<h1>element sizing</h1>
<div id="container" class="container">
<div class="grid-sizer"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
docReady( function() {
var container = document.querySelector('#container');
var msnry = new Masonry( container, {
columnWidth: '.grid-sizer',
percentPosition: true
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,68 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>fit width</title>
<link rel="stylesheet" href="sandbox.css" />
<style>
.container {
margin: 0 auto;
}
</style>
</head>
<body>
<h1>fit width</h1>
<div class="container">
<div class="item w2"></div>
<div class="item w2 h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item w2 h3"></div>
<div class="item w4"></div>
<div class="item w2"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item w2 h4"></div>
<div class="item w4"></div>
<div class="item w2 h5"></div>
<div class="item w4"></div>
<div class="item w2"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item w2 h3"></div>
<div class="item w4"></div>
<div class="item w2"></div>
</div>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
docReady( function() {
var msnry = new Masonry( '.container', {
isFitWidth: true,
columnWidth: 120
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,89 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>fluid</title>
<style>
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.grid {
background: #DDD;
}
/* clearfix */
.grid:after {
display: block;
content: '';
clear: both;
}
.grid-sizer,
.grid-item {
width: 25%;
}
.grid-item {
border: 1px solid;
background: #09F;
height: 100px;
}
.grid-item--width2 { width: 50%; }
.grid-item--height2 { height: 160px; }
.grid-item--height3 { height: 220px; }
</style>
</head>
<body>
<h1>fluid</h1>
<div class="grid">
<div class="grid-sizer"></div>
<div class="grid-item grid-item--width2"></div>
<div class="grid-item"></div>
<div class="grid-item grid-item--height3"></div>
<div class="grid-item"></div>
<div class="grid-item grid-item--width2 grid-item--height2"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item grid-item--width2"></div>
<div class="grid-item grid-item--height3"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
</div>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
docReady( function() {
window.msnry = new Masonry( '.grid', {
columnWidth: '.grid-sizer',
percentPosition: true
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,64 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery</title>
<link rel="stylesheet" href="sandbox.css" />
</head>
<body>
<h1>jQuery</h1>
<div id="basic" class="container">
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
$( function() {
$('#basic').masonry({
columnWidth: 60
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,41 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>require js</title>
<link rel="stylesheet" href="../sandbox.css" />
<script data-main="main" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.5/require.js"></script>
</head>
<body>
<h1>require js</h1>
<div id="basic" class="container">
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
</body>
</html>

View file

@ -0,0 +1,69 @@
/*global requirejs: false*/
// -------------------------- pkgd -------------------------- //
/*
requirejs( [ '../../dist/masonry.pkgd' ], function( Masonry ) {
new Masonry( document.querySelector('#basic') );
});
// */
// -------------------------- bower -------------------------- //
/*
requirejs.config({
baseUrl: '../bower_components'
});
requirejs( [ '../masonry' ], function( Masonry ) {
new Masonry( document.querySelector('#basic') );
});
// */
// -------------------------- pkgd & jQuery -------------------------- //
// /*
requirejs.config({
paths: {
jquery: '../../bower_components/jquery/dist/jquery'
}
});
requirejs( [ 'require', 'jquery', '../../dist/masonry.pkgd' ],
function( require, $, Masonry ) {
require( [
'jquery-bridget/jquery.bridget'
],
function() {
$.bridget( 'masonry', Masonry );
$('#basic').masonry({
columnWidth: 60
});
}
);
});
// */
// -------------------------- bower & jQuery -------------------------- //
/*
requirejs.config({
baseUrl: '../bower_components',
paths: {
jquery: 'jquery/dist/jquery'
}
});
requirejs( [
'jquery',
'../masonry',
'jquery-bridget/jquery.bridget'
],
function( $, Masonry ) {
$.bridget( 'masonry', Masonry );
$('#basic').masonry({
columnWidth: 60
});
}
);
// */

View file

@ -0,0 +1,120 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>right to left</title>
<link rel="stylesheet" href="sandbox.css" />
<style>
#stamped .stamp1 {
width: 30%;
height: 100px;
left: 30%;
top: 20px;
margin: 10px;
}
#stamped .stamp2 {
width: 200px;
height: 50px;
left: 20px;
top: 50px;
}
</style>
</head>
<body>
<h1>right to left</h1>
<div id="basic" class="container">
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
<div id="stamped" class="container">
<div class="stamp stamp1"></div>
<div class="stamp stamp2"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
docReady( function() {
( function() {
var container = document.querySelector('#basic');
var msnry = new Masonry( container, {
isOriginLeft: false,
columnWidth: 60
});
})();
( function() {
var container = document.querySelector('#stamped');
var msnry = new Masonry( container, {
itemSelector: '.item',
isOriginLeft: false,
columnWidth: 60,
gutter: 10,
stamp: '.stamp'
});
})();
});
</script>
</body>
</html>

View file

@ -0,0 +1,33 @@
* {
box-sizing: border-box;
}
.container {
background: #EEE;
width: 50%;
margin-bottom: 20px;
}
.item {
width: 60px;
height: 60px;
float: left;
border: 1px solid;
background: #09F;
}
.item.w2 { width: 120px; }
.item.w3 { width: 180px; }
.item.w4 { width: 240px; }
.item.h2 { height: 100px; }
.item.h3 { height: 160px; }
.item.h4 { height: 220px; }
.item.h5 { height: 280px; }
.stamp {
background: red;
opacity: 0.75;
position: absolute;
border: 1px solid;
}

View file

@ -0,0 +1,124 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>stamps</title>
<link rel="stylesheet" href="sandbox.css" />
<style>
#alpha .stamp1 {
width: 30%;
height: 100px;
left: 30%;
top: 20px;
}
#alpha .stamp2 {
width: 200px;
height: 50px;
left: 20px;
top: 50px;
}
#beta {
border-style: solid;
border-width: 40px 30px 20px 10px;
padding: 10px 20px 30px 40px;
}
#beta .stamp1 {
width: 30%;
height: 100px;
left: 10%;
top: 20px;
}
#beta .stamp2 {
width: 200px;
height: 50px;
right: 20px;
top: 50px;
}
</style>
</head>
<body>
<h1>stamps</h1>
<div id="alpha" class="container">
<div class="stamp stamp1"></div>
<div class="stamp stamp2"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item h2"></div>
<div class="item"></div>
<div class="item h3"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
</div>
<div id="beta" class="container">
<div class="stamp stamp2"></div>
<div class="stamp stamp1"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item h2"></div>
<div class="item"></div>
<div class="item h3"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
</div>
<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../masonry.js"></script>
<script>
docReady( function() {
( function() {
var container = document.querySelector('#alpha');
var msnry = new Masonry( container, {
itemSelector: '.item',
columnWidth: 60,
gutter: 10,
stamp: '.stamp'
});
})();
( function() {
var container = document.querySelector('#beta');
var msnry = new Masonry( container, {
columnWidth: 60,
gutter: 10,
stamp: '.stamp'
});
})();
});
</script>
</body>
</html>