From b28e4e5e080646ec67363cb0a16c9bd97ccffb35 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 20 Feb 2019 10:16:04 +0100 Subject: Add user notification animation --- .../app/menu/avatar-notification.component.html | 29 ++++++++++++++-------- .../app/menu/avatar-notification.component.scss | 20 +++++++++++++-- .../src/app/menu/avatar-notification.component.ts | 9 +++++++ 3 files changed, 46 insertions(+), 12 deletions(-) (limited to 'client/src/app/menu') diff --git a/client/src/app/menu/avatar-notification.component.html b/client/src/app/menu/avatar-notification.component.html index 4ef3f0e89..a5ef43d42 100644 --- a/client/src/app/menu/avatar-notification.component.html +++ b/client/src/app/menu/avatar-notification.component.html @@ -1,6 +1,6 @@
{{ unreadNotifications }}
@@ -8,16 +8,25 @@
-
-
Notifications
+
+
+
Notifications
- -
+ +
+ +
+ +
- + - See all your notifications + See all your notifications +
diff --git a/client/src/app/menu/avatar-notification.component.scss b/client/src/app/menu/avatar-notification.component.scss index e785db788..201668b6e 100644 --- a/client/src/app/menu/avatar-notification.component.scss +++ b/client/src/app/menu/avatar-notification.component.scss @@ -9,11 +9,27 @@ padding: 0; font-size: 14px; font-family: $main-fonts; - overflow-y: auto; - max-height: 500px; + overflow-y: scroll; width: 400px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.30); + .loader { + display: flex; + align-items: center; + justify-content: center; + + padding: 5px 0; + } + + .content { + max-height: 150px; + transition: max-height 0.15s ease-out; + + &.loaded { + max-height: 500px; + } + } + .notifications-header { display: flex; justify-content: space-between; diff --git a/client/src/app/menu/avatar-notification.component.ts b/client/src/app/menu/avatar-notification.component.ts index 878c5c88c..a77a001ca 100644 --- a/client/src/app/menu/avatar-notification.component.ts +++ b/client/src/app/menu/avatar-notification.component.ts @@ -17,6 +17,7 @@ export class AvatarNotificationComponent implements OnInit, OnDestroy { @Input() user: User unreadNotifications = 0 + loaded = false private notificationSub: Subscription private routeSub: Subscription @@ -54,6 +55,14 @@ export class AvatarNotificationComponent implements OnInit, OnDestroy { this.popover.close() } + onPopoverHidden () { + this.loaded = false + } + + onNotificationLoaded () { + this.loaded = true + } + private async subscribeToNotifications () { const obs = await this.userNotificationSocket.getMyNotificationsSocket() -- cgit v1.2.3