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

mk-guide

v1.12.2

Published

A light JavaScript library to guide the user to focus the important part, including fix element

Downloads

79

Readme

  • A light JavaScript library to guide the user to focus the important part, including fix element.
  • There is Demo with default value

Install

npm install mk-guide
or npm i mk-guide
or yarn add mk-guide

Usage

Import

Import the library and the CSS file

import MkGuide from 'mk-guide'
import 'mk-guide/style.css'

Or for css file

//index.html
<link type="text/css" rel="stylesheet" href="node_modules/mk-guide/style.css">

Creat a variable of guide

Input a new variable mask

// New a maskclass with default value
let mask = new MkGuide()  

Or you could customize it with color:

// Customize it
let mask = new MkGuide({ 
    buttonColor: "gold", // optional   
    skipButtonColor: "firebrick", // optional
    mouseHover: "true", // optional  default:false
    mode: "dark", // default: light
    isFocus: false, // default: true
    isKeyboard: true
})  

Initialize the route and get started

Set the route of guide, and call the mask.start().

// example with 3 step, and it will focus the element of step2
mask.guides = [
    {   
        element: "#step1",                // querySelector
        imgURL: 'https://xxxx/xxx.com',
        header: 'Welcome',
        description: "this is step 1"    // the words of tip
    },
    {   
        element: ".step2",
        description: "Tap in here, and focus it (shouldFocus: true)"
    },
    {
        element: "box3",
        description: "You can control it with'→ ← ESC'"
    },
]

mask.start() // start the mask guide

Or you can use intro.

// Must use intro for the first guide item
mask.guides = [
    {   
        intro: true, // ONLY can be used for the first item! And no element   
        imgURL: 'https://xxxx/xxx.com',
        header: 'Welcome',
        description: "this is step 1" 
        // And do not use 'element' and 'shouldFocus' for intro item
    },
    {   
        element: ".step2",
        description: "Tap in here, and focus it (shouldFocus: true)"
    },
    {
        element: "box3",
        description: "You can control it with'→ ← ESC'"
    },
]

update history

v1.12

Added: IsKeyboard is supported, which can be used to control keyboard.

v1.11

Added: Implemented the function of highlighting the fixed element and refreshing when scrolling.

v1.10

Debug: Fixed the bug of display about the bottom item

v1.9

Added: Dark mode and light mode

Debug: Clear the display bug

v1.8

Added: header, picture, intro, and resize refresh

v1.7

Optimized code structure

v1.4

Debug: Clear the display bug

v1.3

Debug: Clear the keypress && Beyond the margin

v1.1.0

Added customized color API and shouldFocus API

v1.0.2

Added the arrow into the button

v1.0.1

Changed the color of tip