Hack Club Canvas banner

Hack Club Canvas

1 devlogs
4h 10m 4s

A shared canvas to draw on for Hack Clubbers where you get one pixel to place per minute. Easily bottable, because this is Hack Club after all. Inspired by pxl.

To be clear, this project is currently unofficial. This is created by a community member and not sponsored by Hack Club HQ.

Repository

Loading README...

jmw

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 thumbup-nobg)
  • 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) yay

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

2

Comments

jmw
jmw 8 days ago

ps: movements on the canvas in the video that look like i’m doing nothing are scrolling/trackpad gestures!

jmw
jmw 8 days ago

and the pixels on the canvas/canvas size are not hardcoded they’re in a database and fetched from it