Git Product home page Git Product logo

cube-gallery's Introduction

Cube Gallery

Cube gallery is a justified / Flickr like gallery.

Capture

Table of contents

Install

Inside a .js file, import the CubeGallery file from the source of your choice (npm, cdn or download) :

import CubeGallery from "cube-gallery-js"

Then, link your script inside your HTML page. Do not forget type="module".

<script type="module" src="myFile.js">

NPM

npm install cube-gallery-js

Then, import in your .js file.

CDN

Import https://cdn.jsdelivr.net/npm/cube-gallery-js/src/index.min.js in your .js file.

File

Download and save dist/cube-gallery.min.js in your project. Then import in your .js file.

How to use ?

new CubeGallery(selector, options?)

Example

Create a div with your images.

<div id="gallery">
    <img src="" alt="">
    <img src="" alt="">
    ...
    <a href="#">
        <img src="" alt="">
    </a>
    ...
</div>

Note that you can wrap <img> elements with a <a href="#">. <a> element has a relative position so you can put other elements with absolute position above. You also can add borders with CSS to <img> elements.

Instanciate CubeGallery.

new CubeGallery('gallery', {
    minHeight: 150
})

Responsive

Cube Gallery is responsive by default.

Available options

Some options are available to manage your gallery.

{
    minHeight: 100 // default
    margin: 0 // default
}

cube-gallery's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.