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

guide-snap

v0.0.3

Published

A package that help for creating step by step tutoriel on web pages by using attributes on HTML tags

Downloads

239

Readme

GuideSnap

GuideSnap is an interactive tutorial library for the web. It allows developers to guide users through various steps on a webpage by highlighting elements in a specified order. This package can be integrated with any web project to create seamless, intuitive tutorials.

Table of Contents

Installation

To install GuideSnap, use npm:

npm install guide-snap

Usage

Once installed, import and initialize the GuideSnap class to create your tutorial. The tutorial starts by calling the start method.

Step-by-Step Guide

  1. Import and Initialize GuideSnap
import { GuideSnap } from 'guidesnap';

const tutorial = new GuideSnap();
  1. Set Up Tutorial Steps on HTML Elements

Add a gs attribute to each HTML element you want included in the tutorial. This attribute should hold a unique integer indicating the order in the tutorial sequence. Additionally, you can add a gs-text attribute to provide a description for each step.

<div>
	<!-- Default group elements-->
	<button gs="1" gs-text="Click here to start the tutorial">Start Tutorial</button>
	<input type="text" gs="2" gs-text="Enter your name here">
	<button gs="3" gs-text="Submit your information">Submit</button>
</div>
<div>
	<!-- Elements with group name -->
	<button gs-group="group1" gs="1" gs-text="Click here to start the tutorial">Start Tutorial</button>
	<input type="text" gs-group="group1" gs="2" gs-text="Enter your name here">
	<button gs-group="group1" gs="3" gs-text="Submit your information">Submit</button>
</div>
  1. Start the Tutorial

Once the elements are set up, initiate the tutorial with:

tutorial.start(); //Only use elements without group name
tutorial.start("group1"); //Only use elements with gs-group attribute name equal to "group1"

Features

  • Customizable Tutorial Order: Define the sequence of steps with the gs attribute.
  • Descriptive Steps: Add contextual descriptions for each step via the gs-text attribute.
  • Simple API: The start method initializes the entire tutorial with minimal setup.

Configuration

GuideSnap currently requires minimal configuration. Each tutorial step is defined directly in the HTML markup via gs and gs-text attributes, making it easy to create tutorials directly in your HTML structure.

Examples

Here's a quick example to show how GuideSnap could be used in a form tutorial:

<!DOCTYPE html> 
<html lang="en">
	<head> 
		<script type="module"> 
			import GuideSnap from './path/to/guidesnap.js';
			document.addEventListener("DOMContentLoaded", () => {
				const tutorial = new GuideSnap();
				tutorial.start(); //Start tutorial with only element without gs-group attribute
			}); 
		</script> 
	</head> 
	<body> 
		<button gs="1" gs-text="Click here to start the tutorial">Start Tutorial</button> 
		<input type="text" gs="2" gs-text="Enter your name here"> 
		<button gs="3" gs-text="Submit  your information">Submit</button> 
	</body> 
</html>