Skip to content

Commit 627b3fc

Browse files
authored
Merge pull request tsparticles#5893 from tsparticles/v4
Demo fix
2 parents d7c1ef4 + c63b91e commit 627b3fc

2 files changed

Lines changed: 32 additions & 34 deletions

File tree

websites/confetti/src/main.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -801,24 +801,23 @@ const modes = [
801801
fn: function () {
802802
cleanupActiveEffects();
803803

804-
const duration = 6000;
805-
const animationEnd = Date.now() + duration;
806-
807-
const confettiInterval = setInterval(function () {
808-
if (Date.now() >= animationEnd) {
809-
return clearInterval(confettiInterval);
810-
}
804+
const duration = 6000,
805+
animationEnd = Date.now() + duration,
806+
confettiInterval = setInterval(function () {
807+
if (Date.now() >= animationEnd) {
808+
return clearInterval(confettiInterval);
809+
}
811810

812-
confetti({
813-
particleCount: 8,
814-
angle: 90,
815-
spread: 70,
816-
origin: { x: Math.random(), y: 0 },
817-
gravity: 1.2,
818-
ticks: 0,
819-
colors: ['#FFD700', '#FF69B4', '#00CED1', '#FF4500'],
820-
});
821-
}, 50);
811+
confetti({
812+
particleCount: 8,
813+
angle: 90,
814+
spread: 70,
815+
origin: { x: Math.random(), y: 0 },
816+
gravity: 1.2,
817+
ticks: 0,
818+
colors: ['#FFD700', '#FF69B4', '#00CED1', '#FF4500'],
819+
});
820+
}, 50);
822821

823822
activeIntervals.push(confettiInterval);
824823

websites/ribbons/src/main.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -386,24 +386,23 @@ const modes = [
386386
fn: function () {
387387
cleanupActiveEffects();
388388

389-
const duration = 6000;
390-
const animationEnd = Date.now() + duration;
391-
392-
const confettiInterval = setInterval(function () {
393-
if (Date.now() >= animationEnd) {
394-
return clearInterval(confettiInterval);
395-
}
389+
const duration = 6000,
390+
animationEnd = Date.now() + duration,
391+
confettiInterval = setInterval(function () {
392+
if (Date.now() >= animationEnd) {
393+
return clearInterval(confettiInterval);
394+
}
396395

397-
confetti({
398-
particleCount: 8,
399-
angle: 90,
400-
spread: 70,
401-
origin: { x: Math.random(), y: 0 },
402-
gravity: 1.2,
403-
ticks: 200,
404-
colors: ['#FFD700', '#FF69B4', '#00CED1', '#FF4500'],
405-
});
406-
}, 50);
396+
confetti({
397+
particleCount: 8,
398+
angle: 90,
399+
spread: 70,
400+
origin: { x: Math.random(), y: 0 },
401+
gravity: 1.2,
402+
ticks: 0,
403+
colors: ['#FFD700', '#FF69B4', '#00CED1', '#FF4500'],
404+
});
405+
}, 50);
407406

408407
activeIntervals.push(confettiInterval);
409408

0 commit comments

Comments
 (0)