question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to start, pause, stop animation in particles.Vue3

See original GitHub issue

Contact Details

titusdecali@gmail.com

What do you need?

I have looked everything to figure out how to simply start and pause the animation in particle.vue3 and haven’t figured out where to fire the methods on.

I am also using the shape-confetti plugin.

I’ve added a ref to the <Particles> element, but using that specific ref like: refName.start(), refName.pause or even refName.current.start() says “properties of undefined”, which means it’s not even the correct element to begin with.

It’s by far the best at particles out there, but is also one of the most difficult to follow libraries I’ve ever used.

It seems strange to me that all the different versions for each framework don’t have their own docs as the Vanilla JS does not translate well into all frameworks.

Sorry for my ignorance on this library, but I want to do a simple thing and don’t have time to become an expert on it.

VERSIONS:
“particles.vue3”: “1.5.1”,
“tsparticles”: “1.22.1”,
“tsparticles-shape-confetti”: “1.7.1”,

tsParticles Version

"particles.vue3": "1.5.1",     "tsparticles": "1.22.1",     "tsparticles-shape-confetti": "1.7.1",

Which library are you using?

Vue.js 3.x (vue3-particles, particles.vue3)

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
matteobrunicommented, Sep 1, 2022

You can see the answers given here: https://github.com/matteobruni/tsparticles/issues/1184#issuecomment-1233153193

You can achieve this with only emitters options as explained there. You can skip the duration option if you want to start/stop the particles programmatically.

1reaction
matteobrunicommented, Sep 1, 2022

Checkout this demo, it shows how to access the start method, but it’s the same for play/pause/stop/refresh: https://codesandbox.io/s/eager-shadow-9bkmsr?file=/src/App.vue

Anyway, the npm link you sent has the import for the loadFull (not fullLoad) and the functions that need to be exposed from Vue. There are a few different modes of exposing properties, from composition APIs to the old-fashioned data/methods coming directly from Vue2 that’s why it’s not specified. A minimum Vue.js knowledge is required. As said many other times loadFull is not mandatory, since you could prefer loadSlim from tsparticles-slim package, or any preset that can be found here, or even loading only some of the available plugins manually. I don’t want to force users to install the full library if they don’t need it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[REACT] How to manually/dynamically play & stop particle ...
How can i manually play and stop the particle emitters in React.js? ... How to start, pause, stop animation in particles.Vue3 #4697.
Read more >
tsParticles | JavaScript Particles, Confetti and Fireworks ...
tsParticles - Easily create highly customizable particles, confetti and fireworks animations and use them as animated backgrounds for your website.
Read more >
Particles.vue3 released! Particles animations for Vue.js 3.x
vue3 is the new tsParticles component for Vue.js 3.x since 2.x components are not compatible. You can now have cool particle animations easily ......
Read more >
How to Play and Pause CSS Animations with CSS Custom ...
Another way to pause animations is to set animation-duration to 0s . The animation is actually running, but since it has no duration,...
Read more >
Animations pause when browser tab is not visible - GreenSock
I'm very new to gsap and I've run into this problem. I'm using gsap to animate a progress bar, but when the browser...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found