1.0.2 • Published 2 years ago

ng-ghost-rider v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm version GitHub issues GitHub license

Features

✅ Router support ✅ Styleable content ✅ Ships with events ✅ No dependencies ✅ 100% Angular ✅ Multiple tour support

Usage

  1. Install the library with npm i ng-ghost-rider
  2. Add the stylesheet to your global styles file

    💡 After you import the stylesheet, you can override the css / scss to fit your application's needs 😃

@import '../node_modules/ng-ghost-rider/styles/ghost-rider.scss';

or

"styles": [
  "src/styles.scss",
  "./node_modules/ng-ghost-rider/styles/ghost-rider.scss"
],

in your angular.json file

  1. Add the module to your application
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    GhostRiderModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
  1. Then, set up any elements you want to be used as steps
<!-- These directives can be placed anywhere in your application -->
<h1 [ghostRiderStep]="{
  name: 'tour.firstStep',
  title: 'Step 1 title',
  content: 'Step 1 content'
}">
  Step 1
</h1>

<h1 [ghostRiderStep]="{
  name: 'tour.secondStep',
  title: 'Step 2 title',
  content: 'Step 2 content'
}">
  Step 2
</h1>
  1. Inject the GhostRiderService into the component that you'd like to start the tour from
import { Component } from '@angular/core';
import { GhostRiderService, GhostRiderStep } from 'ng-ghost-rider';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {

  constructor(
    private readonly _ghostRiderService: GhostRiderService,
  ) {
    this._ghostRiderService.start(
      'tour',
      [
        new GhostRiderStep('firstStep'),
        new GhostRiderStep('secondStep'),
        new GhostRiderStep('thirdStep'),
        // 💡 Optionally provide sub steps (for inner steps within the parent step... coming soon!)
        /*
        new GhostRiderStep(
          'thirdStepWithSubSteps',
          [
            new GhostRiderStep('firstSubStep'),
            new GhostRiderStep('secondSubStep'),
          ]
        )
        */
      ]
    );
  }
}
  1. Enjoy the ride!

Contributing

Feel free to report any bugs / issues here

Local Dev

  1. Fork and clone this repo
  2. Build the package npm run ghost-rider:build or pnpm run ghost-rider:build
  3. Run ng servefor a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files (you'll have to build the package after changing the source code under 'projects').

🔨 Build

Run npm run ghost-rider:build or pnpm run ghost-rider:build to build the project. The build artifacts will be stored in the dist/ directory.

🚀 Publishing

Run npm run publish or pnpm run publish to build the package and publish a new version to npm.

🧪 Running unit tests

Run ng test ng-ghost-rider to execute the unit tests via Karma.

License

MIT License

Copyright (c) 2022 Freddy Silber freddy.silber@gmail.com (https://ng-ghost-rider.github.io/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1.0.2

2 years ago

1.0.1

2 years ago

0.0.8-beta

2 years ago

1.0.0

2 years ago

0.0.18-beta

2 years ago

0.0.26-beta

2 years ago

0.0.15-beta

2 years ago

0.0.11-beta

2 years ago

0.0.22-beta

2 years ago

0.0.4-beta

2 years ago

0.0.7-beta

2 years ago

0.0.24-beta

2 years ago

0.0.19-beta

2 years ago

0.0.10-beta

2 years ago

0.0.16-beta

2 years ago

0.0.13-beta

2 years ago

0.0.21-beta

2 years ago

0.0.6-beta

2 years ago

0.0.9-beta

2 years ago

0.0.25-beta

2 years ago

0.0.14-beta

2 years ago

0.0.12-beta

2 years ago

0.0.17-beta

2 years ago

0.0.23-beta

2 years ago

0.0.5-beta

2 years ago

0.0.20-beta

2 years ago

0.0.2-beta

2 years ago

0.0.3-beta

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago