New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

just-lightbox

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-lightbox

Simple, lightweight Angular image lightbox library with gestures support & no dependencies

  • 18.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21
decreased by-32.26%
Maintainers
0
Weekly downloads
 
Created
Source

Just Lightbox

demo Build Status npm license

Simple, lightweight Angular image lightbox library with gestures support & no dependencies

Demo

View Demo

Installation

Import module:

import {JustLightboxModule} from 'just-lightbox';

@NgModule({
    imports: [JustLightboxModule.forRoot()]
})

Usage

Basic usage. Lightbox opens src image

<img src="path-to-full-image" jLightbox />

Different thumb and full images

<img src="path-to-thumbnail" jLightbox="path-to-full-image" />

It works with a hyperlinks

<a href="path-to-full-image" jLightbox>
    <img src="path-to-thumbnail" />
</a>

Call from code

import { JustLightboxService } from 'just-lightbox';

constructor(private lightbox: JustLightboxService) {}

open() {
    this.lightbox.open({
        describedby: 'aria-describedby',
        labelledby: 'araia-labelledby',
        imageSrc: 'path-to-full-image',
    });
}

Configuration

JustLightboxModule.forRoot({
    // Image paddings in px
    containerOffset: {
        vertical: 20, // Default: 0
        horizontal: 30, // Default: 0
    },
    gesturesEnabled: true, // Pinch zoom & pan gestures. Default: true
    wheelEnabled: true, // Wheel/trackpad zoom & pan. Default: false
    wheelSensitivity: {
        zoom: 10, // Default: 10
        pan: 5, // Default: 5
    },
});

Customization

Lightbox uses css variables

--j-lightbox__z-index: 10000000;
--j-lightbox__overlay__background-color: rgba(0, 0, 0, 0.9);
--j-lightbox__loader__color--primary: rgba(255, 255, 255, 1);
--j-lightbox__loader__color--secondary: rgba(255, 255, 255, 0.2);
--j-lightbox__loader__animation-duration: 1.1s;
--j-lightbox__overlay__cursor: zoom-out;

Keywords

FAQs

Package last updated on 19 Aug 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc