Skip to content

Commit a027b35

Browse files
author
bates
committed
Top Bar Loading Add
1 parent a4635ce commit a027b35

File tree

9 files changed

+327
-191
lines changed

9 files changed

+327
-191
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ packages/react-devtools-extensions/firefox/*.xpi
3232
packages/react-devtools-extensions/firefox/*.pem
3333
packages/react-devtools-extensions/shared/build
3434
packages/react-devtools-inline/dist
35-
packages/react-devtools-shell/dist
35+
packages/react-devtools-shell/dist
36+
37+
package-lock.json

demo/package-lock.json

Lines changed: 30 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/src/App.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class App extends Component {
1818
Loading();
1919
setTimeout(() => { Loading() }, 3000);
2020
}
21+
TopbarLoading() {
22+
Loading({ topBar: true });
23+
setTimeout(() => { Loading() }, 3000);
24+
}
2125
LoadingProgress() {
2226

2327
Loading({
@@ -52,6 +56,7 @@ class App extends Component {
5256
<h5 className="mb-3">React Loaing Component</h5>
5357
<div>
5458
<button type="button" className="btn btn-sm btn-dark mr-4" onClick={(e) => this.DefaultLoading()}>Show Loading</button>
59+
<button type="button" className="btn btn-sm btn-dark mr-4" onClick={(e) => this.TopbarLoading()}>Show Top Bar Loading</button>
5560
<button type="button" className="btn btn-sm btn-dark" onClick={(e) => this.LoadingProgress()}>Show Progress</button> <br />
5661
<button type="button" className="btn btn-sm btn-light" onClick={(e) => {
5762
SetDefault({ theme: this.state.theme });

index.css

Lines changed: 75 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,106 @@
11
div.loading-ui-overlay {
2-
position: fixed;
3-
left: 0;
4-
top: 0;
5-
bottom: 0;
6-
right: 0;
7-
background-color: RGBA(255, 255, 255, 0.5);
8-
z-index: 999999;
2+
position: fixed;
3+
left: 0;
4+
top: 0;
5+
bottom: 0;
6+
right: 0;
7+
background-color: RGBA(255, 255, 255, 0.5);
8+
z-index: 999999;
99
}
1010

1111
div.loading-ui-overlay div.loading-ui-wrapper {
12-
position: relative;
13-
margin: 15% auto;
14-
max-width: 30rem;
12+
position: relative;
13+
margin: 15% auto;
14+
max-width: 30rem;
1515
}
1616

1717
div.loading-ui-overlay div.loading-ui-wrapper div.loading-ui-body {
18-
position: relative;
19-
display: -ms-flexbox;
20-
display: flex;
21-
-ms-flex-direction: column;
22-
flex-direction: column;
23-
min-width: 0;
24-
word-wrap: break-word;
25-
background-color: #fff;
26-
background-clip: border-box;
27-
border-radius: .25rem;
28-
text-align: center;
29-
padding: 1.25rem;
30-
border: none;
31-
-webkit-box-shadow: 0px 0px 13px 0px rgba(236, 236, 241, 0.44);
32-
box-shadow: 0px 0px 13px 0px rgba(236, 236, 241, 0.44);
33-
margin-bottom: 30px;
34-
color: #5b626b;
35-
padding: 1.25rem;
18+
position: relative;
19+
display: -ms-flexbox;
20+
display: flex;
21+
-ms-flex-direction: column;
22+
flex-direction: column;
23+
min-width: 0;
24+
word-wrap: break-word;
25+
background-color: #fff;
26+
background-clip: border-box;
27+
border-radius: .25rem;
28+
text-align: center;
29+
padding: 1.25rem;
30+
border: none;
31+
-webkit-box-shadow: 0px 0px 13px 0px rgba(236, 236, 241, 0.44);
32+
box-shadow: 0px 0px 13px 0px rgba(236, 236, 241, 0.44);
33+
margin-bottom: 30px;
34+
color: #5b626b;
35+
padding: 1.25rem;
3636
}
3737

3838
div.loading-ui-overlay div.loading-ui-wrapper div.loading-ui-body h4.loading-ui-title {
39-
font-size: 16px;
40-
margin: 10px 0;
41-
margin-bottom: .75rem;
42-
line-height: 1.2;
39+
font-size: 16px;
40+
margin: 10px 0;
41+
margin-bottom: .75rem;
42+
line-height: 1.2;
4343
}
4444

4545
div.loading-ui-overlay div.loading-ui-wrapper div.loading-ui-body p.loading-ui-text {
46-
font-size: 14px;
46+
font-size: 14px;
4747
}
4848

4949
div.loading-ui-overlay div.loading-ui-wrapper div.loading-ui-body div.loading-ui-spinner {
50-
display: inline-block;
51-
width: 2rem;
52-
height: 2rem;
53-
vertical-align: text-bottom;
54-
border: .25em solid currentColor;
55-
border-right-color: transparent;
56-
border-radius: 50%;
57-
-webkit-animation: spinner-border .75s linear infinite;
58-
animation: spinner-border .75s linear infinite;
59-
color: #38a4f8 !important;
60-
margin: 0 auto;
50+
display: inline-block;
51+
width: 2rem;
52+
height: 2rem;
53+
vertical-align: text-bottom;
54+
border: .25em solid currentColor;
55+
border-right-color: transparent;
56+
border-radius: 50%;
57+
-webkit-animation: spinner-border .75s linear infinite;
58+
animation: spinner-border .75s linear infinite;
59+
color: #38a4f8 !important;
60+
margin: 0 auto;
6161
}
6262

6363
div.loading-ui-overlay div.loading-ui-wrapper div.loading-ui-body div.loading-ui-progress {
64-
background-color: #e9ecef;
65-
height: 1rem;
66-
width: 18rem;
67-
margin: 0 auto;
68-
border-radius: 3px;
69-
overflow: hidden;
64+
background-color: #e9ecef;
65+
height: 1rem;
66+
width: 18rem;
67+
margin: 0 auto;
68+
border-radius: 3px;
69+
overflow: hidden;
7070
}
7171

7272
div.loading-ui-overlay div.loading-ui-wrapper div.loading-ui-body div.loading-ui-progress div.loading-ui-progress-bar {
73-
height: 100%;
74-
background-color: #38a4f8;
75-
transition: width .1s ease;
73+
height: 100%;
74+
background-color: #38a4f8;
75+
transition: width .1s ease;
7676
}
7777

7878
/* loading-ui light theme */
7979

8080
div.loading-ui-overlay.dark {
81-
background-color: RGBA(0, 0, 0, 0.5);
81+
background-color: RGBA(0, 0, 0, 0.5);
8282
}
8383

8484
div.loading-ui-overlay.dark div.loading-ui-wrapper div.loading-ui-body {
85-
background-color: #5b626b;
86-
color: #fff;
87-
box-shadow: 0px 0px 13px 0px rgba(117, 117, 117, 0.44);
85+
background-color: #5b626b;
86+
color: #fff;
87+
box-shadow: 0px 0px 13px 0px rgba(117, 117, 117, 0.44);
88+
}
89+
90+
/* topbar */
91+
92+
div.loading-ui-overlay.topbar {
93+
background-color: transparent !important;
94+
}
95+
96+
div.loading-ui-overlay .loading-ui-topbar {
97+
top: 0;
98+
left: 0;
99+
height: 5px;
100+
position: fixed;
101+
z-index: 666000666;
102+
-webkit-transition:width 500ms ease-out, height 500ms ease-out;
103+
-moz-transition:width 500ms ease-out, height 500ms ease-out;
104+
-o-transition:width 500ms ease-out, height 500ms ease-out;
105+
transition:width 500ms ease-out, height 500ms ease-out;
88106
}

0 commit comments

Comments
 (0)