I have started the project
So here’s what I did in this devlog:
- Created a Bun backend that serves some files
- Made a database with a table with a history of all edits to the canvas
- Added an API endpoint to the Bun backend that will (rather inefficiently for now) fetch the table and build the current state of the canvas from scratch and send it back (remember how i said it’s inefficient? yeah it iterates through every. single. change in the entire history of the thing and then builds the state. better code coming soon
)
- Started the frontend
- Realized the naming of “canvas” in the name of the project and “canvas” the HTML element will be very confusing
- Did nothing about this and made confusing names anyway
- Made the frontend fetch the current canvas state and display it on a
<canvas> on the screen
- Made that canvas draggable/scrollable (not too hard)
- Added zooming via trackpad gestures or alt/ctrl/cmd scrolling, and it worked kind of badly and felt weird when using it
- spent like 90% of this 4 hours fixing the zooming and like this took forever ARGHHGH IT WAS SO ANNOYING and i’m tired of doing it now but all my hard work finally paid off and I can zoom in and it feels nice!! (video attached)
soooooo anyway now i’ve got some stuff done
next, probably placing pixels on the canvas. either that or signing in with hack club. probably the first one or maybe even both! so we shall see how this goes