All Projects → BMSVieira → Easygrid

BMSVieira / Easygrid

Licence: mit
EasyGrid - VanillaJS Responsive Grid

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Easygrid

Shuffle
Categorize, sort, and filter a responsive grid of items
Stars: ✭ 2,170 (+2718.18%)
Mutual labels:  layout, grid, filter, responsive
React Native Responsive Grid
Bringing the Web's Responsive Design to React Native
Stars: ✭ 369 (+379.22%)
Mutual labels:  layout, grid, responsive, responsive-design
Muuri React
The layout engine for React
Stars: ✭ 163 (+111.69%)
Mutual labels:  layout, grid, filter
Iota
A responsive micro-framework for the grid spec powered by CSS custom properties.
Stars: ✭ 189 (+145.45%)
Mutual labels:  layout, grid, responsive-design
react-super-styled
Responsive JSX layouts with Styled Components
Stars: ✭ 77 (+0%)
Mutual labels:  grid, responsive, layout
Grid
This package has moved and renamed
Stars: ✭ 2,079 (+2600%)
Mutual labels:  layout, grid, responsive
Muuri
Infinite responsive, sortable, filterable and draggable layouts
Stars: ✭ 9,797 (+12623.38%)
Mutual labels:  layout, grid, filter
React Native Flexbox Grid
Responsive Grid for React Native
Stars: ✭ 95 (+23.38%)
Mutual labels:  layout, grid, responsive
ionic-login-component
Free sample of Premium Ionic Login Component
Stars: ✭ 17 (-77.92%)
Mutual labels:  responsive, filter, responsive-design
bootstrap-grid-ms
Missing grid range in Bootstrap 3, micro-small from 480-767px.
Stars: ✭ 34 (-55.84%)
Mutual labels:  grid, responsive, layout
Angular Tree Component
A simple yet powerful tree component for Angular (>=2)
Stars: ✭ 1,031 (+1238.96%)
Mutual labels:  library, frontend, javascript-library
griding
🧱 lean grid & responsive for react
Stars: ✭ 18 (-76.62%)
Mutual labels:  grid, responsive, layout
Filterizr
✨ Filterizr is a JavaScript library that sorts, shuffles and filters responsive galleries using CSS3 transitions ✨
Stars: ✭ 546 (+609.09%)
Mutual labels:  filtering, filter, javascript-library
Flex Layout
Provides HTML UI layout for Angular applications; using Flexbox and a Responsive API
Stars: ✭ 5,705 (+7309.09%)
Mutual labels:  layout, grid, responsive
Axentix
Axentix is an open source Framework based on CSS Grid using HTML, CSS and JS. The easy layout control and grid system makes it one of the most easy to learn framework.
Stars: ✭ 75 (-2.6%)
Mutual labels:  grid, frontend
Crab
JavaScript library for building user interfaces with Custom Elements, Shadow DOM and React like API
Stars: ✭ 22 (-71.43%)
Mutual labels:  library, frontend
Androidlibs
🔥正在成为史上最全分类 Android 开源大全~~~~(长期更新 Star 一下吧)
Stars: ✭ 7,148 (+9183.12%)
Mutual labels:  library, layout
React Native Super Grid
Responsive Grid View for React Native
Stars: ✭ 971 (+1161.04%)
Mutual labels:  grid, responsive
Greedo Layout For Ios
Full aspect ratio grid layout for iOS
Stars: ✭ 837 (+987.01%)
Mutual labels:  library, layout
Fastp
An ultra-fast all-in-one FASTQ preprocessor (QC/adapters/trimming/filtering/splitting/merging...)
Stars: ✭ 966 (+1154.55%)
Mutual labels:  filtering, filter

Features ▪️ Demo ▪️ Installation ▪️ Methods ▪️ Settings

◼️ Features:

  • 🔧 Fully Customizable
  • 💪 No Dependencies, built with VanillaJS
  • 🌎 Tested in All Modern Browsers
  • 💻 Responsive
  • 🗂 Filtering
  • 📈 Fast & Reliable
  • 📚 Does not need CSS or any CSS Framework

◼️ Demo:

https://bmsvieira.github.io/EasyGrid/

◼️ Installation:

1 - Include JavaScript Source.

<script src="path/to/easygrid.js"></script>

2 - Include Styles.

<link rel="stylesheet" href="path/to/easygrid.css">

4 - Set HTML.

 <div id="grid" style="width:100%;"></div>

3 - Initilize.

document.addEventListener("DOMContentLoaded", function() {
     var demo1 = new EasyGrid({
       selector: "#grid",
       dimensions: {
         width: "150",
         height: "270",
         margin: "5",
         minHeight: "20", // if height is "random"
         maxHeight: "40"  // if height is "random"
       },
       animations: {
         fadeInSpeed: "100",
         addItemSpeed: "100"
       },
       style: {
         background: "transparent",
         borderRadius: "5"
       }
     });
     
     // Add items to Grid
     demo1.AddItem({
        items: "HTML Element"
     });
});

◼️ Methods:

Refresh: Refresh Grid Positioning

demo1.Refresh();

AddItem: Add a new item to grid
If filter is enabled, it will automatically add to all classes that match the existing filters, otherwise, all filters starting with egfilter_ will be added and available for use.

Value Description
String Add a new item
Array / Object Add multiple items at once
// Single
var Elements = "HTML Element";
// Array
var Elements = ["HTML Element 1", "HTML  Element 2", "HTML  Element 3", "HTML  Element 4"];
// Filter
// In this example, it will add a new item to existing "egfilter_red" filter and a new filter called "egfilter_orange" ready to be used.
var Elements = '<div class="egfilter_red egfilter_orange"><img style="width:100%;" src="demo-template/images/orange.png"></div>';

demo1.AddItem({
   items: Elements,
   onComplete: function(){
     console.log("Completed!");
   } 
});

Change: Applies changes to current Grid

demo1.Change({
     dimensions: {
      width: "150",
      height: "random",
      margin: "15",
      minHeight: "100", // if height is "random"
      maxHeight: "300"  // if height is "random"
     },
     style: {
       background: "random",
       borderRadius: "5"
     }
});

Clear: Removes all items and all columns

demo1.Clear();

SetupEasyGrid: Add responsive columns. After use of SetupEasyGrid() it can be added new items again.

demo1.SetupEasyGrid();

Filter: Filter all elements that match specific class.

demo1.Filter();

◼️ Settings:

Option Type Options Available Description
selector String --- Specify ID of the element
dimensions > width Integer Integer Width (px) of the elements
dimensions > height Integer random or Integer Height (px) of the elements
dimensions > margin Integer Integer Margin (px) between elements
dimensions > minHeight Integer Integer Min. Height (px) of the elements if height is random
dimensions > maxHeight Integer Integer Max. Height (px) of the elements if height is random
config > fetchFromHTML Boolean --- Fetch elements inside main div to EasyGrid
config > filter Boolean --- Enables filter, fetchFromHTML is automatically enabled when using filters
animations > fadeInSpeed Integer Integer Speed(ms) that the item takes to appear completely after being added
animations > addItemSpeed Integer Integer Speed(ms) at which each item is added
style > background String random, shadesOfGrey, HEX, RGBA Item's Background color
style > borderRadius Integer Integer Item's Border Radius
responsive > breakpoint Integer Integer Responsive breakpoint, interrupts natural flow of EasyGrid and adds desired columns
responsive > columns Integer Integer Number of columns after breakpoint

Full Example:

document.addEventListener("DOMContentLoaded", function() {
        var demo1 = new EasyGrid({
             selector: "#grid",
             dimensions: {
              width: "150",
              height: "270",
              margin: "5",
              minHeight: "20", // if height is "random"
              maxHeight: "40"  // if height is "random"
             },
             config: {
              fetchFromHTML: true, // FetchFromHTML is automatically Enabled when using filters
              filter: true
             },
             animations: {
               fadeInSpeed: "100",
               addItemSpeed: "100"
             },
             style: {
               background: "random",
               borderRadius: "5"
             },
             responsive: [
                {
                  breakpoint: 500,
                  columns: 2
                },
                {
                  breakpoint: 300,
                  columns: 1
                }
            ]
        });
});

FetchFromHTML Example:
To fetch elements from html, it has to be placed inside main div with a specific class called: easygrid_fetch

<!--  Main Div -->
<div id="grid" class="easygrid_bvgrid">

    <!-- This item will be fetched to EasyGrid and then removed -->
    <div class="easygrid_fetch" style="display:none;">
        <!-- HTML Elements -->
    </div>
    <!-- This item will be fetched to EasyGrid and then removed -->
    <div class="easygrid_fetch" style="display:none;">
        <!-- HTML Elements -->
    </div>
 
</div>

Filters Example:
All classes that will serve as a filter, must begin with egfilter_
Whenever you want to show all items use egfilter_all, it is created automatically and contains all elements, does not need to be specified in each item.

<!--  Main Div -->
<div id="grid" class="easygrid_bvgrid"> 

     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_blue egfilter_red egfilter_purple"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_blue egfilter_red"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_blue"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_green egfilter_blue"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_green egfilter_blue"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_green"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_purple"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_red"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_red"> HTML CODE HERE </div>
     <!-- This item will be fetched to EasyGrid and then removed -->
     <div class="easygrid_fetch egfilter_red"> HTML CODE HERE </div>

</div>
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].