1.0.5 ā€¢ Published 3 years ago

flexible-spinner v1.0.5

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

Flexible Spinner

flexible-spinner is a library which can be generated dynamically using Input properties. It can be used in many different places e.g. inside buttons, paragraphs etc, or on center position for whole current application. Fully wrote with TypeScript.

Demo

šŸ‘‰ Live Demo: http://flexible-spinner.atwebpages.com/

Getting started

npm install --save flexible-spinner

Setup

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { FlexibleSpinnerModule } from 'flexible-spinner';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FlexibleSpinnerModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Using the component

.html

<flexible-spinner [spinnerId]="1"
                  [centerPosition]="false"
                  [speed]="2"
                  [size]="50"
                  [thickness]="10"
                  [filledWidth]="1"
                  [filledColor]="'red'"
                  [unFilledColor]="'#eee'"
                  [showText]="true"
                  [text]="'Loading...'"
                  [textSize]="16"
                  [textColor]="'red'"></flexible-spinner>

.ts

import { FlexibleSpinnerService } from 'flexible-spinner';
...

constructor(
  private spinnerService: FlexibleSpinnerService
) { }

ngOnInit() {
  this.showSpinner();
}

showSpinner() {
  this.spinnerService.showSpinner(1);
}

hideSpinner() {
  this.spinnerService.hideSpinner(1);
}

Input properties

@InputTypeDescription
spinnerIdnumberIn the same it can be used in multiple places adding spinnerId
centerPositionbooleanIt can be used on center position or in other places adding centerPosition
speednumberRotation speed in seconds
sizenumberSize in px
thicknessnumberThickness in px
filledWidthnumberValue must be 1, 2 or 3. It means the spinner can be filled 25%, 50% or 75%
filledColorstringColor that is filled
unFilledColorstringColor that is not filled
showTextbooleanIs possible to show text or message below the spinner
textstringThe text e.g. Loading...
textSizenumberThe size of text in px
textColorstringThe color of text

License

MIT

Author

Hasan Ibishi

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

0.0.3

3 years ago