All Projects → imgix → Luminous

imgix / Luminous

Licence: bsd-2-clause
A simple, lightweight, no-dependencies JavaScript lightbox

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Luminous

vue-tinybox
🌌 A slick, yet tiny lightbox gallery for Vue.js
Stars: ✭ 93 (-83.54%)
Mutual labels:  lightbox
Body Scroll Lock
Body scroll locking that just works with everything 😏
Stars: ✭ 3,357 (+494.16%)
Mutual labels:  lightbox
Amplify
A tiny script allowing inline image zoom
Stars: ✭ 458 (-18.94%)
Mutual labels:  lightbox
react-gallery-carousel
Mobile-friendly gallery carousel 🎠 with server side rendering, lazy loading, fullscreen, thumbnails, touch, mouse emulation, RTL, keyboard navigation and customisations.
Stars: ✭ 178 (-68.5%)
Mutual labels:  lightbox
Vue Image Lightbox
A Vue component to display an image gallery lightbox
Stars: ✭ 258 (-54.34%)
Mutual labels:  lightbox
React Native Gallery Toolkit
Reanimated 2 powered gallery implementation
Stars: ✭ 379 (-32.92%)
Mutual labels:  lightbox
vue-it-bigger
A simple image / (YouTube) video lightbox component for Vue.js.
Stars: ✭ 174 (-69.2%)
Mutual labels:  lightbox
Viewer
Image viewer (or Lightbox) with support for local and remote videos and images
Stars: ✭ 510 (-9.73%)
Mutual labels:  lightbox
Simple React Lightbox
A simple but functional light-box for React.
Stars: ✭ 265 (-53.1%)
Mutual labels:  lightbox
Lightgallery
A customizable, modular, responsive, lightbox gallery plugin.
Stars: ✭ 4,829 (+754.69%)
Mutual labels:  lightbox
vue-simple-lightbox
A Vue.js component for touch-friendly image lightbox for mobile and desktop with simple-lightbox
Stars: ✭ 58 (-89.73%)
Mutual labels:  lightbox
Zoomwall.js
A content-focused photo gallery using a horizontal masonry layout that scales up in lightbox mode.
Stars: ✭ 254 (-55.04%)
Mutual labels:  lightbox
Lightcase
The smart and flexible Lightbox Plugin.
Stars: ✭ 413 (-26.9%)
Mutual labels:  lightbox
ui
JavaScript UI component library, includes the latest Fancybox
Stars: ✭ 222 (-60.71%)
Mutual labels:  lightbox
React Cool Portal
😎 🍒 React hook for Portals, which renders modals, dropdowns, tooltips etc. to <body> or else.
Stars: ✭ 458 (-18.94%)
Mutual labels:  lightbox
tobii
An accessible, open-source lightbox with no dependencies
Stars: ✭ 132 (-76.64%)
Mutual labels:  lightbox
Basiclightbox
The lightest lightbox ever made.
Stars: ✭ 299 (-47.08%)
Mutual labels:  lightbox
Lightgallery.js
Full featured JavaScript image & video gallery. No dependencies
Stars: ✭ 5,168 (+814.69%)
Mutual labels:  lightbox
Nanogallery2
a modern photo / video gallery and lightbox [JS library]
Stars: ✭ 488 (-13.63%)
Mutual labels:  lightbox
Ngx Gallery
Angular Gallery, Carousel and Lightbox
Stars: ✭ 417 (-26.19%)
Mutual labels:  lightbox

imgix logo

Luminous is a simple, lightweight, no-dependencies JavaScript image lightbox.

npm version Build Status npm License styled with prettier FOSSA Status


Installation

  • NPM: npm install luminous-lightbox
  • Bower: bower install luminous
  • Manual: Download and use dist/Luminous.min.js or dist/Luminous.js

If you're using the pre-built version of Luminous, it will automatically make window.Luminous and window.LuminousGallery available for your use when included on your page.

If you prefer to use require statements and a build tool like Browserify, there are a couple other things to keep in mind. First, require('luminous-lightbox') gives you an object with Luminous and LuminousGallery keys. You can use it in the following ways:

var Luminous = require('luminous-lightbox').Luminous;

new Luminous();

If your project uses ES6, you can do the following instead:

import { Luminous } from 'luminous-lightbox';

new Luminous();

Usage

Once you've installed Luminous via one of the above methods, you're ready to get started. There are no dependencies, so you can just start making cool stuff. Check out the announcement blog post, or take a peek at our demo. Here's an example of a basic implementation:

<a href="https://assets.imgix.net/dog.png?w=1600">
  <img alt="A dog!" src="https://assets.imgix.net/dog.png?w=400">
</a>
new Luminous(document.querySelector("a"));

LuminousGallery Usage

Luminous supports gallery-style navigation using the LuminousGallery class. It works nearly the same as Luminous, but has a slightly different method of instantiation.

<ul>
  <li>
    <a class="gallery-demo" href="https://assets.imgix.net/unsplash/coyote.jpg?w=1600">
      <img src="https://assets.imgix.net/unsplash/coyote.jpg?w=100" alt="Coyote">
    </a>
  </li>
  <li>
    <a class="gallery-demo" href="https://assets.imgix.net/unsplash/motorbike.jpg?w=1600">
      <img src="https://assets.imgix.net/unsplash/motorbike.jpg?w=100" alt="Motorbike">
    </a>
  </li>
  <li>
    <a class="gallery-demo" href="https://assets.imgix.net/unsplash/hotairballoon.jpg?w=1600">
      <img src="https://assets.imgix.net/unsplash/hotairballoon.jpg?w=100" alt="Hot air balloon">
    </a>
  </li>
</ul>
new LuminousGallery(document.querySelectorAll(".gallery-demo"));

Options / Defaults

Here's an example of using Luminous with a custom configuration. All of the listed options are displayed with their default value.

var options = {
  // Prefix for generated element class names (e.g. `my-ns` will
  // result in classes such as `my-ns-lightbox`. Default `lum-`
  // prefixed classes will always be added as well.
  namespace: null,
  // Which attribute to pull the lightbox image source from.
  sourceAttribute: "href",
  // Captions can be a literal string, or a function that receives the Luminous instance's trigger element as an argument and returns a string. Supports HTML, so use caution when dealing with user input.
  caption: null,
  // The event to listen to on the _trigger_ element: triggers opening.
  openTrigger: "click",
  // The event to listen to on the _lightbox_ element: triggers closing.
  closeTrigger: "click",
  // Allow closing by pressing escape.
  closeWithEscape: true,
  // Automatically close when the page is scrolled.
  closeOnScroll: false,
  // Disable close button
  showCloseButton: false,
  // A node to append the lightbox element to.
  appendToNode: document.body,
  // A selector defining what to append the lightbox element to.
  // This will take precedence over `appendToNode`.
  appendToSelector: null,
  // If present (and a function), this will be called
  // whenever the lightbox is opened.
  onOpen: null,
  // If present (and a function), this will be called
  // whenever the lightbox is closed.
  onClose: null,
  // When true, adds the `imgix-fluid` class to the `img`
  // inside the lightbox. See https://github.com/imgix/imgix.js
  // for more information.
  includeImgixJSClass: false,
  // Add base styles to the page. See the "Theming"
  // section of README.md for more information.
  injectBaseStyles: true
};

new Luminous(document.querySelector("a"), options);

LuminousGallery Options / Defaults

LuminousGallery supports two sets of options arguments. The first set is specific to the gallery itself, and the second specifies the options that get passed to its child Luminous instances.

var galleryOpts = {
  // Whether pressing the arrow keys should move to the next/previous slide.
  arrowNavigation: true
};

var luminousOpts = {
  // These options have the same defaults and potential values as the Luminous class.
};

new LuminousGallery(document.querySelectorAll("a"), galleryOpts, luminousOpts);

Theming

By default, Luminous injects an extremely basic set of styles into the page via the injectBaseStyles option. You will almost certainly want to extend these basic styles for a prettier, more usable experience that matches your site. If you need to do something very out of the ordinary, or just prefer to include the default styles in CSS yourself, you can pass injectBaseStyles: false when instantiating a new instance of Luminous. Please note that if you disable the included base styles, you will still need to provide an animation for .lum-lightbox.lum-opening and .lum-lightbox.lum-closing (this can be a "noop" style animation, as seen in the base styles source).

There is also an included basic theme (luminous-basic.css) that may meet your needs, or at least give a good example of how to build out your own custom styles. This can either be included in your site's CSS via @import "node_modules/luminous-lightbox/dist/luminous-basic.css"; or as a linked stylesheet in your HTML.

Additionally, the namespace option can be used as a way to easily apply different themes to specific instances of Luminous.

Browser Support

We support the latest version of Google Chrome (which automatically updates whenever it detects that a new version of the browser is available). We also support the current and previous major releases of desktop Firefox, Internet Explorer, and Safari on a rolling basis. Mobile support is tested on the most recent minor version of the current and previous major release for the default browser on iOS and Android (e.g., iOS 9.2 and 8.4). Each time a new version is released, we begin supporting that version and stop supporting the third most recent version.

Meta

Luminous was made by imgix. It's licensed under the BSD 2-Clause license (see the license file for more info). Any contribution is absolutely welcome, but please review the contribution guidelines before getting started.

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].