From b533191bc9372878b8201cf1a670f4366ad325a5 Mon Sep 17 00:00:00 2001 From: Colin McLeod Date: Mon, 10 Aug 2015 10:50:05 -0700 Subject: [PATCH] Adding loader for later use --- app/js/directives/directive-loader.js | 9 +++++++ app/less/app.less | 1 + app/less/loader.less | 37 +++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 app/js/directives/directive-loader.js create mode 100644 app/less/loader.less diff --git a/app/js/directives/directive-loader.js b/app/js/directives/directive-loader.js new file mode 100644 index 00000000..0d9c6ac7 --- /dev/null +++ b/app/js/directives/directive-loader.js @@ -0,0 +1,9 @@ +angular.module('app').directive('loader', ['$rootScope', function($r) { + return { + restrict: 'A', + link: function(scope, element) { + element.addClass('loader'); + element.html(''); + } + }; +}]); diff --git a/app/less/app.less b/app/less/app.less index cb27dbe3..840a8868 100755 --- a/app/less/app.less +++ b/app/less/app.less @@ -19,6 +19,7 @@ @import 'buttons'; @import 'error'; @import 'sortable'; +@import 'loader'; html, body { height: 100%; diff --git a/app/less/loader.less b/app/less/loader.less new file mode 100644 index 00000000..b6fea933 --- /dev/null +++ b/app/less/loader.less @@ -0,0 +1,37 @@ +@keyframes hideshow { + 0% { opacity: 0; } + 10% { opacity: 1; } + 100% { opacity: 0; } +} + +@keyframes inner { + 0% { opacity: 0; } + 10% { opacity: 1; } + 100% { opacity: 0; } +} + +@animationTime: 750ms; +@outerTriangles: 19; +@animationDelay: @animationTime / @outerTriangles; + +.loader { + + path { + stroke: #000; + stroke-width: 0; + opacity: 0; + } +} + +.l1 { animation: hideshow @animationTime linear infinite; } +.l2 { animation: inner @animationTime linear infinite; } + +.mixin-loop (@i) when (@i > 0) { + .d@{i} { + animation-delay: @i * @animationDelay; + } + .mixin-loop(@i - 1); +} + +.mixin-loop(@outerTriangles); +