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
Option | Type | Description | Default value | Possible values |
---|---|---|---|---|
pageLoaderEnabled | boolean | Shows the loader on initial page load | true | true/false |
routeLoaderEnabled | boolean | Shows the loader when switching routes | false | true/false |
pageLoaderType | enum | Specifies 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' |
pageLoaderCustomImagePath | boolean | string | Custom loader image path, overrides pageLoaderType | - | any string |
manualLoader | boolean | Show loader until NighthawkBootstrapService::pageLoaded() is called | false | true/false |
minimumLoaderTime | number | Minimum time that the initial page loader should be visible for in milliseconds | 1000 | 500-infinite |
fonts | string[] | List of fonts used on the page to check before loader can finish | [] | string[] |