All Projects → mrksbnch → Fld Grd

mrksbnch / Fld Grd

Licence: other
Google Images/Flickr inspired fluid grid layouts

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Fld Grd

Gmdjs
Grid Material Design
Stars: ✭ 24 (-35.14%)
Mutual labels:  grid
Swiftui Grid
🚀 SwiftUI Grid layout with custom styles
Stars: ✭ 872 (+2256.76%)
Mutual labels:  grid
React Base Table
A react table component to display large datasets with high performance and flexibility
Stars: ✭ 966 (+2510.81%)
Mutual labels:  grid
Blossom
A free open-source design framework for the modern web
Stars: ✭ 26 (-29.73%)
Mutual labels:  grid
Feather Flex
Ultralight flexbox based grid system.
Stars: ✭ 11 (-70.27%)
Mutual labels:  grid
Bojler
Bojler is an email framework
Stars: ✭ 885 (+2291.89%)
Mutual labels:  grid
React Flex Ready
A Flexbox grid ready, easy to implement and customize
Stars: ✭ 23 (-37.84%)
Mutual labels:  grid
Baseliner
All your baseline are belong to us
Stars: ✭ 35 (-5.41%)
Mutual labels:  grid
Vue2 Datatable
The best Datatable for Vue.js 2.x which never sucks. Give us a star 🌟 if you like it! (DEPRECATED. As I, @kenberkeley, the only maintainer, no longer works for OneWay. Bugs may be fixed but new features or breaking changes might not be merged. However, it's still the best in my mind because of its extremely flexible usage of dynamic components)
Stars: ✭ 867 (+2243.24%)
Mutual labels:  grid
Gridly
⚡️ The minimal (~100-170 bytes) grid system for modern browsers.
Stars: ✭ 962 (+2500%)
Mutual labels:  grid
Gridiron
Feature-Packed React Grid Framework
Stars: ✭ 8 (-78.38%)
Mutual labels:  grid
Puregrid
Lightweight JavaScript Grid/SpreadSheet component written in pure JavaScript
Stars: ✭ 10 (-72.97%)
Mutual labels:  grid
Blazm.components
A few useful and awesome components for Blazor. Blazor + awesome (azm)=Blazm (Blossom)
Stars: ✭ 29 (-21.62%)
Mutual labels:  grid
Folo
📋 Form & Layout JS Components
Stars: ✭ 26 (-29.73%)
Mutual labels:  grid
React Native Super Grid
Responsive Grid View for React Native
Stars: ✭ 971 (+2524.32%)
Mutual labels:  grid
Datagrid
Gem to create tables grids with sortable columns and filters
Stars: ✭ 921 (+2389.19%)
Mutual labels:  grid
Ascollectionview
A SwiftUI collection view with support for custom layouts, preloading, and more.
Stars: ✭ 878 (+2272.97%)
Mutual labels:  grid
Memo
Decorators that help you remember.
Stars: ✭ 34 (-8.11%)
Mutual labels:  grid
Blog
在这里写一些工作中遇到的前端,后端以及运维的问题
Stars: ✭ 974 (+2532.43%)
Mutual labels:  grid
React Grid Carousel
React responsive carousel component w/ grid layout
Stars: ✭ 29 (-21.62%)
Mutual labels:  grid

FLD GRD

fluid grid demo page

Install

Yarn

yarn add fld-grd

NPM

npm install --save fld-grd

Bower

bower install --save fld-grd

Usage

HTML

Fld Grd works with one container element and a set of child elements. You can use whatever class names you want, and it's also possible to change the data attribute names.

<div class="fld-grd">
    <div data-fld-width="300" data-fld-height="200">
        <img src="300x200.jpg" width="300">
    </div>
    <div data-fld-width="600" data-fld-height="250">
        <img src="600x250.jpg" width="600">
    </div>
    <div data-fld-width="100" data-fld-height="300">
        <img src="100x300.jpg" width="100">
    </div>
</div>

CSS

To show all fluid grid items in a row, you can use float, display: inline-block or flexbox. Grid gutters with margin or padding are also supported.

/**
 * 1. Optional: 10px gutter
 */
.fld-grd {
    margin-right: -5px; /* [1] */
    margin-left: -5px; /* [1] */
}

/**
 * 1. Mandatory: `display: inline-block` or a flexbox based grid system do also work
 * 2. Optional: 10px gutter
 */
.fld-grd > div {
    float: left; /* [1] */
    padding-right: 5px; /* [2] */
    padding-left: 5px; /* [2] */
}

/**
 * 1. Optional: Setting `vertical-align` removes the whitespace that appears below `<img>` elements
 *    when they are dropped into a page as-is
 */
.fld-grd > div > img {
    vertical-align: top; /* [1] */
}

JavaScript

var fldGrd = new FldGrd(document.querySelector('.fld-grd'), {
    /**
     * Maximum row height
     *
     * @type {Integer}
     */
    rowHeight: 250,

    /**
     * Give "orphans" — elements in the last row that do not form a complete row — a specific
     * height. By default, "orphans" will have the average height of the other rows
     *
     * @type   {Function}
     * @param  {Object}   rows
     * @param  {number}   rows.heightAvg Average row height
     * @param  {Array}    rows.heights
     * @return {number}
     */
    rowHeightOrphan: rows => Math.round(rows.heightAvg),

    /**
     * CSS Selector for fluid grid items. It's useful if you also have other elements in your
     * container that shouldn't be treated as grid items
     *
     * @type {string}
     */
    itemSelector: '*',

    /**
     * CSS Selector for objects inside grid items. `width` and `height` is applied to this element
     *
     * @type {string}
     */
    objSelector: 'img',

    /**
     * Specify data attribute names that are used to determine the dimensions for each item
     *
     * @type {string}
     */
    dataWidth: 'data-fld-width',
    dataHeight: 'data-fld-height',
});

// Manually update fluid grid
fldGrd.update();

// Destroy `fldGrd` instance
fldGrd.destroy();

Browser Support

All major browsers are supported (IE9+). If you need to support IE9, you'll have to polyfill requestAnimationFrame.

Local Development

To compile and compress fldGrd.js, we rely on npm as a Build Tool.

Setup

  1. Check out the repository

    git clone [email protected]:mrksbnch/fld-grd.git
    cd fld-grd
    
  2. Run npm install to install all dependencies

Workflow

NPM command Description
npm run lint (es)lint JavaScript
npm run uglify Compress JavaScript
npm run babel Compile ES6 to ES5 with Babel
npm run build Lint, compress and minify JavaScript
npm run watch Watch file changes

Copyright

Copyright 2016 Markus Bianchi. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].