tutty.js
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Tutty.js

Authors

Library for Angular 5 for creating simple interactive tutorials for your website!

How to use?

  1. Make sure that your project is run on Angular 5.2+ and has Bootstrap v.3.3.7 included in its package.json. Remember to add proper ID to those HTML elements where you would like to display hints.

  2. Create tutty-configuration.json file which has format like this:

{
    "data": [
      {
        "name": "firstHintCollection",
        "hints":[
          {
            "id": "firstElementId",
            "direction": "top",
            "message": "text to display "}
        ]
      },
      {
        "name":"secondHintCollection",
        "hints": [
          {
            "id": "secondElementId",
            "direction" : "right",
            "message" : "other text to display"
          },
		  {
            "id": "thirdElementId",
            "direction" : "bottom",
            "message" : "yet another text to display"
          }
        ]
    }
    ]
}
  1. Import TuttyService from tutty.js inject it to your component, and start it:
import {TuttyService} from 'tutty.js'
constructor(private tutty: TuttyService) { }
ngAfterViewInit(): void { this.tutty.displayHints("firstHintCollection", 'inner'); }

where firstHintCollection is hint collection name and inner is ID of HTML element where you want to inject this component.

NOTE: to make sure that hints will be proprerly displayed you need to invoke displayHints method after your application DOM will be loaded (for example in ngAfterViewInit() method).

Readme

Keywords

none

Package Sidebar

Install

npm i tutty.js

Weekly Downloads

3

Version

0.1.4

License

MIT

Unpacked Size

340 kB

Total Files

34

Last publish

Collaborators

  • epyepy
  • joel1922
  • karosowa
  • okularki111