aral,
@aral@mastodon.ar.al avatar

So given it’s Saturday night, I thought I’d have a little fun with Kitten and make a tiny collaborative drawing toy.

You have a 20×20 grid and only black and white to draw with and everyone shares the same canvas.

https://draw-together.small-web.org

Have fun + looking forward to seeing what we all, umm, draw together.

:kitten:💕

PS. It took about 60 lines of code.

View source: https://codeberg.org/aral/draw-together

sarajw,
@sarajw@front-end.social avatar
aral,
@aral@mastodon.ar.al avatar

@sarajw It has evolved :)

aral,
@aral@mastodon.ar.al avatar

Haha, was just in a collaboration to help some folks complete this :)

https://draw-together.small-web.org

:kitten:💕

matiiob,
@matiiob@mastodon.uy avatar

@aral I was there! 😁

smallcircles,
@smallcircles@social.coop avatar

@matiiob @aral

Nice! @helge made this as a small federated app before.

aral,
@aral@mastodon.ar.al avatar
aral,
@aral@mastodon.ar.al avatar

Right, I’ll leave you with a cute bunny someone drew (naughty cute bunny artist did not rewind though, tsk, tsk). Back to working on Kitten and Domain tomorrow so your timelines will be blissfully empty of pixel sketches :)

’night ’night all – and thank you to all the folks who contributed pixels to our shared ether of Draw Together over the weekend for restoring my faith in humanity a bit :)

https://draw-together.small-web.org

#DrawTogether #Kitten #Domain #SmallWeb #CuteBunny #NightNight

setto,

@aral
YEAH!

aral,
@aral@mastodon.ar.al avatar

@setto 👍

aral,
@aral@mastodon.ar.al avatar

Folks, I see you experimenting with scripting—that’s cool, but please be considerate to the other folks playing with Draw Together.

To that end, I’ve just added two scripts you can use non-destructively to the readme. One to invert the canvas (which someone discovered literally minutes after I released the app) and the second that replaces the whole image with a pre-made design but then restores it after two seconds.

Please be kind, rewind ;)

:kitten:💕

https://codeberg.org/aral/draw-together#scripts

aral,
@aral@mastodon.ar.al avatar

I’ve also updated the readme with instructions on how to run Draw Together yourself (you could have it up and running locally in under a minute by installing Kitten, cloning the repository, and running the kitten command) and links to where you can learn more about the Streaming HTML magic in Kitten that means that the whole app is ~60 lines of code :)

https://codeberg.org/aral/draw-together#draw-together

Sh4d0w_H34rt,
@Sh4d0w_H34rt@mstdn.social avatar

@aral has anyone been Rick Rolled yet?

aral,
@aral@mastodon.ar.al avatar

@Sh4d0w_H34rt Someone was attempting it at some point but it degenerated into chaos before they could get the lyrics out :)

Sh4d0w_H34rt,
@Sh4d0w_H34rt@mstdn.social avatar

@aral 🤣🤣🤣

christian,
@christian@aldr.social avatar

@aral This was fun, thanks to whoever joined me in making it :D

OnceUponAGoblin,
@OnceUponAGoblin@masto.pt avatar

@aral this is so fun!! A bit cadavre exquis. “11 times 52 kangaroo”

aral,
@aral@mastodon.ar.al avatar

@OnceUponAGoblin :kitten: 💕

Or should I say 🦘

OnceUponAGoblin,
@OnceUponAGoblin@masto.pt avatar

@aral your game/toy deserves a bot that shares here on mastodon a screenshot of whatever is is on that moment every few minutes

aral,
@aral@mastodon.ar.al avatar

@OnceUponAGoblin Ooh, wanna make one? That would be very neat :)

(Especially since, otherwise, it is rather ephemeral.) :)

OnceUponAGoblin,
@OnceUponAGoblin@masto.pt avatar

@aral i like your faith in my non-existent hability for anything remotely related to code

aral,
@aral@mastodon.ar.al avatar
DrVeronikaCH,
@DrVeronikaCH@dair-community.social avatar

@aral this is amazing

cirrus,
@cirrus@mstdn.social avatar

@DrVeronikaCH @aral Hah! So you must have been one of the collaborators to make this... 🙌

DrVeronikaCH,
@DrVeronikaCH@dair-community.social avatar

@cirrus @aral yes! Was going for panda bear first but it turned out well 😁

aral,
@aral@mastodon.ar.al avatar

@DrVeronikaCH @cirrus Reminds me of a character out of Maniac Mansion :)

aral,
@aral@mastodon.ar.al avatar

@DrVeronikaCH Thank you so much, Veronika :) Love the face!

:kitten:💕

PS. Have you had a chance to look at the code? That whole thing is in 60 lines of Kitten. Would love to see Kitten start to get used to teach web dev in the future and would love your thoughts on that too :)

Source: https://codeberg.org/aral/draw-together

A video/write-up on Kitten’s Streaming HTML workflow that peels away the magic layer by layer: https://ar.al/2024/03/08/streaming-html/

Kitten tutorials: https://codeberg.org/kitten/app

eldelacajita,
@eldelacajita@mastodon.social avatar

@aral This is awesome!

Played through some chaos with others, and suddenly a common goal emerged.

And it stayed for a while.

aral,
@aral@mastodon.ar.al avatar

@eldelacajita Thank you :)

:kitten:💕

PS. Did you get a chance to look at the code. It’s 60 lines of Kitten :)

https://codeberg.org/kitten/app

sunny,
@sunny@boitam.eu avatar

@aral this was a fun way to spend my time this Sunday morning, thank you 🤗
In the same spirit as the hearts, currently:

aral,
@aral@mastodon.ar.al avatar

@sunny Aww, thank you 🤗

:kitten:💕

mustastum,
@mustastum@mastodon.social avatar

@aral I might've vandalized it shortly with some game of life :)

video/mp4

aral,
@aral@mastodon.ar.al avatar

@mustastum Oh, you did too, only now seeing this. @ciourte did too and shared their code :) Great minds and all that, I guess :)

https://piaille.fr/@ciourte/112149317553847655

(Very nice, by the way. And thanks for sharing the screen recording) :)

leighleighleigh,
@leighleighleigh@hachyderm.io avatar

@aral love this tall creature

aral,
@aral@mastodon.ar.al avatar

@leighleighleigh Haha, very nice :)

:kitten:💕

aral,
@aral@mastodon.ar.al avatar

Hey! and Hi! back to you, whoever you may be :)

https://draw-together.small-web.org

aral,
@aral@mastodon.ar.al avatar

Haha, nice, already seeing you all adding and removing pixels :)

Feel free to use this thread to coordinate if you want to :)

aral,
@aral@mastodon.ar.al avatar
aral,
@aral@mastodon.ar.al avatar

Woah, someone managed to invert the canvas. Who did that? And how? :)

(Are you scripting button presses from the console?) ;)

AnnaLiMg,
@AnnaLiMg@tooot.im avatar

@aral חא ככ הבנתי מה זה בדיוק

aral,
@aral@mastodon.ar.al avatar

@AnnaLiMg Hah, I swear it said Cool right before I started recording :)

aral,
@aral@mastodon.ar.al avatar

Aww, hello, kitty!

https://draw-together.small-web.org

:kitten:💕

(Learn how to build the app from scratch: https://ar.al/2024/03/26/draw-together/)

wandy_dev,
@wandy_dev@mstdn.social avatar

@aral this is insanely cool!

aral,
@aral@mastodon.ar.al avatar

@wandy_dev Aw, thank you :)

PS. I just made a video about how to recreate it using Kitten:

https://ar.al/2024/03/26/draw-together/

aral,
@aral@mastodon.ar.al avatar

Right, about to do another take of the Draw Together making of video: if anyone wants to twiddle with the pixels while I’m recording, please do :)

https://draw-together.small-web.org

aral,
@aral@mastodon.ar.al avatar

Thanks again to those of you who came by to toggle pixels with me. I’m happy with this take :)

Will release the video/article this evening :)

aral,
@aral@mastodon.ar.al avatar

I’m just about to record a video where I create the Draw Together Kitten¹ app from scratch in one take. If any of you want to be in the initial demo of the live version, feel free to head on over to https://draw-together.small-web.org and demonstrate your pixel drawing skills :)

https://draw-together.small-web.org

¹ https://codeberg.org/kitten/app

aral,
@aral@mastodon.ar.al avatar

Thank you to those of you who showed up :)

Might record another take this afternoon.

18+ mutter01,
@mutter01@mastodon.social avatar

@aral Me when someone is messing up my rocket. (Yes, I’m that Immature.)

18+ aral,
@aral@mastodon.ar.al avatar

@mutter01 Hehe :)

aral,
@aral@mastodon.ar.al avatar

The state of my screenshots folder right now…

:awesome:

lontrachen,
@lontrachen@mastodon.social avatar

@aral can you crash me

aral,
@aral@mastodon.ar.al avatar

@lontrachen Yeah, that was a message to a particular pentester who was being very helpful (plugged a hole in Kitten thanks to their help) :)

aral,
@aral@mastodon.ar.al avatar

Aww – just glanced at my Draw Together tab and saw this :)

https://draw-together.small-web.org

:kitten: 💕

aral,
@aral@mastodon.ar.al avatar

From kitty cat to… Batman?

draw-together.small-web.org

MishaVelthuis,
@MishaVelthuis@social.edu.nl avatar

@aral

Very cool.

I have for a long time wanted to turn a part of my website into a "fridge door with magnets", where visitors can (together) play with (the order of) a select number of words. Looking at this, that must be quite easily implementable as well?

aral,
@aral@mastodon.ar.al avatar

@MishaVelthuis Yep, you’d just give each word an id for some sort (eg., index the words array) and then use the drag and drop api and fire events based on that (look up hx-trigger in the htmx docs) and pass the x and y coordinate (or offsets, depending on how you implement it) as data. It’s a bit more complicated than what I have (a grid of buttons) but should be doable :)

aral,
@aral@mastodon.ar.al avatar

A big thank-you to @paillp for poking the Draw Together Kitten toy with a stick and thereby discovering a big-old hole in Kitten’s new experimental Streaming HTML code where I was assuming (remember, kids, never assume…) the data was valid JSON.

I’ve now fixed that and deployed a new version of Kitten that doesn’t suffer from that issue.

If you do discover that you can crash the app and/or Kitten by doing unspeakable things to it, please file an issue or ping me here.

https://codeberg.org/kitten/app

aral, (edited )
@aral@mastodon.ar.al avatar

Take two ;)

(It’s back up and running with a bit of data validation and I realised that I’d over-engineered it – yes, even in 60 lines of code – by storing all the updates in the database when I didn’t need to, so I removed that. Although, in the future, it would be fun to save time-series data so the drawings can be played back in real time.) :)

Play: https://draw-together.small-web.org

Source code: https://codeberg.org/aral/draw-together

Learn how it works: https://ar.al/2024/03/08/streaming-html/

aral,
@aral@mastodon.ar.al avatar

OK, just added lower-bound checking too for the row and column indices so that should basically cover all bases.

If you do find a way to crash it, please file a bug at: https://codeberg.org/aral/draw-together

Thanks :)

4censord,
@4censord@unfug.social avatar

@aral > by storing all the updates in the database when I didn’t need to

Is there such a thing a scheduled tasks in kitten?
Like for, saving the current data to the DB every second/minute/something?

aral,
@aral@mastodon.ar.al avatar

@4censord Kitten’s database is very performant for writes since it’s an append-only log. So there’s really no need. But if you wanted to, you could set an interval manually using plain old JS. (Kitten’s database is JavaScript Database; JSDB)

https://codeberg.org/small-tech/jsdb

aral,
@aral@mastodon.ar.al avatar

Well, it lasted about 12 hours before folks managed to break it – that’s not bad ;)

Give me a few moments and I’ll have it back up and running with a patch or two :)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • SmallWeb
  • ngwrru68w68
  • DreamBathrooms
  • modclub
  • GTA5RPClips
  • InstantRegret
  • magazineikmin
  • Youngstown
  • thenastyranch
  • rosin
  • slotface
  • mdbf
  • khanakhh
  • kavyap
  • anitta
  • tester
  • normalnudes
  • Leos
  • cisconetworking
  • osvaldo12
  • everett
  • Durango
  • tacticalgear
  • provamag3
  • megavids
  • ethstaker
  • cubers
  • JUstTest
  • lostlight
  • All magazines