Socket
Socket
Sign inDemoInstall

open-gallery-element

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    open-gallery-element

A lightweight, easy-to-use web component for image galleries ported from.


Version published
Weekly downloads
10
decreased by-28.57%
Maintainers
1
Install size
34.9 kB
Created
Weekly downloads
 

Readme

Source

OpenGallery is a custom web component that creates a dynamic image gallery within a web page. The component fetches image data from a JSON source and displays the images in a customizable layout. It supports multiple layout options, responsive design, and accessibility enhancements to provide a user-friendly experience.

Features
  • Dynamic Image Loading: Fetches images from a JSON source and displays them within the component.
  • Customizable Layouts: Supports multiple layout options. Users can switch between grid, masonry, and list views.
Usage

Add the following script tag to the HTML file where you want to use the OpenGallery component:

<script src="path/to/open-gallery.js" type="module"></script>
  1. HTML Structure: Place the <open-gallery> tag in the HTML document where you want the gallery to appear.

    <open-gallery src="path/to/images.json"></open-gallery>
    
  2. Attributes:

    • src: Specifies the URL of the JSON file containing the images' data.
  3. JSON Structure: The JSON file should follow the specified format, containing image details such as URL, alternative text, caption, and date.

    {
        "items": [
            {
                "_open_gallery": {
                    "url": "image_url.jpg",
                    "alt": "Image description",
                    "caption": "Image caption",
                    "date": "Image date"
                }
            }
        ]
    }
    

Keywords

FAQs

Last updated on 17 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc