tengbao/vanta

Theme switch

Closed this issue · 1 comments

Hello!
I want to use two themes - one for the light theme (topology) and the other for the dark theme (waves) of the site.
But when changing the class through .toggleClass (jQuery), the theme for some reason does not switch.
No matter how much I tried to do it, it didn't work.
If you change the class itself in the markup HTML, then everything is fine, but if through the theme switch on the site itself, then nothing changes.
Help me please!)))

I'm not sure how you're using toggleClass, but you'll probably need to do more than just switching classes. In the demo site, https://www.vantajs.com/, switching effects is done by destroying one effect and initializing another effect. You can see the loadEffect function in https://github.com/tengbao/vanta/blob/gallery/src/gallery.js