Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading indicator till app inits #3788

Merged
merged 3 commits into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/app/assets/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
@import 'redash/redash-table';
@import 'redash/query';
@import 'redash/tags-control';
@import 'redash/css-logo';



88 changes: 88 additions & 0 deletions client/app/assets/less/redash/css-logo.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// based on https://github.com/outbrain/tech-companies-logos-in-css/pull/28

@primary: #ff7964;
@shadow: #ef6c58;
@bar: white;

#css-logo {
width: 100px;
height: 100px;
position: relative;

#circle {
width: 79px;
height: 79px;
background-color: @shadow;
border-radius: 50%;
margin: auto;
overflow: hidden;
position: relative;

& > div {
width: 79px;
height: 73px;
background-color: @primary;
border-radius: 50%;
position: absolute;
top: 0;
}
}

#bars {
position: absolute;
left: 0;
top: 24px;
right: 0;
height: 33px;
display: flex;
padding: 0 22px 0;

.bar {
background: @bar;
box-shadow: 0px 2px 0 0 @shadow;
display: inline-block;
border-radius: 1px;
align-self: flex-end;
flex: 1;
margin: 0 2px;
border-radius: 3px;

&:nth-child(1) {
height: 32%;
}

&:nth-child(2) {
height: 71%;
}

&:nth-child(3) {
height: 50%;
}

&:nth-child(4) {
height: 100%;
}
}
}

#point,
#point > div {
position: absolute;
width: 0;
height: 0;
border: 17px solid @shadow;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
bottom: 0;
left: 48px;
transform: scaleX(0.87);
transform-origin: left;
}

#point > div {
bottom: -12px;
border-color: @primary;
transform: scaleX(1.04);
left: -17px;
}
}
52 changes: 52 additions & 0 deletions client/app/assets/less/redash/redash-newstyle.less
Original file line number Diff line number Diff line change
Expand Up @@ -940,4 +940,56 @@ text.slicetext {

.markdown img {
max-width: 100%;
}

.loading-indicator {
position: fixed;
top: 50%;
left: 50%;
margin: -50px 0 0 -50px; // center
width: 100px;
height: 100px;
transition-duration: 150ms;
transition-timing-function: linear;
transition-property: opacity, transform;

#css-logo {
animation: hover 2s infinite;
}

#shadow {
width: 33px;
height: 12px;
border-radius: 50%;
background-color: black;
opacity: 0.25;
display: block;
position: absolute;
left: 34px;
top: 115px;
animation: shadow 2s infinite;
}

@keyframes hover {
50% {
transform: translateY(-5px);
}
}
@keyframes shadow {
50% {
transform: scaleX(0.9);
opacity: 0.2;
}
}
}

// hide indicator when app-view has content
app-view:not(:empty) ~ .loading-indicator {
opacity: 0;
transform: scale(0.9);
pointer-events: none;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary but it helps me sleep at night.
Better make sure transparent elements are absolutely non-interactable.


* {
animation: none !important;
}
}
17 changes: 17 additions & 0 deletions client/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@
<body ng-class="bodyClass">
<section>
<app-view></app-view>
<div class="loading-indicator">
<div id="css-logo">
<div id="circle">
<div></div>
</div>
<div id="point">
<div></div>
</div>
<div id="bars">
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
</div>
</div>
<div id="shadow"></div>
</div>
</section>
</body>
</html>
17 changes: 17 additions & 0 deletions client/app/multi_org.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@
<body ng-class="bodyClass">
<section>
<app-view></app-view>
<div class="loading-indicator">
<div id="css-logo">
<div id="circle">
<div></div>
</div>
<div id="point">
<div></div>
</div>
<div id="bars">
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
</div>
</div>
<div id="shadow"></div>
</div>
</section>
</body>
</html>