As a fun little exercise, I decided to port Miuki Miu’s (Elizabet Oliveira’s) adorable React Kawaii¹ to Kitten².
Going to write a blog post about the experience but, in the meanwhile, if you want to play with the cute little characters, here you go:
https://kitten-kawaii.small-web.org
And here’s the source code:
https://codeberg.org/aral/kitten-kawaii/
Things to try: the back and forward buttons ;)
¹ https://react-kawaii.vercel.app
² https://kitten.small-web.org
Ooh, oops, looks like I introduced a little shared state between sessions… looking into it now :)
(If your character switches when you change the colour, etc., that’ll be why.)
Right, fixed.
So genius here just kept state in global variables which were, of course, shared between all connections.
(So you were all just changing the same character, colour, mood settings but the updates were only getting sent to you so when someone else changed something, your character would reflect those changes too and appear to jump.)
Anyway, long story short, moved state to the session object and it should be good now.
Patch: https://codeberg.org/aral/kitten-kawaii/commit/fdb57e7794cc0c72f75a7273ac66b1514a667f0e
@aral sorry! Lol
@falken Hey, It Worked On My Machine™ ;P
@aral and mine. And theirs. And everyone's :-)