1.0.0 • Published 2 years ago

@corentinmag/ngx-splash v1.0.0

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

To use this library:

$ npm install @corentinmag/ngx-splash lottie-web ngx-lottie

check demo here

// app.module.ts

import { NgxSplashModule } from '@corentinmag/ngx-float-button';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
...

@NgModule({
    ...,
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        NgxSplashModule
    ]
})
<!-- app.component.html -->
<ngx-splash 
    title="My Awesome App" 
    message="Loading application..."
    [stages]="stages"
    animation="assets/lottie-animation.json"
    icon="assets/logo.jpg"
    loader="assets/loader.svg"
    (finalize)="onFinalize($event)"
>
</ngx-splash>

List of Inputs

@Inputstypedefaultdescription
titlestringMy Apptitle
messagestringLoading...custom message to help user
loaderstringnullpath to the loader (svg)
iconstringnullpath to the main icon (enterprise logo, ...)
animationstringnulleither a lottie json file or a lottie url
stagesStage[]nullAn array of object containing the following keys messageBefore, messageAfter, observable
keyframeKeyframe[]nullanimation that is played while the slash screen is active
keyframeOptionsobject15option for the keyframe object

Stage

stages = [
        {
          messageBefore: 'Initializing profile...',
          messageAfter: 'Profile initialized!',
          observable: timer(2000)
        },
        {
          messageBefore: 'Getting data...',
          messageAfter: 'Got data!',
          observable: timer(5000)
        },
      ]