added update notification's animation

This commit is contained in:
Nicolas Constant 2020-02-26 00:02:54 -05:00
parent f9ac4319aa
commit 00cd6ae592
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
3 changed files with 27 additions and 3 deletions

View File

@ -10,9 +10,9 @@
</div>
</div>
<div class="auto-update">
<div class="auto-update" [class.auto-update__activated]="updateAvailable">
<div class="auto-update__display">
<div class="auto-update__display--text">A new version is available!</div> <a href class="auto-update__display--reload">reload</a> <a href class="auto-update__display--close"><fa-icon [icon]="faTimes"></fa-icon></a>
<div class="auto-update__display--text">A new version is available!</div> <a href class="auto-update__display--reload">reload</a> <a href class="auto-update__display--close" (click)="closeAutoUpdate()"><fa-icon [icon]="faTimes"></fa-icon></a>
</div>
</div>

View File

@ -101,13 +101,21 @@ app-streams-selection-footer {
.auto-update {
transition: all .2s;
transition-timing-function: ease-in;
position: absolute;
height: 70px;
left: 0;
right: 0;
bottom: 0;
bottom: -70px;
z-index: 999999999;
&__activated {
// opacity: 1;
transition: all .25s;
transition-timing-function: ease-out;
bottom: 0px;
}
&__display {
position: relative;

View File

@ -29,6 +29,9 @@ export class AppComponent implements OnInit, OnDestroy {
private streamSub: Subscription;
private dragoverSub: Subscription;
updateAvailable: boolean;
@Select(state => state.streamsstatemodel.streams) streamElements$: Observable<StreamElement[]>;
constructor(
@ -38,6 +41,11 @@ export class AppComponent implements OnInit, OnDestroy {
}
ngOnInit(): void {
setTimeout(() => {
this.updateAvailable = true;
}, 2000);
this.streamSub = this.streamElements$.subscribe((streams: StreamElement[]) => {
if (streams && streams.length === 0) {
this.tutorialActive = true;
@ -114,4 +122,12 @@ export class AppComponent implements OnInit, OnDestroy {
this.mediaService.uploadMedia(selectedAccount, files);
return false;
}
closeAutoUpdate(): boolean {
this.updateAvailable = false;
setTimeout(() => {
this.updateAvailable = true;
}, 2000);
return false;
}
}