vantajs
Vanta.js — Animated WebGL Backgrounds Skill
When to use
- Decorative animated backgrounds behind hero sections
- You want “wow” quickly without building a full three.js scene
- Lightweight integration into static sites or React/Vue
How it works
- Vanta injects a canvas into a container element and renders an effect (many use three.js).
- Typical usage: include
three.min.js(or provide THREE) + one Vanta effect bundle.
Key APIs/patterns
- Init:
const effect = VANTA.WAVES({ el: "#hero", ...options })
- Update after init:
effect.setOptions({ color: 0xff88cc })
- Resize:
effect.resize()(if container size changes)
- Cleanup:
effect.destroy()(important in SPAs)
Common pitfalls
- Container has no size → nothing visible
- Ensure the target element has explicit width/height (or is laid out).
- Multiple WebGL canvases on one page → GPU load
- Keep to 1–2 effects/page.
- Mobile/older GPU issues
- Provide a fallback background color/image; consider disabling on small screens.
- Bundling in frameworks
- Some builds require
window.THREEor passingTHREEin options.
- Some builds require
Quick recipes
1) Minimal waves background
<div id="hero" style="height: 70vh;"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta/dist/vanta.waves.min.js"></script>
<script>
const effect = VANTA.WAVES({ el: "#hero", color: 0x0b1220, shininess: 40, waveHeight: 16, zoom: 0.9 });
</script>
2) React cleanup pattern (concept)
- Create effect in
useEffect, store in ref, calldestroy()on unmount.
What to ask the user
- Which effect (waves, birds, fog, net, etc.) and brand colors?
- Must it run on mobile? If yes, what’s acceptable FPS/quality?
- Is it behind text (needs contrast/readability)?
More from mengto/skills
unsplash-asset-images
Use when you need to pick high-quality Unsplash images for product/design assets (avatars, headshots, portraits, large website backgrounds, and abstract wallpapers) and output real Unsplash URLs plus practical instructions for producing the right resolutions and aspect ratios (1:1, 4:5, 3:4, 16:9, 9:16).
65landing-page
Use when designing or rewriting a high-converting landing page (single-offer page) for SaaS/apps/services. Covers structure, layout patterns, conversion strategies, copywriting, SEO/AEO, and common pitfalls.
31gsap
Use when you need to add or debug professional web animations with GSAP (timelines, ScrollTrigger, stagger, transforms) in HTML/CSS/JS/React. Includes patterns for smooth motion, performance, and common pitfalls.
28globe-gl
Use when implementing globe.gl (Globe.GL) for 3D globe data visualization with WebGL/ThreeJS, including setup, data layers (points, arcs, polygons, labels), and integration patterns in plain HTML or React.
27progressive-blur
Create a layered CSS progressive blur (top or bottom) using multiple backdrop-filter masks for depth and softness. Use when asked for “progressive blur”, “gradient blur overlay”, or stepped blur masks that fade from an edge of the viewport.
27pricing-page
Use when designing or rewriting a high-converting SaaS pricing page (structure, plan design, copywriting, SEO/AEO, FAQs, layout patterns, experiments). Includes checklists, templates, and common pitfalls.
25