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

nz-tour

v1.2.1

Published

Touring and on-boarding made simple for AngularJS

Downloads

47

Readme

nzTour

Join the chat at https://gitter.im/nozzle/nzTour Touring and on-boarding made simple for AngularJS.

Awesome Demo

Features

  • Responsive & Intelligent
  • Automagic Positioning
  • Promise Driven Events & Hooks (Because we <3 Angular)
  • nzTour doesn't touch your DOM (more info below)

Installation & Usage

  1. $ bower/npm install nz-tour --save
  2. Include jQuery (before Angular)
  3. Include dist/nz-tour.min.js and dist/nz-tour.min.css files.
  4. Add nzTour as a dependency in your app.
  5. Inject the nzTour service anywhere in your app.

Simple Usage

var tour = {
	config: {} // see config
    steps: [{
        target: '#first-element',
        content: 'This is the first step!',
    }, {
        target: '.some .other .element',
        placementPriority: [ 'right', 'top', 'bottom', 'left' ],
        content: 'Blah blah blah. I prefer to show up on the right.',
    }, {
        target: '#menu-element',
        content: 'I guess this is a menu!',
    }, {
        target: '#last-element',
        content: 'It is over! :(',
    }]
};

nzTour.start(service.tours[tour])
    .then(function() {
        console.log('Tour Finished!');
    })
    .catch(function() {
        console.log('Tour Aborted!')
    });

Config

Defaults:

var tour = {
	config: {
        mask: {
            visible: true, // Shows the element mask
            visibleOnNoTarget: false, // Shows a full page mask if no target element has been specified
            clickThrough: false, // Allows the user to interact with elements beneath the mask
            clickExit: false, // Exit the tour when the user clicks on the mask
            scrollThrough: true // Allows the user to scroll the scrollbox or window through the mask
            color: 'rgba(0,0,0,.7)' // The mask color
        },
        scrollBox: 'body', // The container to scroll when searching for elements
        previousText: 'Previous',
        nextText: 'Next',
        finishText: 'Finish',
        showPrevious: true, // Setting to false hides the previous button
        showNext: true // Setting to false hides the next button
        animationDuration: 400, // Animation Duration for the box and mask
        placementPriority: ['bottom', 'right', 'top','left'],
        dark: false, // Dark mode (Works great with `mask.visible = false`)
        disableInteraction: false, // Disable interaction with the highlighted elements
        highlightMargin: 0, // Margin of the highglighted area
        disableEscExit: false // Disable end of tour when pressing ESC,
        onClose: function() {} //Function called when the tour is closed
        onComplete: function() {} //Function called when the tour is completed
    },
	steps: []
}

Shortcut Keys

  • Left/Right Arrow keys - Previous/Next
  • Esc - Abort the tour
  • 1-9 - Goto step 1-9

API

####.start(tour) - Starts a Tour Params:

  • tour: Tour Object

Returns:

  • Promise that resolves when the tour is finished and rejected when aborted.

####.stop() - Stops a Tour Returns:

  • Promise that resolves when the tour is stopped.

####.pause() - Pauses a Tour Returns:

  • Promise that resolves when the tour is paused and hidden.

####.next() - Goes to the next step in the current tour Returns:

  • Promise that resolves when the next step is reached

####.previous() - Goes to the previous step in the current tour

  • Promise that resolves when the previous step is reached

####.gotoStep(step): - Goes to a specific step in the tour Params:

  • step: The number of the step starting at 1,2,3...

Returns:

  • Promise that resolves when the specific step is reached

Promising Event Hooks

  • Before - function that returns a promise
  • After - function that returns a promise

Example

var tour = {
	steps: [{
        target: '#first-element',
        content: 'This is the first step!',
    }, {
        target: '.some .other .element',
        content: 'Blah blah blah.',
        showPrevious: false,
        before: function(direction){
            if(direction === -1)
                console.log('coming from next step');
            else if (direction === 1)
                console.log('coming from previous step');
            else
                console.log('started at this step');

        	var d = $q.defer();
        	// Do something amazing
        	d.resolve(); // or d.reject()
        	return d.promise
    	}
    }, {
        target: '#menu-element',
        content: 'I guess this is a menu!',
        after: function(direction){
        	var d = $q.defer();
        	// Do some more cool stuff
        	d.resolve(); // or d.reject()
        	return d.promise
    	}
    }, {
        target: '#last-element',
        content: 'It is over! :(',
    }]
}

Roadmap & Contributing

  • Update example
  • Reduce footprint
  • Dynamic Masking (opening select boxes and dynamically moving content)
  • Remove dependency on jQuery
  • Use angular $animate for animations and class changes
  • Add more hooks and config for customization

All PR's and contributions are more than welcome!