Live data from Hacker News

CSS Minecraft

benjaminaster.com

81–90 of 154 posts

Re: CSS Minecraft

#81
post #29

This is fiendishly clever, and really quite elegant. I made some of my own notes on how this works here: https://simonwillison.net/2025/May/26/css-minecraft/

But highly impractical and far beyond what CSS should be used for.

Obviously...

That's why it was done

For fun and to see whether it could be done

Re: CSS Minecraft

#82
post #67
post #27

Very impressive! As I've hit my mid-life slide and (regressed|progressed) back to my youth-self, I've found myself just writing a bunch of apps and sites in html and css and really enjoying it. One thing I still would like to see cracked is a random-like number in pure CSS. You can almost us there with some of the math functions and browser attributes, but I haven't found anything reliable.

Can LLMs help?

Can they? I think it's weird that you ask a question (or, offer a possible solution in the shape of a question) without verifying your own assertion first.

To answer your question, LLMs confirm you can't generate a random number in CSS.

Re: CSS Minecraft

#83
post #4

If anyone's wondering how it manages the state, a quick peek into the source code shows that it uses radiobuttons and the HTML contains all the blocks you could ever possibly place.

Radio buttons and checkboxes really are magic when it comes to doing neat things in pure CSS. We used to have a lot of neat stuff like pure html/css tabs and toggles but they didn't pass an accessibility audit.

Re: CSS Minecraft

#84
post #27

Very impressive! As I've hit my mid-life slide and (regressed|progressed) back to my youth-self, I've found myself just writing a bunch of apps and sites in html and css and really enjoying it. One thing I still would like to see cracked is a random-like number in pure CSS. You can almost us there with some of the math functions and browser attributes, but I haven't found anything reliable.

Is this a thing? https://medium.com/hypersphere-codes/randomness-in-css-b55a0...

Re: CSS Minecraft

#85
post #62
post #36

Earlier quoted context omitted.

Only guessing, but I have a theory that Mojang considered that circa 2017 :D In 2019 they released a web version of minecraft classic, as a quirky marketing thing for the game's anniversary. But what they released turned out to be built on my open-source voxel engine, and when I dug around their code I realized they'd yoinked my engine a solid two years earlier. And the demo they released was probably not two year's…

Humorous postscript, btw: two months after Mojang forked my voxel engine, somebody left an anonymous "this is awful, you are a terrible programmer" comment on the engine repo. It's probably a total coincidence, but I like to imagine that the comment came from somebody at Mojang, and that my awful code is the reason why minecraft isn't a web app today :D

Is your repo still available?

Re: CSS Minecraft

#86
post #56

Web-based minecraft, when?

The full java version of the game was ported to webassembly/webgl a while ago. It's called eaglercraft: https://eaglercraft.com

I don't get it - isn't this blatant copyright infringement? Seems like they're just running some kind of cracked Minecraft build with a JVM-in-JS layer or some such trickery?

Re: CSS Minecraft

#87
post #29

This is fiendishly clever, and really quite elegant. I made some of my own notes on how this works here: https://simonwillison.net/2025/May/26/css-minecraft/

But highly impractical and far beyond what CSS should be used for.

If you really wanna get your blood boiling how about some Doom with HTML checkboxes - https://healeycodes.com/doom-rendered-via-checkboxes

Re: CSS Minecraft

#88
post #29

This is fiendishly clever, and really quite elegant. I made some of my own notes on how this works here: https://simonwillison.net/2025/May/26/css-minecraft/

This is how CSS CAPTCHAs are made (for Tor websites), and sign up / login modals, and many other stuff.

Re: CSS Minecraft

#90
I remember discovering this trick nearly two decades ago. A co-worker and myself were a bit puzzled at the time and we kind of tossed the idea in the air that "doesn't this mean CSS is Turing Complete?" but we moved on to making things work on IE6 for old clients.
Post reply on HN