Skip to content

Commit 27bc1f2

Browse files
author
Lluis Fons
committed
fix(DIST-454): Fixes spinner animation
1 parent c90646b commit 27bc1f2

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

src/core/views/components/spinner.js

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import 'spin.js/spin.css'
2-
31
import React, { Component } from 'react'
42
import PropTypes from 'prop-types'
53
import { Spinner as Spin } from 'spin.js'
4+
import styled from 'styled-components'
65

76
const defaultConfig = {
87
lines: 16,
@@ -20,6 +19,47 @@ const defaultConfig = {
2019
zIndex: 999
2120
}
2221

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+
2363
class Spinner extends Component {
2464
constructor (props) {
2565
super(props)
@@ -63,7 +103,7 @@ class Spinner extends Component {
63103

64104
render () {
65105
return (
66-
<div ref={this.getRef} />
106+
<SpinnerWrapper ref={this.getRef} />
67107
)
68108
}
69109
}

0 commit comments

Comments
 (0)