Coder Social home page Coder Social logo

ilianiv / angular-lightbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crystalui/angular-lightbox

0.0 1.0 0.0 379 KB

A simple, responsive lightbox component.

License: Apache License 2.0

JavaScript 4.76% TypeScript 74.37% CSS 15.37% HTML 5.50%

angular-lightbox's Introduction

Lightbox for Angular

A simple, responsive lightbox component.

Demo

http://crystalui.org/components/lightbox

Installation

Install the npm package.

npm i @crystalui/angular-lightbox

Import module:

import {CrystalLightboxModule} from '@crystalui/angular-lightbox';

@NgModule({
    imports: [CrystalLightboxModule]
})

Usage

You can cluster images into group.

<div lightbox-group>
    <img src="path_to_image" lightbox [fullImage]="{path: 'path_to_fullimage'}" />
</div>

Or keep them as separate images.

<img src="path_to_image" lightbox [fullImage]="{path: 'path_to_fullimage'}" />

You don’t need to specify the path to the large image, it’ll work either way.

<img src="path_to_image" lightbox />

Properties

imageMaxHeight: string = "100%"
// Maximum image height.

imageMaxWidth: string = "100%"
// Maximum image width.

counter: boolean = false
// Image counter.

counterSeparator: string = "/"
// The text separator counter.

backgroundColor: "black" | "white" = "black"
// Background color. Inverts the black and white colors of the controls and the background.

backgroundOpacity: number = "0.85"
// Lightbox background opacity.

animationDuration: number = "400"
// Speed of opening and closing animation.

animationTimingFunction: string = "cubic-bezier(0.475, 0.105, 0.445, 0.945)"
// Smooth opening and closing animation function.

closeButtonText: string = "Close"
// The Close button text.

hideThumbnail: boolean = true
// Hide the thumbnail when opening the lightbox.

disable: boolean = false
// Disable the lightbox.

Events

thumbnail:click
{type: "thumbnail:click"}
// Click on the thumbnail.

show-state:initial
{type: "show-state:initial"}
// Preparing styles for starting the lightbox display animation and the preloader display.

show-state:animation
{type: "show-state:animation"}
// Starting the lightbox display animation.

show-state:animation-end
{type: "show-state:animation-end"}
// Ending the lightbox display animation.

closing-state:initial
{type: "closing-state:initial"}
// Preparing styles for starting the lightbox closing animation.

closing-state:animation
{type: "closing-state:animation"}
// Starting the lightbox closing animation.

closing-state:animation-end
{type: "closing-state:animation-end"}
// Ending the lightbox closing animation.

Browser support

NAME VERSION
Chrome / Chrome for Android 50+ / Android 4.4+
FireFox 48+
Opera 44+
Safari / iOS Safari 10.1, 11.1 / iOS 9+
Internet Explorer Edge 15+

angular-lightbox's People

Contributors

drozhzhin-n-e avatar ky0suke avatar

Watchers

James Cloos 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.