How do I run particle.js json file in hype project?


(Pete) #1

Hi All,

Looking for way to run particle.js json file that I just generated and saved from particle.js website

Thx


(Hans-Gerd Claßen) #2


… and then look for usage :slight_smile:

if you do not want the provided load-method just pasting your jsons contents should be ok too:

particlesJS('particles-js',//element that should contain the particles ...
  
  {
//paste the json here
  }

(Jonathan Deutsch) #3

Basic steps:

  1. On the particles.js site, click Download current config (json)
  2. Drag the resulting particlesjs-config.json file into your Hype document’s resources library
  3. On that same site, hit download to get the particles.js master.zip file
  4. Unzip, and drag the particles.min.js file into your Hype document’s resources library
  5. Create a Rectangle element and give it a Unique Element ID of particles-js
  6. Add an On Scene Load handler to Run Javascript… and use this code:
	particlesJS.load('particles-js', '${resourcesFolderName}/particlesjs-config.json', function() {
	  console.log('callback - particles.js config loaded');
	});

Particles.hype.zip (21.6 KB)


(Pete) #4

This Is Great! Thank you both. :+1: