UNPKG

rj-spinner

Version:

This library was generated with https://github.com/angular/angular-cli version 9.1.13.

74 lines (67 loc) 3.69 kB
import { __decorate } from 'tslib'; import { ɵɵdefineInjectable, Injectable, Component, NgModule } from '@angular/core'; import { Subject } from 'rxjs'; import { CommonModule } from '@angular/common'; var RjSpinnerService = /** @class */ (function () { function RjSpinnerService() { this.spinnerFlag = new Subject(); } RjSpinnerService.prototype.show = function () { this.spinnerFlag.next(true); }; RjSpinnerService.prototype.hide = function () { this.spinnerFlag.next(false); }; RjSpinnerService.ɵprov = ɵɵdefineInjectable({ factory: function RjSpinnerService_Factory() { return new RjSpinnerService(); }, token: RjSpinnerService, providedIn: "root" }); RjSpinnerService = __decorate([ Injectable({ providedIn: 'root' }) ], RjSpinnerService); return RjSpinnerService; }()); var RjSpinnerComponent = /** @class */ (function () { function RjSpinnerComponent(rjSpinnerService) { var _this = this; this.rjSpinnerService = rjSpinnerService; this.showSpinner = false; this.rjSpinnerService.spinnerFlag.subscribe(function (res) { _this.showSpinner = res; }); } RjSpinnerComponent.prototype.ngOnInit = function () { }; RjSpinnerComponent.ctorParameters = function () { return [ { type: RjSpinnerService } ]; }; RjSpinnerComponent = __decorate([ Component({ selector: 'rj-spinner', template: "<div class=\"spinner-main\" *ngIf=\"showSpinner\">\n <div class=\"spinner\"></div></div>\n ", styles: ["body {\n margin:0;\n padding:0;\n }\n .spinner-main {\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #0000001c;\n }\n .spinner {\n width: 40px;\n height: 40px;\n background-color: #333;\n \n margin: 100px auto;\n -webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;\n animation: sk-rotateplane 1.2s infinite ease-in-out;\n }\n \n @-webkit-keyframes sk-rotateplane {\n 0% { -webkit-transform: perspective(120px) }\n 50% { -webkit-transform: perspective(120px) rotateY(180deg) }\n 100% { -webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg) }\n }\n \n @keyframes sk-rotateplane {\n 0% { \n transform: perspective(120px) rotateX(0deg) rotateY(0deg);\n -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg) \n } 50% { \n transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);\n -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg) \n } 100% { \n transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);\n -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);\n }\n }"] }) ], RjSpinnerComponent); return RjSpinnerComponent; }()); var RjSpinnerModule = /** @class */ (function () { function RjSpinnerModule() { } RjSpinnerModule = __decorate([ NgModule({ declarations: [RjSpinnerComponent], imports: [ CommonModule ], exports: [RjSpinnerComponent] }) ], RjSpinnerModule); return RjSpinnerModule; }()); /* * Public API Surface of rj-spinner */ /** * Generated bundle index. Do not edit. */ export { RjSpinnerComponent, RjSpinnerModule, RjSpinnerService }; //# sourceMappingURL=rj-spinner.js.map