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

rooverlay

v1.2.3

Published

Overlay library to display image/video galleries, html or iframes

Downloads

9

Readme

rooverlay

npm version Build Status codecov.io

Overlay library that displays image/video galleries, html or iframes.

Dependencies

This library has no dependencies and still weights just ~15 KB unminified.

Compatibility

Recent browsers such as: IE 8+, Safari, Firefox & Chrome.

Install

$ npm install --save rooverlay

Usage

Below is a example of usage.

Image Gallery

var Rooverlay = require('rooverlay');

var rooverlay = new Rooverlay({
  loop: true,
  slides: [{
    type: 'image',
    description: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr',
    src: 'rooverlay-1.jpg'
  }, {
    type: 'iframe-video',
    title: 'Roo',
    description: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr',
    src: 'https://d1zucocqrua2yq.cloudfront.net/v2/video/player-frame/50b6675694a940db6d000001/media-00ism10unt4h9ek0ysbr25?autoplay=true'
  }, {
    type: 'image',
    src: 'rooverlay-3.jpg'
  }]
});

Login Overlay

var Rooverlay = require('rooverlay');

var rooverlay = new Rooverlay({
  loop: true,
  slides: [{
    type: 'iframe',
    src: 'https://staging-api.tickaroo.com/oauth/login?response_type=code&client_id=55d34d46e4b0b5f93ed111da&_lang=en'
  }]
});

API

new Rooverlay(options):

  • options:

    • closeOnOverlayClick: Closes slideshow on overlay background click. (default false)
    • slideIndex: Initial start index of the slideshow slides. (default 0)
    • loop: Loops slideshow. (default false)
    • skin: Slideshow layout skin, possible values are 'light' and 'dark' (default 'dark', undefined)
    • extraClasses: Adds extra classes to the class attribute of the root element .rooverlay-wrapper (default undefined)
    • pagination: Shows pagination. (default false)
    • paginationDescending: Counts the pages in descending order. (default false)
    • container: Element slideshow will be appended to. (default document.body)
    • disableKeyboardControls: Disable keyboard arrow key controls to go forward or back and the "escape" key to close the overlay. (default false)
    • onBeforeClose: Callback after closing the overlay. (default undefined)
    • onAfterSlideRender: Callback after slide renders. (default undefined)
    • onBeforeSlideRender: Callback before slide renders. (default undefined)
    • i18n: Text displayed to the user. (type PlainObject)
      • missing: Appears when content can't be loaded. (default 'Missing')
    • slides: Slides that will be displayed in the overlay. (type Array<PlainObject> default [])

    Image slide:

    • type: 'image'
    • src: Image url. (default undefined)
    • width: Maximal image width. (default dynamic image width)
    • height: Maximal image height. (default dynamic image height)
    • minWidth: Minimal image width, if window size allows it. (default 300)
    • minHeight: Minimal image height, if window size allows it. (default 300)
    • aspectRatio: Whether or not to respect image size ratio on resize. (default true)
    • description: Description text/HTML string appended to the content element. (default undefined)
    • descriptionElement: Description DOM element appended to the content element. (default undefined)
    • title: Title text/HTML string appended to the top row title element. (default undefined)

    Video iframe slide:

    • type: 'iframe-video'
    • src: Iframe url. (default undefined)
    • width: Maximal iframe width. (default 800)
    • height: Maximal iframe height. (default 450)
    • minWidth: Minimal iframe width, if window size allows it. (default undefined)
    • minHeight: Minimal iframe height, if window size allows it. (default undefined)
    • aspectRatio: Whether or not to respect iframe size ratio on resize. (default true)
    • description: Same as in image
    • descriptionElement: Same as in image
    • title: Same as in image

    Iframe slide:

    • type: 'iframe'
    • src: Iframe url. (default undefined)
    • width: Maximal iframe width. (default 800)
    • height: Maximal iframe height. (default 450)
    • minWidth: Minimal iframe width, if window size allows it. (default undefined)
    • minHeight: Minimal iframe height, if window size allows it. (default undefined)
    • aspectRatio: Whether or not to respect iframe size ratio on resize. (default false)

    HTML slide:

    • type: 'html'
    • html: HTML string that will be set inside the content element. (default undefined)
    • content: If 'html' isn't set: DOM element that will be inserted to the content element. (default undefined)
    • width: Maximal HTML width. (default 600)
    • height: Maximal HTML height. (default undefined)
    • minWidth: Minimal html width, if window size allows it. (default undefined)
    • minHeight: Minimal html height, if window size allows it. (default undefined)
    • aspectRatio: Whether or not to respect html size ratio on resize. (default false)

instance.updateOptions(options):

Update the initial options.

  • options: Same as in initialization.

instance.updateSlides(slides):

Update the initial slides .

  • slides: Same as in initialization options.slides.

instance.updateSlidesAndRerenderWithIndex(slides, index):

Update the initial slides and rerenders them with slide index if index is set.

  • slides: Same as in initialization options.slides.
  • index: Slide index (default undefined)

instance.nextSlide():

Go to the next slide.

instance.previousSlide():

Go to the previous slide.

instance.jumpToSlide(index):

Jump to the index.

  • index: Slide index (default 0)

instance.fit():

Will center content element inside viewport.

instance.showLoading():

Show loading spinner.

instance.hideLoading():

Hides loading spinner.

instance.destroy() or instance.close():

Close the overlay, remove it from the DOM and remove the event listeners, like resize.

CSS

Links

@import "~rooverlay/src/index.scss"
@import "~rooverlay/src/images.scss"

Classes

  • .rooverlay-overlay: Overlay background-color
  • .rooverlay-description: Description box color, background-color and padding