ryuKKu- / angular-particle

Particle.js rewritted for Angular2/4
56 stars 22 forks source link

Default params always applied #2

Open ninesalt opened 7 years ago

ninesalt commented 7 years ago

I'm trying to overwrite the default params object but nothing I try seems to be working. Even when I change the code sample you have in your example, nothing changes.

        this.myParams = {

                    particles: {
                        number: {
                            value: 2,    //changed to 2 instead of 200
                        },

                        color: {
                            value: '#fff000'  //changed color
                        },
                        shape: {
                            type: 'triangle',
                        },
                }
            };
sagarkaurav commented 7 years ago

@Swailem95 try this <particles [params]="myParams" [style]="myStyle" [width]="width" [height]="height"></particles>

asfo commented 6 years ago

I was able to change it to only particles param, if I try to change the interactivity params doesn't works.

this.particleParams = {
      'particles': {
        'number': {
          'value': 100,
        },
        'color': {
          'value': '#FFF'
        },
        'shape': {
          'type': 'circle',
        },
      },
      'interactivity': {
        'onhover': {
          'enable': true,
          'mode': 'bubble'
        }
      }
    };
dawn88set commented 6 years ago

in order to fix this you need to overwrite the position css . try something like this : /deep/.particles-container { position: inherit!important; }

cloudyape commented 6 years ago

@dawn88set , sorry still the same :-(

noahch commented 5 years ago

You need to wrap onhover in events. e.g.

interactivity: {
        events: {
          onhover: {
            enable: false
          }
        }
     }