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

novicell-overlay

v2.1.0

Published

Simple script that can open an overlay / modal

Downloads

49

Readme

Novicell Overlay

Simple script that can open an overlay / modal

Usage

Written in pure Vanilla JS, it has no dependencies. It ships with a sample POST-CSS file, for easy implementation with the novicell-frontend setup. Use the styles for inspiration and then make your own styles.

Install with npm

npm install novicell-overlay

Setup

First include the dependency in your project's js file:

import NovicellOverlay from 'novicell-overlay';

And css (optional)

@import '../../node_modules/novicell-overlay/css/novicell.overlay.css';

Example

Markup

<div class="demo-content">
    <button id="js-overlay-trigger" class="button button--orange" data-element="#js-overlay-content"
      type="button">Selector overlay</button>
    <button data-video-id="152477009" data-type="vimeo" class="js-video-overlay-trigger button button--blue">Vimeo
      overlay</button>
    <button data-video-id="5dsGWM5XGdg" data-type="youtube" class="js-video-overlay-trigger button button--red">YouTube
      overlay</button>
</div>

<div class="overlay-content" id="js-overlay-content" style="display: none;">
    <h1>Seamlessly myocardinate</h1>
    <p>Rem distinctio, vero sint quas numquam optio placeat, tenetur quasi unde nobis maiores. Reiciendis veritatis
      itaque recusandae ipsa, qui error possimus illo nihil animi commodi neque beatae, dicta impedit. Laudantium.</p>
    <p>Officia quam commodi blanditiis unde perferendis repellat deleniti voluptatem consequatur repudiandae eos
      quibusdam dolorem molestias nostrum numquam maiores totam architecto, nemo provident reprehenderit labore veniam
      eius molestiae odit enim iusto.</p>
    <p>Amet dolores reiciendis modi est atque, inventore at adipisci accusamus hic necessitatibus obcaecati recusandae
      consequuntur, odit, cupiditate ad voluptas laboriosam. Blanditiis ducimus consectetur nulla voluptates rerum iusto
      quo asperiores enim!</p>
</div>

Then call the overlay.create()-method when you need to open the overlay.

Example:

import NovicellOverlay from 'novicell-overlay';
// import NovicellOverlay from 'novicell-overlay.esm.js';//
document.addEventListener('DOMContentLoaded', () => {
    // Select your overlay trigger
    const trigger = document.querySelector('#js-overlay-trigger');
    trigger.addEventListener('click', (e) => {
        e.preventDefault();
        const overlayOne = new NovicellOverlay({
            selector: '#flafOverlay',
            className: 'selector-overlay',
            videoId: 'Bs3RLRF5akk',
            type: 'youtube',
            disableTracking: true,
            onCreate() {
                console.log('created');
            },
            onLoaded() {
                console.log('loaded');
            },
            onDestroy() {
                console.log('Destroyed');
            },
        });
        overlayOne.create();
    });
});

Options

const overlay = new NovicellOverlay({
    'videoId': '9bZkp7q19f0',                               // [string] Youtube or Vimeo video id
    'isVideo': true                                         // [boolean] Determines if video. Default is false
    'type': 'youtube',                                      // [string] 'youtube' or 'vimeo'
    'disableTracking': true,                                // [boolean] Disable tracking from video hosts. Default is false
    'className': 'video-overlay',                           // [string] class for overlay
    'autoplay': 1,                                          // [number] 0 or 1, turns on/off autoplay for vimeo and youtube
    'selector': '#js-overlay-content',                      // [string] javascript selector for content to go in overlay (overrides video)
    'element': element.querySelector('.child-element'),     // [DOM element] DOM element for content to go in overlay (overrides video)
    'onCreate': function(){},                               // [function] runs on create
    'onLoaded': function(){},                               // [function] runs on load
    'onDestroy': function(){}                               // [function] runs on destroy
});

Contribution

Looking to contribute something? Here's how you can help. Please take a moment to review our contribution guidelines in order to make the contribution process easy and effective for everyone involved.

License

The Novicell Overlay is licensed under the MIT license. (http://opensource.org/licenses/MIT)