Skip to content

Commit 024ce02

Browse files
committed
delay updates
1 parent 078e612 commit 024ce02

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

‎src/components/Animation/Animation.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Animation {
7676
const defaultColor = options.sortedBarColor;
7777

7878
for (let i = 0; i < animation.length; i++) {
79-
await Animation.getAnimation(delay);
79+
await Animation.getAnimation(delay / 10);
8080
const arrayBars = document.querySelectorAll(".array-bars");
8181
if (i % 3 !== 2) {
8282
// SG 07/10/2022 16:52 animate colors

‎src/components/Strategy/Algorithms/RadixSortLSD.js‎

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,9 @@ class RadixSortLSD {
4141
// SG 07/11/2022 09:37 animating iterator
4242
counts[Math.floor(array[i] / exp) % 100]++;
4343
if (!options.skipJ) {
44-
if (DOM.length > 1000) {
45-
// for more than 1000 bars, only animate in every 3 bars
46-
if (i % 3 === 0) {
47-
await Animation.getAnimation(DELAY + 2);
48-
DOM[i].style.backgroundColor = PROCESSING_COLOR;
49-
await Animation.getAnimation(DELAY + 2);
50-
DOM[i].style.backgroundColor = DEAULT_COLOR;
51-
}
52-
} else {
53-
await Animation.getAnimation(DELAY);
54-
DOM[i].style.backgroundColor = PROCESSING_COLOR;
55-
await Animation.getAnimation(DELAY);
56-
DOM[i].style.backgroundColor = DEAULT_COLOR;
57-
}
44+
DOM[i].style.backgroundColor = PROCESSING_COLOR;
45+
await Animation.getAnimation(DELAY / 100);
46+
DOM[i].style.backgroundColor = DEAULT_COLOR;
5847
}
5948
}
6049

0 commit comments

Comments
 (0)