Nighthawk

Quick start

👉🏼 How to get started?

1. Place the nighthawk-devkit-5.0.0.tgz that you downloaded after purchase, in your project root folder (same as package.json).

2. Install the package using the following command:

3. Import Nighthawk Devkit default styles file in your styles.scss file, like so:

4. Create a theme.scss file in your "src" folder including all the variables i.e. a theme, and import it in your styles.scss file, like so:

5. Install the copyfiles package, like so:

6. Include Nighthawk core assets in angular.json, like so:

7. Create a script in package.json that copies Nighthawk core assets into your public folder after npm install, like so:

8. Wrap your <router-outlet></router-outlet> (in app.component.ts) with a <main> tag, so it works with the page loader, like so:

9. Set the ViewContainerRef and bootstrap the Nighthawk application after view initialization, like so:

10. All done, you can now configure the page loader and style variables in your theme.scss file.

🫵🏼 Application configuration

OptionTypeDescriptionDefault valuePossible values
pageLoaderEnabledbooleanShows the loader on initial page loadtruetrue/false
routeLoaderEnabledbooleanShows the loader when switching routesfalsetrue/false
pageLoaderTypeenumSpecifies which type of loader to use for page/route loading (fallback)- 'bouncing-ball', 'bouncing-circles', 'bouncing-squares', 'fade-stagger-circles', 'fade-stagger-squares', 'gear-spinner', 'infinite-spinner', 'motion-blur-2', 'ripples', 'tube-spinner', 'tube-spinner'
pageLoaderCustomImagePathboolean | stringCustom loader image path, overrides pageLoaderType-any string
manualLoaderbooleanShow loader until NighthawkBootstrapService::pageLoaded() is calledfalsetrue/false
minimumLoaderTimenumberMinimum time that the initial page loader should be visible for in milliseconds1000500-infinite
fontsstring[]List of fonts used on the page to check before loader can finish[]string[]