Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I add animation to Canvas element? #191

Open
mclaurie opened this issue Jul 14, 2024 · 1 comment
Open

Can I add animation to Canvas element? #191

mclaurie opened this issue Jul 14, 2024 · 1 comment

Comments

@mclaurie
Copy link

mclaurie commented Jul 14, 2024

Hello,

I am a newbie. I know the animation can be inserted into "Div" element, but can I add it to "Canvas" element? I tried below but was not successful:

<body>
<canvas id="ele"> </canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.clouds.min.js"></script>
<script> VANTA.CLOUDS('#ele'); </script>
</body>

Thank you!

@SheeetFace
Copy link

@mclaurie
Most likely, the reason why VANTA doesn't work with <canvas> elements, but only with <div> elements, probably has to do with architectural decisions and library usability.

As for animations and <canvas>, you can insert animations into the <canvas> element using various libraries such as Three.js, or write your own animations in pure JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants