Skip to content

Commit

Permalink
fix: fixes #831
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobruni committed Sep 19, 2020
1 parent 31f4762 commit 3d17b4a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
Expand Up @@ -8,7 +8,7 @@ export class OpacityRandom implements IOpacityRandom, IOptionLoader<IOpacityRand

constructor() {
this.enable = false;
this.minimumValue = 1;
this.minimumValue = 0.1;
}

public load(data?: RecursivePartial<IOpacityRandom> | undefined): void {
Expand Down
2 changes: 1 addition & 1 deletion core/main/tests/Options.ts
Expand Up @@ -119,7 +119,7 @@ describe("Options tests", () => {
expect(options.particles.opacity.animation.speed).to.equal(2);
expect(options.particles.opacity.animation.sync).to.be.false;
expect(options.particles.opacity.random).to.be.an("object").to.have.property("enable").to.be.false;
expect(options.particles.opacity.random).to.be.an("object").to.have.property("minimumValue").to.equal(1);
expect(options.particles.opacity.random).to.be.an("object").to.have.property("minimumValue").to.equal(0.1);
expect(options.particles.opacity.value).to.equal(1);

/* particles rotate */
Expand Down
37 changes: 19 additions & 18 deletions demo/main/public/presets/test.json
@@ -1,10 +1,9 @@
{
"fpsLimit": 60,
"particles": {
"number": {
"value": 100,
"value": 150,
"density": {
"enable": false,
"enable": true,
"value_area": 800
}
},
Expand All @@ -21,23 +20,23 @@
"nb_sides": 5
},
"image": {
"src": "https://cdn.matteobruni.it/images/particles/github.svg",
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"random": true,
"anim": {
"enable": false,
"speed": 1,
"speed": 0.15,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 4,
"value": 3,
"random": true,
"anim": {
"enable": false,
Expand All @@ -47,19 +46,19 @@
}
},
"line_linked": {
"enable": false,
"enable": true,
"distance": 150,
"color": "#ffffff",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"enable": false,
"speed": 2,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "bounce",
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
Expand All @@ -69,21 +68,21 @@
}
},
"interactivity": {
"detect_on": "canvas",
"detect_on": "window",
"events": {
"onhover": {
"enable": false,
"mode": "grab"
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "repulse"
"enable": false,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 200,
"distance": 400,
"line_linked": {
"opacity": 1
}
Expand All @@ -92,10 +91,12 @@
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200
"distance": 120,
"duration": 0.4
},
"push": {
"particles_nb": 4
Expand All @@ -113,4 +114,4 @@
"repeat": "no-repeat",
"size": "cover"
}
}
}

0 comments on commit 3d17b4a

Please sign in to comment.