tengbao / vanta

Animated 3D backgrounds for your website
http://vantajs.com/
MIT License
5.54k stars 1.02k forks source link

How to set transparent background for 'net'? #149

Open ChengYu-Zhang opened 1 year ago

ChengYu-Zhang commented 1 year ago

i try set "backgroundColor: '0x00FFFFFF'",but not effective.

max929 commented 1 year ago

set "backgroundAlpha:0"

ghost commented 1 year ago

VANTA.NET({ el: "#your-element", color: 0x000000, backgroundColor: 0x000000, backgroundAlpha: 0 })

The el property specifies the DOM element to which the effect will be applied and the color property sets the color of the lines in the effect, and the backgroundColor property sets the background color of the element. To make the background transparent, you can set the backgroundAlpha property to 0, which will set the alpha channel (opacity) of the background color to 0. This will make the background transparent, allowing any underlying content or background to show through.

Assuming you have already loaded the Vanta.js library and included it in your particular project. Maybe you will also need to replace "#your-element" with the ID or class of the element you want to apply the effect to.