elderguardian / painting.js

A gallery reusable for any image api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

painting.js

A reusable image gallery.

Usage

Create an instance of ImageGallery with configuration. Pass in an adapter function that returns the url to a random image. In this example it always returns the same image example.jpg.

    async function newImage() {
        //Generate image and return it
        return 'example.jpg'
    }

    const gallery = new ImageGallery('#gallery', {
        adapter: newImage,
        imagesAtOnce: 10,
        scrollingSpeed: 10,
    })

About

A gallery reusable for any image api


Languages

Language:JavaScript 64.2%Language:CSS 20.3%Language:HTML 15.5%