Skip to content

Commit a6542fa

Browse files
committed
chore(lottie): use @fivethree/lottie lib
1 parent fb8d0a4 commit a6542fa

6 files changed

Lines changed: 25 additions & 24 deletions

File tree

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@angular/router": "7.2.6",
2727
"@angular/service-worker": "7.2.6",
2828
"@fivethree/core": "0.5.10",
29+
"@fivethree/lottie": "0.1.0",
2930
"@ionic-native/core": "5.2.0",
3031
"@ionic-native/splash-screen": "5.2.0",
3132
"@ionic-native/status-bar": "5.2.0",
@@ -34,7 +35,7 @@
3435
"@ngx-translate/http-loader": "4.0.0",
3536
"core-js": "2.6.5",
3637
"hammerjs": "2.0.8",
37-
"ng-lottie": "0.3.2",
38+
"lottie-web": "5.5.1",
3839
"ngx-markdown": "7.1.3",
3940
"rxjs": "6.3.3",
4041
"zone.js": "0.8.29"

src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
1414
import { ServiceWorkerModule } from '@angular/service-worker';
1515
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
1616
import { FivethreeCoreModule } from '@fivethree/core';
17-
import { LottieAnimationViewModule } from 'ng-lottie';
17+
import { LottieModule } from '@fivethree/lottie';
1818
import { environment } from '../environments/environment';
1919

2020
export function HttpLoaderFactory(http: HttpClient) {
@@ -39,7 +39,7 @@ export function HttpLoaderFactory(http: HttpClient) {
3939
}
4040
}),
4141
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
42-
LottieAnimationViewModule.forRoot(),
42+
LottieModule,
4343
],
4444
providers: [
4545
StatusBar,

src/app/pages/page-not-found/page-not-found.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { LottieModule } from '@fivethree/lottie';
12
import { ComponentsModule } from '@components/components.module';
23
import { NgModule } from '@angular/core';
34
import { CommonModule } from '@angular/common';
@@ -8,7 +9,6 @@ import { IonicModule } from '@ionic/angular';
89

910
import { PageNotFoundPage } from './page-not-found.page';
1011
import { TranslateModule } from '@ngx-translate/core';
11-
import { LottieAnimationViewModule } from 'ng-lottie';
1212

1313
const routes: Routes = [
1414
{
@@ -25,7 +25,7 @@ const routes: Routes = [
2525
RouterModule.forChild(routes),
2626
ComponentsModule,
2727
TranslateModule.forChild(),
28-
LottieAnimationViewModule
28+
LottieModule
2929
],
3030
declarations: [PageNotFoundPage]
3131
})

src/app/pages/page-not-found/page-not-found.page.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<app-header></app-header>
33
<div id="page-not-found-container">
44
<div [fivCenter]>
5-
<lottie-animation-view [options]="lottieConfig"
6-
[width]="200" [height]="200" (animCreated)="handleAnimation($event)">
7-
</lottie-animation-view>
5+
<fiv-lottie [params]="lottieConfig" [width]="200" [height]="200" (animationCreated)="handleAnimation($event)">
6+
</fiv-lottie>
87
<h3 text-center translate>404.text</h3>
98
<!-- <a text-center href="/">Go back to homepage</a> -->
109
</div>

src/app/pages/page-not-found/page-not-found.page.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2+
import { LottieAnimation } from '@fivethree/lottie';
23

34
@Component({
45
selector: 'app-page-not-found',
@@ -8,7 +9,7 @@ import { Component, OnInit } from '@angular/core';
89
export class PageNotFoundPage implements OnInit {
910

1011
lottieConfig: Object;
11-
animation: any;
12+
animation: LottieAnimation;
1213

1314
constructor() {
1415
this.lottieConfig = {
@@ -22,7 +23,7 @@ export class PageNotFoundPage implements OnInit {
2223
ngOnInit() {
2324
}
2425

25-
handleAnimation(animation) {
26+
handleAnimation(animation: LottieAnimation) {
2627
this.animation = animation;
2728
this.animation.setSpeed(0.8);
2829
this.animation.play();

0 commit comments

Comments
 (0)