Skip to content

Commit

Permalink
Show waiting animation on upload finished
Browse files Browse the repository at this point in the history
The server response can take some time. We need to show
the user that there is still progress.
  • Loading branch information
tvdeyen authored and sascha-karnatz committed Dec 7, 2023
1 parent 5a43948 commit 193f825
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
4 changes: 1 addition & 3 deletions app/assets/stylesheets/alchemy/_custom-properties.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,5 @@
--file-upload_progress-value-color-failed: var(--color-red_medium);
--file-upload_progress-value-color-invalid: var(--color-red_medium);
--file-upload_progress-value-color-successful: var(--color-green_medium);
--file-upload_progress-value-color-upload-finished: var(
--color-grey-blue_light
);
--file-upload_progress-value-color-upload-finished: var(--color-blue_dark);
}
38 changes: 36 additions & 2 deletions app/assets/stylesheets/alchemy/upload.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,23 @@ alchemy-upload-progress {
background-color: var(--file-upload_progress-bar-color);
border: none;
border-radius: var(--progress-border-radius, var(--border-radius));
height: var(--progress-height, 20px);
height: var(--progress-height, var(--spacing-2));
margin: auto;
width: 100%;

&::-webkit-progress-bar {
background-image: var(--file-upload_progress-bar-background-image);
background-color: var(--file-upload_progress-bar-color);
border-radius: var(--progress-border-radius, var(--border-radius));
}

&::-moz-progress-bar {
background-image: var(--file-upload_progress-bar-background-image);
background-color: var(--file-upload_progress-value-color);
}

&::-webkit-progress-value {
background-image: var(--file-upload_progress-bar-background-image);
background-color: var(--file-upload_progress-value-color);
background-size: 1rem 1rem;
border-radius: var(--progress-border-radius, var(--border-radius));
Expand All @@ -103,7 +106,7 @@ alchemy-upload-progress {
--padding: var(--spacing-2);
--progress-border-radius: var(--border-radius_medium)
var(--border-radius_medium) 0 0;
--progress-height: var(--spacing-3);
--progress-height: var(--spacing-1);

display: grid;
gap: var(--spacing-2);
Expand Down Expand Up @@ -200,4 +203,35 @@ alchemy-upload-progress {
--file-upload_progress-value-color: var(
--file-upload_progress-value-color-upload-finished
);

--file-upload_progress-bar-background-image: linear-gradient(
90deg,
rgba(255, 255, 255, 0.6) 25%,
transparent 25%,
transparent 50%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0.6) 75%,
transparent 75%,
transparent 100%
);

progress::-moz-progress-bar {
background-repeat: repeat;
background-size:
40px 40px,
100% 100%;
animation-name: progress-bar-stripes;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
}

@keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
}

0 comments on commit 193f825

Please sign in to comment.