From c893d4514e6ecbf282c7985fe5f82b8acd8a1137 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Dec 2017 14:57:46 +0100 Subject: Add beautiful loading bar --- client/src/app/app.component.html | 1 + client/src/app/shared/shared.module.ts | 5 ++ client/src/sass/application.scss | 4 +- client/src/sass/loading-bar.scss | 93 ++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 client/src/sass/loading-bar.scss (limited to 'client/src') diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html index da4273dda..1a808b397 100644 --- a/client/src/app/app.component.html +++ b/client/src/app/app.component.html @@ -34,5 +34,6 @@ + diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts index d0e163f69..5af118c98 100644 --- a/client/src/app/shared/shared.module.ts +++ b/client/src/app/shared/shared.module.ts @@ -3,6 +3,7 @@ import { HttpClientModule } from '@angular/common/http' import { NgModule } from '@angular/core' import { FormsModule, ReactiveFormsModule } from '@angular/forms' import { RouterModule } from '@angular/router' +import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client' import { BsDropdownModule } from 'ngx-bootstrap/dropdown' import { ModalModule } from 'ngx-bootstrap/modal' @@ -33,6 +34,8 @@ import { VideoService } from './video/video.service' RouterModule, HttpClientModule, + LoadingBarHttpClientModule, + BsDropdownModule.forRoot(), ModalModule.forRoot(), @@ -59,6 +62,8 @@ import { VideoService } from './video/video.service' RouterModule, HttpClientModule, + LoadingBarHttpClientModule, + BsDropdownModule, ModalModule, DataTableModule, diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss index 08131406a..968dc5f58 100644 --- a/client/src/sass/application.scss +++ b/client/src/sass/application.scss @@ -10,7 +10,9 @@ $FontPathSourceSansPro: '../../node_modules/npm-font-source-sans-pro/fonts'; @import '~primeng/resources/themes/bootstrap/theme.css'; @import '~primeng/resources/primeng.css'; @import '~video.js/dist/video-js.css'; -@import './video-js-custom.scss'; + +@import './video-js-custom'; +@import './loading-bar'; [hidden] { display: none !important; diff --git a/client/src/sass/loading-bar.scss b/client/src/sass/loading-bar.scss new file mode 100644 index 000000000..d34bf83ee --- /dev/null +++ b/client/src/sass/loading-bar.scss @@ -0,0 +1,93 @@ +// Thanks: https://github.com/aitboudad/ngx-loading-bar/blob/master/loading-bar.css + +/* Make clicks pass-through */ +#loading-bar, +#loading-bar-spinner { + pointer-events: none; + -webkit-pointer-events: none; + -webkit-transition: 350ms linear all; + -moz-transition: 350ms linear all; + -o-transition: 350ms linear all; + transition: 350ms linear all; + color: #29d; +} + +#loading-bar .bar { + -webkit-transition: width 350ms; + -moz-transition: width 350ms; + -o-transition: width 350ms; + transition: width 350ms; + + background: #29d; + position: fixed; + z-index: 10002; + top: 0; + left: 0; + width: 100%; + height: 2px; + border-bottom-right-radius: 1px; + border-top-right-radius: 1px; +} + +/* Fancy blur effect */ +#loading-bar .peg { + position: absolute; + width: 70px; + right: 0; + top: 0; + height: 2px; + opacity: .45; + -moz-box-shadow: 1px 0 6px 1px; + -ms-box-shadow: 1px 0 6px 1px; + -webkit-box-shadow: 1px 0 6px 1px; + box-shadow: 1px 0 6px 1px; + color: inherit; + -moz-border-radius: 100%; + -webkit-border-radius: 100%; + border-radius: 100%; +} + +#loading-bar-spinner { + display: block; + position: fixed; + z-index: 10002; + top: 10px; + left: 10px; +} + +#loading-bar-spinner .spinner-icon { + width: 14px; + height: 14px; + + border: solid 2px transparent; + border-top-color: inherit; + border-left-color: inherit; + border-radius: 50%; + + -webkit-animation: loading-bar-spinner 400ms linear infinite; + -moz-animation: loading-bar-spinner 400ms linear infinite; + -ms-animation: loading-bar-spinner 400ms linear infinite; + -o-animation: loading-bar-spinner 400ms linear infinite; + animation: loading-bar-spinner 400ms linear infinite; +} + +@-webkit-keyframes loading-bar-spinner { + 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } +} +@-moz-keyframes loading-bar-spinner { + 0% { -moz-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -moz-transform: rotate(360deg); transform: rotate(360deg); } +} +@-o-keyframes loading-bar-spinner { + 0% { -o-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -o-transform: rotate(360deg); transform: rotate(360deg); } +} +@-ms-keyframes loading-bar-spinner { + 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } +} +@keyframes loading-bar-spinner { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} -- cgit v1.2.3