-
Notifications
You must be signed in to change notification settings - Fork 395
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
Using a sketch on a website #178
Comments
Same situation for me, follow this issue. |
When you have an HTML element like below: <div id="canvas-container"></div> You can specify that element to be the parent of the canvas in the const settings = {
parent: document.querySelector("#canvas-container")
} Similarly, you can also use an existing canvas element using |
There's a few ways to do this:
|
First of all, thanks Matt @mattdesl for creating such amazing tool! I followed the instructions and used the codes @cdaein provided but couldn't manage to build the website as expected. Here were the command I inputted in the terminal and the result: → Building...
As the result showed, a new Would you please advise what I have done incorrectly in the setup? Thank you! |
Hi guys. Just want to let you know I can finally manage to render my canvas into the targeted div container. I just needed to move back the .js and .js.map files to the same directory of the .html file. Everything works fine now! :) |
For future, you might want to do this instead, it will place all files in a folder called canvas-sketch sketch.js --build --dir=output --name=canvas |
Hi,
I'm playing around with canvas sketch for creating visuals. Now i'm looking for the best way to place it on a website. If i use the build tool of canvas sketch i don't have control over the "canvas" tag, i can't place it inside another div for example. Is there a solution for that? Or is it better to work with p5.js (which seem to be used online a lot) and combine it with canvas sketch?
Thanks in advance.
The text was updated successfully, but these errors were encountered: