Skip to content

Commit 8f41938

Browse files
authored
Add preloader animation and removed react-preloaders (#63)
* Added preloader animation and removed Sugar Component * Removed react-preloader from package.json
1 parent 4df1870 commit 8f41938

File tree

3 files changed

+134
-5
lines changed

3 files changed

+134
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
"react-monaco-editor": "^0.22.0",
162162
"react-paginate": "^6.2.1",
163163
"react-player": "^1.15.2",
164-
"react-preloaders": "^3.0.3",
165164
"react-redux": "^5.0.7",
166165
"react-router": "4.3.1",
167166
"react-router-dom": "^5.1.2",
@@ -176,6 +175,7 @@
176175
"redux-saga": "^0.16.2",
177176
"socket.io-client": "^2.2.0",
178177
"sockjs-client": "^1.4.0",
178+
"styled-components": "^5.2.1",
179179
"zlib": "^1.0.5"
180180
}
181181
}

src/app/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ import { initializeRendererAssets } from 'code-character-renderer-20';
1111
import * as React from 'react';
1212
import { hot } from 'react-hot-loader';
1313
// @ts-ignore
14-
import { Sugar } from 'react-preloaders';
1514
import { HashRouter, Route, Switch } from 'react-router-dom';
1615

1716
initializeRendererAssets();
1817

1918
/* tslint:disable-next-line:variable-name */
2019
export const App = hot(module)(() => (
2120
<HashRouter>
22-
<Sugar background="#484848" color="white" />
2321
<Switch>
2422
<Route exact path={Routes.ROOT} component={Dashboard} />
2523
<Route exact path={Routes.LOGIN} component={Login} />

src/assets/index.html

Lines changed: 133 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,140 @@
99
href="https://fonts.googleapis.com/css?family=Bebas+Neue|Lato&display=swap"
1010
rel="stylesheet"
1111
/>
12-
<title>Code Character</title>
12+
<style>
13+
#preloader-container {
14+
position: fixed;
15+
top: 0;
16+
left: 0;
17+
height: 100%;
18+
width: 100%;
19+
z-index: 100000;
20+
background-color: #fff;
21+
transition: opacity 1s;
22+
}
23+
.container {
24+
position: absolute;
25+
width: 200px;
26+
height: 200px;
27+
top: 0;
28+
bottom: 0;
29+
left: 0;
30+
right: 0;
31+
margin: auto;
32+
}
33+
34+
.item {
35+
width: 100px;
36+
height: 100px;
37+
position: absolute;
38+
}
39+
40+
.item-1 {
41+
background-color: #fa5667;
42+
top: 0;
43+
left: 0;
44+
z-index: 1;
45+
animation: item-1_move 3s cubic-bezier(0.6, 0.01, 0.4, 1) infinite;
46+
}
47+
48+
.item-2 {
49+
background-color: #7a45e5;
50+
top: 0;
51+
right: 0;
52+
animation: item-2_move 3s cubic-bezier(0.6, 0.01, 0.4, 1) infinite;
53+
}
54+
55+
.item-3 {
56+
background-color: #1b91f7;
57+
bottom: 0;
58+
right: 0;
59+
z-index: 1;
60+
animation: item-3_move 3s cubic-bezier(0.6, 0.01, 0.4, 1) infinite;
61+
}
62+
63+
.item-4 {
64+
background-color: #fac24c;
65+
bottom: 0;
66+
left: 0;
67+
animation: item-4_move 3s cubic-bezier(0.6, 0.01, 0.4, 1) infinite;
68+
}
69+
70+
@keyframes item-1_move {
71+
0%,
72+
100% {
73+
transform: translate(0, 0);
74+
}
75+
25% {
76+
transform: translate(0, 100px);
77+
}
78+
50% {
79+
transform: translate(100px, 100px);
80+
}
81+
75% {
82+
transform: translate(100px, 0);
83+
}
84+
}
85+
86+
@keyframes item-2_move {
87+
0%,
88+
100% {
89+
transform: translate(0, 0);
90+
}
91+
25% {
92+
transform: translate(-100px, 0);
93+
}
94+
50% {
95+
transform: translate(-100px, 100px);
96+
}
97+
75% {
98+
transform: translate(0, 100px);
99+
}
100+
}
101+
102+
@keyframes item-3_move {
103+
0%,
104+
100% {
105+
transform: translate(0, 0);
106+
}
107+
25% {
108+
transform: translate(0, -100px);
109+
}
110+
50% {
111+
transform: translate(-100px, -100px);
112+
}
113+
75% {
114+
transform: translate(-100px, 0);
115+
}
116+
}
117+
118+
@keyframes item-4_move {
119+
0%,
120+
100% {
121+
transform: translate(0, 0);
122+
}
123+
25% {
124+
transform: translate(100px, 0);
125+
}
126+
50% {
127+
transform: translate(100px, -100px);
128+
}
129+
75% {
130+
transform: translate(0, -100px);
131+
}
132+
}
133+
</style>
134+
<title>code character</title>
13135
</head>
14136
<body>
15-
<div id="root"></div>
137+
<div id="root">
138+
<div id="preloader-container">
139+
<div class="container">
140+
<div class="item item-1"></div>
141+
<div class="item item-2"></div>
142+
<div class="item item-3"></div>
143+
<div class="item item-4"></div>
144+
</div>
145+
</div>
146+
</div>
16147
</body>
17148
</html>

0 commit comments

Comments
 (0)