You Can See Everything was an experience

I had seen The Rehearsal season 2 going in, so I was aware of Nathan Fielder’s general shtick, which is why I was not sure I could actually watch this movie:

I watched the teaser (next in the thread) and I’m not sure I can watch more than three minutes of this. But I’m insanely curious!

— Greg Stoll 🌈 (@gregstoll.com) 2026-09-07T01:41:35.663Z

But I had a day off last week and decided I wanted to see it in the theater. And I’m glad I did – as the movie got progressively more unhinged (complementary), it was nice to have people to nervously laugh with! (I’ll cop to looking down at my phone a few times just to deal with the cringe!)

Obviously the movie is about Elizabeth Holmes, but it also becomes more about what a documentary is and truth and all that. And by the end, maybe you feel bad for Holmes, or maybe the opposite.

Which is a very unsettling feeling! And I think that’s what Fielder et al want. But while I agree that truth can be hard to find and whatnot, I don’t want to get too moral relativistic here, and rereading Bad Blood brought me back down to Earth; it is certainly possible she was taken advantage of by Balwani and Evans, but she did plenty of bad stuff by herself.

New project: Mathman game!

You can play a game of Mathman! (source on GitHub)

Mathman was a segment on the 80s show Square One TV, a show that I adored in elementary school and cried if I missed. (which must have been very frustrating for my parents in a pre-DVR era!) He moonlights as my favicon on my website and my avatar on most social media sites.

You can find episodes on YouTube – a few years ago David and I had shown the kids some, and they thought it was mildly neat. This was enough to make us want to create our own version to help them practice math. We worked on it for a bit and got it working well enough that they played it a few times but lost interest pretty quickly.

Fast forward two years, and I figured I should get around to actually publishing it! I made a few small improvements and cajoled it to (mostly?) work on mobile.

It was trickier than it seemed, and we got to throw in some neat features:

  • Audio from the original series!
  • Text-to-speech to read the objective for the level (thanks SpeechSynthesisUtterance! although this doesn’t work on iPhone and it’s supposed to, I should dig into that…)
  • Smooth motion between grid squares! (trickier than it sounds!)
  • Detecting swipes from a touch event on a canvas! (not too hard!)
  • Detecting taps on a canvas! (much more annoying!)

Anyway, it was a fun project to work on, and a nice reminder that the web platform is really powerful. It’s so cool to make a project that will work on any computer, phone, or tablet!

The kids thought it was neat that we made this, but didn’t actually play it that much. (and now the questions are too easy for them!) But kids outgrowing things/not being as interested in things as you’d hope is just a part of parenting šŸ™‚

Coming soon: another bespoke project that the kids enjoyed for a brief while!

Floating point to hex converter is now framework free! Here’s what I learned

Here it is! And for comparison, here’s the old version that used React. As intended, it looks the same! (except for the “swap to use big-endian” option, which I don’t think makes a lot of sense)

This is the latest project on my framework free kick – you can read previous entries here. This was the biggest project that I’ve converted from React to Web Components; the diff is here and the main code is the 855 lines of public/index.js.

The floating point to hex converter is the most popular page on my website (just ahead of my MLB Triple Crown tracker, which will start dropping off any day now) so making big changes to it is scary! Especially since I don’t really have any sort of reporting that would let me know if something was broken. I did port over the existing tests to something based on Open Web Components’ testing framework, which lets me actually create components in the DOM, click buttons, etc. But if you see anything wrong, please drop me a line šŸ™‚

One of the fringe benefits of moving away from React was to get improved performance, more out of principle than any real need. But I did think that having a “pure HTML” page instead of pulling in React would make the page smaller and perform better. And, while it’s smaller, the performance results are more mixed: here’s the PageSpeed Insights for the new site compared with the old site. Unfortunately, I’m not an expert here; some things seem better and some seem worse. Oh well!

As this was my biggest Web Components project, and I wrote it without the help of LLMs (with one irritating exception; see below), I learned a lot:

  • HTML attributes have to be lowercase – Web Components generally store their values in attributes, and at once point I was setting an attribute listed in the observedAttributes list, but the call to attributeChangedCallback() wasn’t happening. And you can’t set a breakpoint on a call that isn’t happening, and I couldn’t figure out what could be going wrong, as this was something I’d done in all my previous Web Components projects. I started feverishly reverting changes with commit titles like “flailing about” and “aaa what is happening”. Finally, after being stuck for hours I finally gave in and asked Claude, and while it misdiagnosed the issue it did literally mention “as a sidenote” that HTML attributes are lowercase and if they’re ever set in HTML (as opposed to Javascript) trying to use the mixed-case version would cause problems. And lo and behold, that fixed the problem and I learned a valuable lesson I’ll probably never forget!
  • I still still miss JSX – Not much to add over my previous thoughts, but I felt it even more this time because the components were more complicated and had more attributes. Since components were nested a bit, passing attribute values down was also more irritating. If I work on a more complicated project maybe I will finally look into something like WebJSX to make this easier.
  • React uses className, HTML uses class – I’m impressed at my ability to keep getting this wrong.
  • Elements that get slotted (inserted in a <slot>) still exist in their original DOM position – In a component you can include a <slot> placeholder, which is where child elements of the original component get put. But the HTML structure doesn’t actually change, so if you need to query the DOM to find the child elements they aren’t actually in the <slot>. In retrospect I think this makes some sense, but it confused me for a while!

Questions I didn’t get satisfactory answers to:

  • Is there no way to set multiple attributes at the same time? Since my components have a lot of different attributes, there were a number of places that look like this, where the property setters are setting or removing attributes. Each time that happens the attributeChangedCallback() gets called, which means everything gets updated, so this effectively causes 5 updates to happen, most with intermediate values that are thrown away. This is madness! I thought of two options to fix this, but they’re both pretty bad. Is there something I’m missing?
    • Only call update() when the “last” attribute changes, which means callers would have to know the right order to set those attributes in, which is a terrible API.
    • Have a property that callers can set to pass a bunch of relevant attributes at once, separated by delimiters or something. This is possibly worse. Although I guess I could add a method on the class that does something like this, so callers could just call that method and wouldn’t have to know about the magic property. Hmm, this may be the best option.
  • How does JSDoc work in Visual Studio Code? Since I wanted to just write a plain JS file and avoid a build step, I skipped Typescript and was hoping to use JSDoc annotations to specify types. However, in all but the simplest cases I didn’t see any type errors flagged by Visual Studio Code, which was a bummer. It would be nice to have some sort of type checking while still writing plain JS!
  • Is there a better way to reset an animation when it’s done? To get the satisfying yellow flash when a conversion is done, I use a CSS transition, and then add a class to an element to trigger it. But after the animation is done, I have to remove that class so that the next time I can add it back to trigger the animation, and the only way I could figure out to do that was to parse the CSS to get the animation duration (which a pretty cool thing to be able to do!) and remove the class after that time elapses. Not the worst thing in the world, but it does feel klunky; maybe there’s a better way?

But when all is said and done, it’s really nice to have a plain HTML and JS file that I can build and deploy by hitting “Save” in an editor. (well, OK, and pushing to GitHub. But still!) And it’s similarly nice to have a non-minified JS file that’s easy to inspect. While I’m a bit skeptical about using Web Components for larger projects because of the questions above, the immediate feedback and nice clean files are really satisfying, so I’ll be on the lookout for more projects that I can convert!

Name My Color is now framework free!

TL;DR: I rewrote Name My Color to use Web Components instead of React!

My anti-web framework kick continues; after using Web Components for the baseball triple crown tracker, I’ve been hoping to start rewriting older projects in a more Web-native way. (honestly, at least part of this is to avoid those annoying GitHub dependabot emails warning me about vulnerabilities in my dependencies!)

The project is fairly straightforward (just a few hundred lines of JS), but I didn’t think I could do this because of the color picker. then I remembered seeing there’s an <input type=”color”>, and it’s well supported!

Of course the flip side is that instead of using a React component that looks the same everywhere, you’re depending on how different browsers implement things, so you have to be OK with the fact that your design isn’t going to be pixel perfect. Firefox’s color picker is platform-specific (the Linux one seems especially basic), although a nicer HTML-based one is coming!

An annoyance was reimplementing the feature that to allow clicking on a color to show the hex color (in case you’re on mobile and can’t see the tooltip). The old version did this in a typical React-ish way, where the component has an expanded boolean in its state, and clicking on it toggles that and shows the color. It hit me that this was really just the same as <details> and <summary> elements, and then I wouldn’t have to track the state! Which was true, except I couldn’t find a way to hide the triangle that opens on Safari, as for some reason it doesn’t support the ::marker pseudo element. I tried some solutions that were supposed to work on Safari but I just couldn’t get it to work and eventually gave up and embraced the “not pixel perfect” lifestyle šŸ™‚ Edit: I did figure this out a few days later!

As I’ve been trying to do with my personal projects, I didn’t use any LLMs in doing this…except for a few things. One was figuring out how to import ESM modules from a CDN (it’s weirder than you think!) because I did want to reuse some libraries for doing the color calculations instead of writing JS like this to convert RGB to CIELAB. Another was getting tests working – I sort of followed this guide, but didn’t really want to test any DOM stuff, so I made it a little simpler then got hopelessly lost and ended up with this spaghetti code. But look at the slick tests page!

Honestly I’m not totally sure why I wrote this originally – I think the basic idea was that you could take a picture of something and then get a name for a color? Although I guess this would require the EyeDropper API and also displaying a picture? But regardless it’s kinda fun to play with, and sometimes the kids will play with it for a few minutes, and that’s good enough for me!

And it is awfully satisfying to have a commit with net -28000 lines šŸ™‚