Skip to content

Commit

Permalink
feat: add fade in animation after initial load
Browse files Browse the repository at this point in the history
  • Loading branch information
jrassa committed Jul 25, 2024
1 parent d9190e2 commit 06e146c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="app-container">
<div class="app-container" @enter>
<site-container>
<router-outlet />
</site-container>
Expand Down
11 changes: 10 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { animate, style, transition, trigger } from '@angular/animations';
import { Component, inject } from '@angular/core';
import { RouterOutlet } from '@angular/router';

Expand All @@ -8,7 +9,15 @@ import { ThemingService } from './core/theming/theming.service';
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
imports: [SiteContainerComponent, RouterOutlet]
imports: [SiteContainerComponent, RouterOutlet],
animations: [
trigger('enter', [
transition(':enter', [
style({ opacity: 0 }),
animate('200ms ease-in', style({ opacity: 1 }))
])
])
]
})
export class AppComponent {
private theming = inject(ThemingService);
Expand Down

0 comments on commit 06e146c

Please sign in to comment.