rnmp/salvattore

A jQuery Masonry alternative with CSS-driven configuration.

JavaScript

2,144

63 commits

updated Mar 2, 2018

See the code

README

Salvattore

![Gitter](https://badges.gitter.im/Join Chat.svg)

Salvattore is a library agnostic JS script that will help you organize your HTML elements according to the number of columns you specify, like jQuery Masonry.

Features

  • No requirements: Salvattore is a standalone script, it will work right away after being referenced in your HTML page.
  • Extremely lightweight: about 2.7KB (minified and gzipped.)
  • CSS-driven configuration: the number of columns is defined in CSS and the styling is left to the user.
  • Media queries ready: the same parameters can be used inside media queries for better results on different devices.
  • Wide browser support: modern browsers and IE9+

Upcoming

  • Balanced columns: to keep all columns about the same height.

To find out more and see it in action, please visit our website.

You can also follow us on Twitter.

Methods

Methods can be called on the globally exposed salvattore object for advanced usage.

var grid = document.querySelector('#grid');
var item = document.createElement('article');

salvattore.appendElements(grid, [item]);
item.outerHTML = 'I’ve been appended!';
MethodArgumentDescription
appendElementsgrid : DOM object, elements: Array of DOM objectsAdds elements to the end of a grid.
prependElementsgrid : DOM object, elements: Array of DOM objectsAdds elements to a beginning of a grid. Adds multiple elements one by one before each other, so note the order.
registerGridgrid : DOM objectAdds a new grid to salvattore. Which is initialized automatically then.
recreateColumnsgrid : DOM objectRemoves all the columns from the grid, and adds them again.
rescanMediaQueriesChecks stylesheets and selectors for media queries again. Recreates the columns for all grids afterwards.

How to contribute

We use Gulp to add polyfills and minify the script in the dist/ folder. To make changes to the script itself, please edit src/salvattore.js and send us a pull request.

Share feedback & ideas

You can even contribute by using Salvattore and sharing bugs, ideas or solutions on the Issues page. Protip: if you're posting a bug please share all the relevant data and ideally a live URL so that we can debug (yeah we do that!)

Project health

Overall

2.0/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

Latest release

1.0.9 · Nov 5, 2015

Releases this year

0
Deprecated

Significant stargazers

Zeke Sikelianos

3,078 followers · starred Sep 2013

Ricardo Mendes

302 followers · starred Oct 2013

Selwin Ong

150 followers · starred Jan 2015

Chris Fritz

4,044 followers · starred Oct 2015

rnmp/salvattore

A jQuery Masonry alternative with CSS-driven configuration.

JavaScript

2,144

63 commits

updated Mar 2, 2018

See the code

README

Salvattore

![Gitter](https://badges.gitter.im/Join Chat.svg)

Salvattore is a library agnostic JS script that will help you organize your HTML elements according to the number of columns you specify, like jQuery Masonry.

Features

  • No requirements: Salvattore is a standalone script, it will work right away after being referenced in your HTML page.
  • Extremely lightweight: about 2.7KB (minified and gzipped.)
  • CSS-driven configuration: the number of columns is defined in CSS and the styling is left to the user.
  • Media queries ready: the same parameters can be used inside media queries for better results on different devices.
  • Wide browser support: modern browsers and IE9+

Upcoming

  • Balanced columns: to keep all columns about the same height.

To find out more and see it in action, please visit our website.

You can also follow us on Twitter.

Methods

Methods can be called on the globally exposed salvattore object for advanced usage.

var grid = document.querySelector('#grid');
var item = document.createElement('article');

salvattore.appendElements(grid, [item]);
item.outerHTML = 'I’ve been appended!';
MethodArgumentDescription
appendElementsgrid : DOM object, elements: Array of DOM objectsAdds elements to the end of a grid.
prependElementsgrid : DOM object, elements: Array of DOM objectsAdds elements to a beginning of a grid. Adds multiple elements one by one before each other, so note the order.
registerGridgrid : DOM objectAdds a new grid to salvattore. Which is initialized automatically then.
recreateColumnsgrid : DOM objectRemoves all the columns from the grid, and adds them again.
rescanMediaQueriesChecks stylesheets and selectors for media queries again. Recreates the columns for all grids afterwards.

How to contribute

We use Gulp to add polyfills and minify the script in the dist/ folder. To make changes to the script itself, please edit src/salvattore.js and send us a pull request.

Share feedback & ideas

You can even contribute by using Salvattore and sharing bugs, ideas or solutions on the Issues page. Protip: if you're posting a bug please share all the relevant data and ideally a live URL so that we can debug (yeah we do that!)

Project health

Overall

2.0/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

Latest release

1.0.9 · Nov 5, 2015

Releases this year

0
Deprecated

Significant stargazers

Zeke Sikelianos

3,078 followers · starred Sep 2013

Ricardo Mendes

302 followers · starred Oct 2013

Selwin Ong

150 followers · starred Jan 2015

Chris Fritz

4,044 followers · starred Oct 2015