npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cascade-gallery

v1.2.3

Published

VueJs Image gallery which randomizes image sizes in the given ranges on each load.

Downloads

5

Readme

Cascade gallery

VueJs image gallery which randomizes image sizes in the given range on each load.

version version version version version version

Dependencies

  • VueJs 2.X

Installation

npm install cascade-gallery

Usage

Import cascade gallery

import CascadeGallery from 'cascade-gallery'

Declare cascade gallery in your component

components: {
    'cascade-gallery': CascadeGallery
}
...

Minimal configuration

images: [
    {
        src: [
            'https://ibmachine.com/images/machine/87/7257/9004.jpg',
            'https://ibmachine.com/images/machine/87/7257/3438.jpg',
        ]
    }
    ...
]

Invoke cascade gallery

<cascade-gallery :images="images"></cascade-gallery>

Configuration

<cascade-gallery :images="images" :config="config"></cascade-gallery>

Each object must contain src property which is an array of urls to the images. Also you can set additional data that can be used within solts to embed additional content.

images: {
    {
         src: [
             'https://ibmachine.com/images/machine/87/7257/9004.jpg',
             'https://ibmachine.com/images/machine/87/7257/3438.jpg',
         ],
         mydata: {
             'my-custom-data-1': 'Hello',
             'my-custom-data-2': true
         }
     },
    {
         src: [
             'https://ibmachine.com/images/machine/87/7257/9004.jpg',
             'https://ibmachine.com/images/machine/87/7257/3438.jpg',
         ],
         mydata: {
             'my-custom-data-1': 'World!',
             'my-custom-data-2': false
         }
     }
     ...
}

config: {
    
    /**
     * Images width range
     */
    'width-range': {
        min: 250,
        max: 300
    },

    /**
     * Images height range
     */
    'height-range': {
        min: 200,
        max: 250
    },

    /**
     * Gap in between a columns in pixels
     */
    'gap': 5,

    /**
     * Milliseconds between images displaying
     */
    'appending-delay': 150,

}

Content customization

If you want to embed custom content into the image block you can use default Vue slots approach. Use v-slot:default="image" property to get access to the each image configuration.

TODO: Customize image content as well as modal content

<cascade-gallery v-slot:default="image">
    {{ images[image.index].mydata['my-custom-data-1'] }}
    {{ images[image.index].mydata['my-custom-data-2'] ? 'Check Configuration! =]' : '' }}

You can replace mydata with any name you wish to use.