From f06f872a044a73d942403414aa832e06c50ecabf Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Wed, 26 Jul 2017 19:11:03 +0100 Subject: [PATCH] Added spinner --- src/components/App.vue | 37 ++++++++++++++++++++++++++++ src/components/NavigationBar.vue | 23 +++++++++++------ src/components/common/variables.scss | 3 +++ 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/src/components/App.vue b/src/components/App.vue index 242f2b73..0e5217fe 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -104,4 +104,41 @@ textarea { } } } + +$r: 9px; +$d: $r * 2; +$t: 1500ms; + +.spinner { + width: $d; + height: $d; + display: block; + position: relative; + border: $d/10 solid currentColor; + border-radius: 50%; + + &::before, + &::after { + content: ""; + position: absolute; + display: block; + width: $d/10; + background-color: currentColor; + border-radius: ($d/10)/2; + transform-origin: 50% 0; + } + + &::before { + height: $r - $d/5; + left: $r - $d/10 - $d/20; + top: 50%; + animation: spin $t linear infinite; + } +} + +@keyframes spin { + to { + transform: rotate(360deg); + } +} diff --git a/src/components/NavigationBar.vue b/src/components/NavigationBar.vue index 0eeb8069..e49fab48 100644 --- a/src/components/NavigationBar.vue +++ b/src/components/NavigationBar.vue @@ -1,6 +1,9 @@