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 --- client/src/app/shared/misc/loader.component.html | 9 ++++- client/src/app/shared/misc/loader.component.scss | 45 ++++++++++++++++++++++ client/src/app/shared/misc/loader.component.ts | 3 +- .../app/shared/misc/small-loader.component.html | 3 ++ .../src/app/shared/misc/small-loader.component.ts | 11 ++++++ 5 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 client/src/app/shared/misc/loader.component.scss create mode 100644 client/src/app/shared/misc/small-loader.component.html create mode 100644 client/src/app/shared/misc/small-loader.component.ts (limited to 'client/src/app/shared/misc') diff --git a/client/src/app/shared/misc/loader.component.html b/client/src/app/shared/misc/loader.component.html index 38d06950e..b8b7ad343 100644 --- a/client/src/app/shared/misc/loader.component.html +++ b/client/src/app/shared/misc/loader.component.html @@ -1,3 +1,8 @@ -
-
+
+
+
+
+
+
+
diff --git a/client/src/app/shared/misc/loader.component.scss b/client/src/app/shared/misc/loader.component.scss new file mode 100644 index 000000000..ddb64f07a --- /dev/null +++ b/client/src/app/shared/misc/loader.component.scss @@ -0,0 +1,45 @@ +@import '_variables'; +@import '_mixins'; + +// Thanks to https://loading.io/css/ (CC0 License) + +.lds-ring { + display: inline-block; + position: relative; + width: 50px; + height: 50px; +} + +.lds-ring div { + box-sizing: border-box; + display: block; + position: absolute; + width: 44px; + height: 44px; + margin: 6px; + border: 4px solid; + border-radius: 50%; + animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; + border-color: #999999 transparent transparent transparent; +} + +.lds-ring div:nth-child(1) { + animation-delay: -0.45s; +} + +.lds-ring div:nth-child(2) { + animation-delay: -0.3s; +} + +.lds-ring div:nth-child(3) { + animation-delay: -0.15s; +} + +@keyframes lds-ring { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} diff --git a/client/src/app/shared/misc/loader.component.ts b/client/src/app/shared/misc/loader.component.ts index f37d70c85..e3b1eea3a 100644 --- a/client/src/app/shared/misc/loader.component.ts +++ b/client/src/app/shared/misc/loader.component.ts @@ -2,10 +2,9 @@ import { Component, Input } from '@angular/core' @Component({ selector: 'my-loader', - styleUrls: [ ], + styleUrls: [ './loader.component.scss' ], templateUrl: './loader.component.html' }) - export class LoaderComponent { @Input() loading: boolean } diff --git a/client/src/app/shared/misc/small-loader.component.html b/client/src/app/shared/misc/small-loader.component.html new file mode 100644 index 000000000..5a7cea738 --- /dev/null +++ b/client/src/app/shared/misc/small-loader.component.html @@ -0,0 +1,3 @@ +
+
+
diff --git a/client/src/app/shared/misc/small-loader.component.ts b/client/src/app/shared/misc/small-loader.component.ts new file mode 100644 index 000000000..191877f14 --- /dev/null +++ b/client/src/app/shared/misc/small-loader.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core' + +@Component({ + selector: 'my-small-loader', + styleUrls: [ ], + templateUrl: './small-loader.component.html' +}) + +export class SmallLoaderComponent { + @Input() loading: boolean +} -- cgit v1.2.3