@widelab-nc/widehue 1.0.41 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/index.js +9 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1451,15 +1451,21 @@ window.animationTest4 = function(root) {
|
|
|
1451
1451
|
|
|
1452
1452
|
videoTimeline = gsap.timeline();
|
|
1453
1453
|
|
|
1454
|
-
|
|
1454
|
+
// Stwórz tablicę indeksów i wymieszaj ją
|
|
1455
|
+
const videoIndexes = Array.from({length: videos.length}, (_, i) => i);
|
|
1456
|
+
const shuffledIndexes = videoIndexes.sort(() => Math.random() - 0.5);
|
|
1457
|
+
|
|
1458
|
+
shuffledIndexes.forEach((videoIndex, timeIndex) => {
|
|
1459
|
+
const video = videos[videoIndex];
|
|
1460
|
+
|
|
1455
1461
|
videoTimeline.add(() => {
|
|
1456
1462
|
placeElementAtRandomVisiblePosition(video, mask);
|
|
1457
|
-
},
|
|
1463
|
+
}, timeIndex * 0.75);
|
|
1458
1464
|
|
|
1459
1465
|
videoTimeline.to(video, {
|
|
1460
1466
|
display: 'block',
|
|
1461
1467
|
duration: 0
|
|
1462
|
-
},
|
|
1468
|
+
}, timeIndex * 0.75);
|
|
1463
1469
|
});
|
|
1464
1470
|
|
|
1465
1471
|
videoTimeline.play();
|