Can someone who's an expert at Javascript explain some code to me?

Can someone who's an expert at Javascript explain some code to me?

I'll legit pay $10 if you solve my problem.

Attached: lovelyphoto.jpg (4000x5000, 2.47M)

Other urls found in this thread:

pastebin.com/EZZqcHrz
vincentgarreau.com/particles.js/#default
youtube.com/watch?v=gboyQqLDwSs
twitter.com/NSFWRedditGif

show us

That's a castle

It is beautiful. What is with the scaffolding on the top right though?

pastebin.com/EZZqcHrz

The code is related to this web page here

vincentgarreau.com/particles.js/#default

It codes the GUI.

Now what I wanna know is HOW do they get their particles to update every time you change something like number of particles.


I don't really understand the function or methodology they've used to automatically change it.

Recreation of medieval construction techniques

It's an old building so I assume it requires constant reparations

Wrong, that's a keep. Educate yourself lad.

Are you a brainlet, user?

They're binding an event listener for change on the inputs, near the end of the JS you posted.
.onChange

>javascript expert
>to accomplish what you're asking
What.

yeah I've done exactly the same thing.

But mine doesn't update straight away, Instead I've had to rely on returning the method particlesJS on the updated 'config' that describes what the particles look like.


Here's the problem, it works, but every time I change it, it returns a particlesJS, which gets ridiculous and lags out the browser.

I was wondering how they got it to auto update the function such that the changes are live and I dont have to call particlesJS again.


Here is my code


gui.add(alt.particles.number, 'value', 0, 600).name('value').step(1).onChange(function(value) {
alt.particles.number.value = value;
return particlesJS(alt);
});

ITT : OP needs an expert with 10 minutes worth of experience on JS

well no ones solved it yet LMAO

sorry, I only have 9 minutes worth of experience

Let me take a look, but I don't promise anything...

yeah 51 minutes ago no promises lmao

Nope, couldn't find anything

On change calls `p.update()` which in turn calls `return pJS_GUI.fn.particlesRefresh();`

Which is the following function:
pJS.fn.particlesRefresh = function(){

/* init all */
cancelRequestAnimFrame(pJS.fn.checkAnimFrame);
cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
pJS.tmp.source_svg = undefined;
pJS.tmp.img_obj = undefined;
pJS.tmp.count_svg = 0;
pJS.fn.particlesEmpty();
pJS.fn.canvasClear();

/* restart */
pJS.fn.vendors.start();

};


Which basically just empties the canvas and restarts the draw loop

Just know that this is a shit way of doing it, learn WebGL.

FUCK

YEAH

THANKS

OMG HOW COULD I BE SO BLIND

Burg Eltz.

>OMG HOW COULD I BE SO BLIND
cuz you're a gay nigger

youtube.com/watch?v=gboyQqLDwSs

My contracting rate is $115/hr per US 1099 guidelines.