File tree Expand file tree Collapse file tree 1 file changed +43
-3
lines changed
src/core/views/components Expand file tree Collapse file tree 1 file changed +43
-3
lines changed Original file line number Diff line number Diff line change 1
- import 'spin.js/spin.css'
2
-
3
1
import React , { Component } from 'react'
4
2
import PropTypes from 'prop-types'
5
3
import { Spinner as Spin } from 'spin.js'
4
+ import styled from 'styled-components'
6
5
7
6
const defaultConfig = {
8
7
lines : 16 ,
@@ -20,6 +19,47 @@ const defaultConfig = {
20
19
zIndex : 999
21
20
}
22
21
22
+ const SpinnerWrapper = styled . div `
23
+ @keyframes spinner-line-fade-more {
24
+ 0%, 100% {
25
+ opacity: 0; /* minimum opacity */
26
+ }
27
+ 1% {
28
+ opacity: 1;
29
+ }
30
+ }
31
+
32
+ @keyframes spinner-line-fade-quick {
33
+ 0%, 39%, 100% {
34
+ opacity: 0.25; /* minimum opacity */
35
+ }
36
+ 40% {
37
+ opacity: 1;
38
+ }
39
+ }
40
+
41
+ @keyframes spinner-line-fade-default {
42
+ 0%, 100% {
43
+ opacity: 0.22; /* minimum opacity */
44
+ }
45
+ 1% {
46
+ opacity: 1;
47
+ }
48
+ }
49
+
50
+ @keyframes spinner-line-shrink {
51
+ 0%, 25%, 100% {
52
+ /* minimum scale and opacity */
53
+ transform: scale(0.5);
54
+ opacity: 0.25;
55
+ }
56
+ 26% {
57
+ transform: scale(1);
58
+ opacity: 1;
59
+ }
60
+ }
61
+ `
62
+
23
63
class Spinner extends Component {
24
64
constructor ( props ) {
25
65
super ( props )
@@ -63,7 +103,7 @@ class Spinner extends Component {
63
103
64
104
render ( ) {
65
105
return (
66
- < div ref = { this . getRef } />
106
+ < SpinnerWrapper ref = { this . getRef } />
67
107
)
68
108
}
69
109
}
You can’t perform that action at this time.
0 commit comments