Renderers

Coords changers

What are coords changers in Gridifier?

Coords changers are functions, that are called on render step to animate item position changes.

What coords changers are available?

What is default used coords changer?

By default, Gridifier is using translate3dInt coords changer. It is used because of following reasons:


How to select coords changer?

coordsChanger()
coordsChanger = function(coordsChangerName)
coordsChanger setting
new Gridifier(grid, {coordsChanger: "initialCoordsChanger"})

Coords changers demo grid:

Style left,top:

default
position

CSS3 translate:

translate
translateInt
3d
3dInt

How to control coords change duration/transition timing?

coordsChangeTime setting
new Gridifier(grid, {coordsChangeTime: 600})
set("coordsChangeTime", newVal)
coordsChangeTiming
new Gridifier(grid, {coordsChangeTiming: "cubic-bezier(0.755, 0.050, 0.855, 0.060)"})
set("coordsChangeTiming", newTiming)

Renderer antialiasing

What is renderer antialiasing?

Renderer antialiasing functions controls item offsets from their calculated positions on render step.

When this functions are required?

  1. Grid items are placed close to each other.(without margins)
  2. Grid items have percentage widths(vertical grids), percentage heights(horizontal grids) or percentage widths/percentage padding bottoms(vertical grids).

Why this functions are required?

How this functions are working?

Empty space in grid end

Antialiasing functions:

set("widthPtAs", newVal)
set("heightPtAs", newVal)
set("widthPxAs", newVal)
set("heightPxAs", newVal)

Antialias initial settings:

widthPtAs
new Gridifier(grid, {widthPtAs: 0.1})
heightPtAs
new Gridifier(grid, {heightPtAs: 0.1})
widthPxAs
new Gridifier(grid, {widthPxAs: 1})
heightPxAs
new Gridifier(grid, {heightPxAs: 1})

Antialiasing demo grid:

widthPtAntialias:

0%
0.1%
0.2%

heightPxAntialias:

0px
1px
2px

Gaps notice.
1px gaps can appear on specific viewport widths, so try to resize the browser, if there are no gaps.

Z-indexes notice.
Usage of any of 4 antialias functions will automatically enable grid item z-indexes updates according to sort order.(Native order will break with custom filters/sorts) It can be disabled by calling grid.disableZUpdates().

Overflow notice.
In most cases you will use antialias functions with full responsive sites, so don't forget to add overflow-x: "hidden" rule to body tag to avoid horizontal scrollbar.

Example 1: widthPtAs
in most cased used with %-width vertical grid items

var grid = new Gridifier(demoGrid);
/* Set some small(0.1 - 0.2) antialias to remove 1px gaps */
grid.set("widthPtAs", 0.1);

/* CSS */
.gridItem {
    /* Add antialias value to width to exclude empty space from
       the end of the grid */
    width: 25.1%;
}
        
Example 2: heightPtAs
in most cased used with %-height horizontal grid items

var grid = new Gridifier(demoGrid, {grid: "horizontal"});
/* Set some small(0.1 - 0.2) antialias to remove 1px gaps */
grid.set("heightPtAs", 0.1);

/* CSS */
.gridItem {
    /* Add antialias value to height to exclude empty space from
    the top or the bottom of the grid */
    height: 25.1%;
}
        
Example 3: mixed
this example is similar to main demo layout, used on landing page

var grid = new Gridifier(demoGrid);
grid.set("widthPtAs", 0.1);
/* 1px height offset is required here, because with percentage padding bottom
     1px gap appears between 'rows' on some viewport widths in Firefox. */
grid.set("heightPxAs", 1);

/* CSS */
.gridItem {
    width: 12.1%;
    padding-bottom: 12%;
}

.gridItemBig {
    /* If you are using height px antialias and are using big items,
       don't forget to substract antialias value from big item. (Value
       depends on itemsCount, that are 'covering' big item) */
    width: 25.1%;
    padding-bottom: 25%;
    padding-bottom: calc(25% - 1px);
}
        
next: Sorts prev: Togglers
Ξ
GRIDIFIER.IO
x