Giter Club home page Giter Club logo

particles.js's People

Contributors

arturszott avatar aweary avatar csu avatar dipree avatar icodeforlove avatar jzjzjzj avatar kkirsche avatar levchurakov avatar pborreli avatar victorbstan avatar vincentgarreau avatar xavhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

particles.js's Issues

Mouse Interaction Offset on Smaller Canvas

Hello,

Firstly let me apologise - I don't have any experience using Canvas and am still getting to grips with it so sorry if this is a very obvious question.

I'm trying to use the particle animation within a div that is part of the sidebar to my website however it seems when doing so the mouse interaction is not as accurate. I've narrowed down the issue and found it's due to the fact that there is a div on top of the div containing particle-js - if I remove the top div the mouse interaction is accurate but it seems with it still in the canvas is offsetting the interaction animation by the height of the top div.

Site URL - http://www.nrly.co

I was hoping you might be able to give me some guidance on this issue?

Many, many thanks in advance!

Opacity of interactive lines

Absolutely love, love, love this plugin. One feature request would be to add an option to control the opacity of the interactive lines. I've knocked back the opacity on everything else, so the interactive lines are way to bright whenever I move my mouse.

Great work and thank you.

Responsiveness

It's not responsive. What are the options to make it responsive?

Load JSON file IE9

I received an error in IE9: "invalid character".
The library currently loads the JSON file as follows:

var params = JSON.parse(data.currentTarget.response); 

IE9 doesn't have this property on the currentTarget object.
I fixed the problem using responseText instead, which solved the problem for IE9:

var params = JSON.parse(data.currentTarget.responseText); 

How to destroy a pJS object?

In IE, it will continue to call raf even after the DOM destroyed. Is there any way to manually destroy a pJS object?

Stopping the Animation from javascript

Hi,
Is there any chance to stop the animation using javascript, after it started running?
I tried to find the Code inside your Examples GUI, but was unable to find how you disable the animation afterwards..

Lags on Firefox

Hello!
in chrome it works well, but ofcourse it lags in FireFox, very slow, and lags.

Can't upload Background Image

Hey!

Everything is working perfectly, and it's a very nice job. Thank you!

But I have an issue, I can't add no bg image... I can change the bg collor, but every image I add, it simply won't load, keeping the bg collor only.

Probably I'm doing something wrong...

Can you guys help me, please?

Thank you again!

Modularization

It would be better for developers who wants to contribute if the script was modularized, just a suggestion :)

Changing the size and color of each shape

Maybe it could be added?
this is the options that I would provide:

  • increase/decrease (size)
    • active / inactive
    • for each particle differently
    • for all particles the same:
      • increase
      • decrease
      • random (increase || decrease)
    • duration
  • change of color:
    • array of colors
      for example [#fee, #fcc, #a00, #fee]
    • the easeIn || easeInOut option
    • speed

And one more thing, ... automate the min version with grunt...

Black Bar

screen shot 2016-02-06 at 6 26 07 pm
Anyone know how to get rid of this nasty black bar? Thanks!

Tapping into animation cycle

Hello Vincent, I was trying to use your library like it can be seen here: http://flc.muriandre.com/ which is changing shapes and colors after several drawing rounds in order to show more effects by one single script.

That example is using your library with my modifications that you can get from here: https://github.com/fernandocanizo/particles.js

My first attempt was to just create another animation loop, problem was machine became sluggish as each new frame I created leaved your requested animations running (but not being shown), so at some point there were just too many animations running for the machine to cope with.

So I decided to export the id returned by requestAnimFrame() and clear the previous call when needed.

Then I needed a way to change configuration parameters and I tried several things until I decided to export your config object too.

Then I needed a way to tap into your animation cycle, so I exported a couple of variables that allow to pass it a callback which I use to update config.

Then I needed to recalculate colors, since they are only calculated on particle creation.

...

Long story short: I did a lot of changes to your library structure, but I think they would be good to be included in your library, but now I've gone to far and it seems you've been updating it too, so I'm wondering: supposing you like my changes, how would you like we to proceed to incorporate them? Should I just make a pull request? Should I update first and then try to trace your changes and include them in my version?

Please tell me what you think of my changes and if you like them, how we can proceed.

Rotating the screen on mobile

If you view the GitHub demo using either an Android tablet or mobile and then rotate the device from portrait to landscape the animation doesn't fill the entire screen

ReferenceError: window is not defined

Hello, i installed particles.js with npm and created a variable in app.js but right after this i have a crash:

/media/d/Develop/potter/potter.com.ua/node_modules/particles.js/particles.js:1429
window.requestAnimFrame = (function(){
^
ReferenceError: window is not defined
    at Object.<anonymous> (/media/d/Develop/potter/potter.com.ua/node_modules/particles.js/particles.js:1429:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/media/d/Develop/potter/potter.com.ua/app.js:10:19)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

Could you help me?

Outer glow/shadow

Is there a way to add an outer-glow or shadow to particles? Could be a nice effect for star fields and such.

Feature: fadein

Hi, Vincent.

Thanks very much for this great project.

Is there any way to specify particles to fade in one by one or in step ones, or fade in by opacity.

Multiple particlesJS

Hi,
I'm trying to apply your plugin on multiple IDs, works fine for drawing it, but only the last created canvas is interactive/animated. Do you have any solution?

Thanks :)

Working with Rails

Hello @VincentGarreau !

I `ve trying to use the rails gem with the material paralaxx template

I tried to add by pasting gem 'rails-assets-particles.js' in my gem file and running bundle install, but I get the error:

"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Could not find gem 'rails-assets-particles.js (>= 0) ruby' in any of the gem
sources listed in your Gemfile or available on this machine.
pedrom@pedrom-System-Product-Name:~/code/gearcloud$ "

Am I missing something ?

Flickering when resizing on Safari and Chrome

Salut Vincent!

I've had some flickering issues when resizing the window, so i guessed it was happening when the canvas is repainted.

I added a timeout to redraw only when the resizing is done

  pJS.fn.canvasSize = function(){
    pJS.canvas.el.width = pJS.canvas.w;
    pJS.canvas.el.height = pJS.canvas.h;

    //Initialize timeout
    var TO = false;

    //On resize
    window.onresize = function(){
      if (TO !== false){
        //Reset timeout
        clearTimeout(TO);
      }
      TO = setTimeout(repaintIt, 200);
    };
    //The repaint
    function repaintIt(){
      if(pJS){
        pJS.canvas.w = pJS.canvas.el.offsetWidth;
        pJS.canvas.h = pJS.canvas.el.offsetHeight;

        /* resize canvas */
        if(pJS.retina){
          pJS.canvas.w *= pJS.canvas.pxratio;
          pJS.canvas.h *= pJS.canvas.pxratio;
        }

        pJS.canvas.el.width = pJS.canvas.w;
        pJS.canvas.el.height = pJS.canvas.h;

        /* repaint canvas */
        pJS.fn.canvasPaint();
        if(!pJS.particles.anim.enable){
          pJS.fn.particlesRemove();
          pJS.fn.canvasRemove();
          launchParticles();
        }
      }
    }
  };

and it has helped, but the flickering still happens sometimes after resizing. I'm no way a canvas expert.

Merci!

Chrome 41 on Mac Yosemite fan loud

i've added the script to my localhost site. after a couple of minutes the fan starts, almost as if I were watching an heavy flash file.

Triangles

Dear Vincent,

first of all: Thanks a lot for this super cool script!

Is is somehow possible that instead of creating lines between two points to create lines between three points to build a triangle shape that could be filled with a color?

Thanks in advance!

Destroy method

Can we get destroy method so we can, for example destroy particles on mobile devices where the performance is an issue?

Particle not at the good place

Hi,

I am trying to make Particle JS work as a background. As you can see on my website, the body as the attribute particles but, the particles are only after the content. It dosen't follow the order. Here is the config:

particlesJS("particles-js", {
    particles: {
        number: {
            value: 80,
            density: {
                enable: !0,
                value_area: 800
            }
        },
        color: {
            value: "#ffffff"
        },
        shape: {
            type: "circle",
            stroke: {
                width: 0,
                color: "#000000"
            },
            polygon: {
                nb_sides: 5
            },
            image: {
                src: "img/github.svg",
                width: 100,
                height: 100
            }
        },
        opacity: {
            value: .5,
            random: !1,
            anim: {
                enable: !1,
                speed: 1,
                opacity_min: .1,
                sync: !1
            }
        },
        size: {
            value: 3,
            random: !0,
            anim: {
                enable: !1,
                speed: 40,
                size_min: .1,
                sync: !1
            }
        },
        line_linked: {
            enable: !0,
            distance: 150,
            color: "#ffffff",
            opacity: .4,
            width: 1
        },
        move: {
            enable: !0,
            speed: 6,
            direction: "none",
            random: !1,
            straight: !1,
            out_mode: "out",
            bounce: !1,
            attract: {
                enable: !1,
                rotateX: 600,
                rotateY: 1200
            }
        }
    },
    interactivity: {
        detect_on: "canvas",
        events: {
            onhover: {
                enable: !0,
                mode: "grab"
            },
            onclick: {
                enable: !0,
                mode: "push"
            },
            resize: !0
        },
        modes: {
            grab: {
                distance: 140,
                line_linked: {
                    opacity: 1
                }
            },
            bubble: {
                distance: 400,
                size: 40,
                duration: 2,
                opacity: 8,
                speed: 3
            },
            repulse: {
                distance: 200,
                duration: .4
            },
            push: {
                particles_nb: 4
            },
            remove: {
                particles_nb: 2
            }
        }
    },
    retina_detect: !0
});

Thanks!

Enable use of web fonts as a particle shape

Awesome library!
What about adding a support to use webfonts such as font awesome icons for example to be used as a particle shape with optionaly an array of font elements to randomly choose one?

More shapes in the intersects

I would love to see support for more shapes in the line intersects. Or maybe small PNG files as intersects (and have the client implement the shapes in PNG files). Whichever is easier to code.

Interaction through the Text Layer

I am using the plugin for a full background where i have certain interactions. But when i trying to add a text layer on the top i am not able to have the interactions over the div containing the text.

Is there any way to get this to work with text over the canvas?

Demo Link

meteor package

is it okay if I make a smart package of this library for the Meteor framework?

Changing the JSON info

Hey man, really love your work.
I just have a small problem with updating some of the values in the JSON file.
What I've used so far, is just what you wrote in a closed issue;

pJSDom[0].pJS.particles.number.value = 1000;
pJSDom[0].pJS.particles.move.direction = "bottom";
pJSDom[0].pJS.particles.color.value= "#766637";
pJSDom[0].pJS.fn.particlesRefresh();

But there is some value I can't change such as;
particles.move.speed
particles.size.value

And I've written them in the same with as those value changes that actually work, like;
pJSDom[0].pJS.particles.move.speed = 9;
pJSDom[0].pJS.fn.particlesRefresh();

Am I doing something totally wrong here? :s
Also sorry for bothering you.

FR: Image Decals

Excellent library, but it seems like it doesn't support images being used for the particles (with sizing etc), rather than just a solid color.

Would be a great addition in my opinion.

Does not load on Chrome iOS

It does not work with Chrome but it works with Safari. Very weird.

I added the following on my css and it s working:

particles-js{

height:100%;
background:#b61924
}

Uncaught SyntaxError: Unexpected token :

hi thank you package.

it's bug? when i use

particlesJS.load('particles-js','particles.json');

chrome console show
Uncaught SyntaxError: Unexpected token :

file particles.json content

{
  "particles": {
    "number": {
      "value": 80,
      "density": {
        "enable": true,
        "value_area": 800
      }
    },
    "color": {
      "value": "#ffffff"
    },
    "shape": {
      "type": "circle",
      "stroke": {
        "width": 0,
        "color": "#000000"
      },
      "polygon": {
        "nb_sides": 5
      },
      "image": {
        "src": "img/github.svg",
        "width": 100,
        "height": 100
      }
    },
    "opacity": {
      "value": 0.5,
      "random": false,
      "anim": {
        "enable": false,
        "speed": 1,
        "opacity_min": 0.1,
        "sync": false
      }
    },
    "size": {
      "value": 5,
      "random": true,
      "anim": {
        "enable": false,
        "speed": 40,
        "size_min": 0.1,
        "sync": false
      }
    },
    "line_linked": {
      "enable": true,
      "distance": 150,
      "color": "#ffffff",
      "opacity": 0.4,
      "width": 1
    },
    "move": {
      "enable": true,
      "speed": 6,
      "direction": "none",
      "random": false,
      "straight": false,
      "out_mode": "out",
      "attract": {
        "enable": false,
        "rotateX": 600,
        "rotateY": 1200
      }
    }
  },
  "interactivity": {
    "detect_on": "canvas",
    "events": {
      "onhover": {
        "enable": true,
        "mode": "repulse"
      },
      "onclick": {
        "enable": true,
        "mode": "push"
      },
      "resize": true
    },
    "modes": {
      "grab": {
        "distance": 400,
        "line_linked": {
          "opacity": 1
        }
      },
      "bubble": {
        "distance": 400,
        "size": 40,
        "duration": 2,
        "opacity": 8,
        "speed": 3
      },
      "repulse": {
        "distance": 200
      },
      "push": {
        "particles_nb": 4
      },
      "remove": {
        "particles_nb": 2
      }
    }
  },
  "retina_detect": true,
  "config_demo": {
    "hide_card": false,
    "background_color": "#b61924",
    "background_image": "",
    "background_position": "50% 50%",
    "background_repeat": "no-repeat",
    "background_size": "cover"
  }
}

Particles.js crashes in Google Chrome

I am running version 2.0.0 of particles.js as a background in a Zurb Foundation based site using particles.json for configuration as suggested in the README.

Using Chrome Version 44.0.2403.157 (64-bit) on Linux Mint, the page with particles.js crashes sporadically; i.e. the browser content area turns gray and is not clickable any longer (cannot access console to see an error message). I have to refresh the browser and reload the page.

Any idea what could cause that?

Implementing it into Joomla

Hello, I am trying to implement particles into my Joomla website. i have activated a module here dmware.it/seo however the effect doesn't load.
Within the index.php of the template I have the particles.json. The index.php calls the /scripts/app.js. if anyone can help it'll be great, thanks.

Add text/links for each point?

This is really awesome stuff.

I wanted to utilize this but wanted to append text around each point to illustrate a web of ideas. Is there a way to do this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.