Browse Source

Fixes spinners & centers loading message

main
Eric Amodio 2 years ago
parent
commit
1057278647
3 changed files with 57 additions and 22 deletions
  1. +3
    -3
      src/webviews/apps/plus/graph/GraphWrapper.tsx
  2. +19
    -19
      src/webviews/apps/plus/graph/graph.scss
  3. +35
    -0
      src/webviews/apps/shared/codicons.scss

+ 3
- 3
src/webviews/apps/plus/graph/GraphWrapper.tsx View File

@ -322,11 +322,11 @@ export function GraphWrapper({
</div>
</div>
{graphList.length > 0 && (
<span>
{graphList.length} commit{graphList.length ? 's' : ''}
<span className="actionbar__details">
{graphList.length} item{graphList.length ? 's' : ''}
</span>
)}
{isLoading && <span className="icon--loading" />}
{isLoading && <span className="actionbar__loading icon--loading icon-modifier--spin" />}
</div>
<div className="actionbar__group">
<a

+ 19
- 19
src/webviews/apps/plus/graph/graph.scss View File

@ -47,6 +47,15 @@ a {
}
}
&__details {}
&__loading {
position: relative;
top: 1px;
left: 0.5rem;
font-size: 1.2rem;
}
a {
color: inherit;
}
@ -232,22 +241,6 @@ a {
}
}
.icon--loading {
&::before {
// codicon-loading
font-family: codicon;
content: '\eb19';
}
transform-origin: 50% 42%;
animation: spin .7s steps(30) infinite;
@keyframes spin {
100% {
transform: rotate(360deg);
}
}
}
.icon--warning {
:before {
// codicon-vm
@ -382,8 +375,15 @@ a {
& .resizable-handle.horizontal {
display: none;
}
}
.graph-container .node.stash-node .graph-icon {
transform: translateY(-2px);
& .node.stash-node .graph-icon {
transform: translateY(-2px);
}
& .graph-adjust-commit-count {
display: flex;
width: 100vw;
align-items: center;
justify-content: center;
}
}

+ 35
- 0
src/webviews/apps/shared/codicons.scss View File

@ -1,3 +1,38 @@
@keyframes codicon-spin {
100% {
transform: rotate(360deg);
}
}
.icon--sync.icon-modifier--spin,
.icon--loading.icon-modifier--spin,
.icon--gear.icon-modifier--spin {
/* Use steps to throttle FPS to reduce CPU usage */
animation: codicon-spin 1.5s steps(30) infinite;
}
.icon-modifier--disabled {
opacity: 0.5;
}
.icon-modifier--hidden {
opacity: 0;
}
.icon--loading {
/* Use steps to throttle FPS to reduce CPU usage */
animation: codicon-spin 1.5s steps(30) infinite;
/* custom speed & easing for loading icon */
animation-duration: 1s !important;
animation-timing-function: cubic-bezier(0.53, 0.21, 0.29, 0.67) !important;
&::before {
content: '\eb19';
font-family: codicon;
}
}
.icon--branch {
&::before {
content: '\ea68';

Loading…
Cancel
Save