• A_norny_mousse@feddit.org
    link
    fedilink
    arrow-up
    11
    ·
    2 days ago

    Impressive and definitely my cup of tea.

    There isn’t actually all that much CSS, but 46 000 lines of html, mostly <label> elements for some reason.

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      6
      ·
      2 days ago

      Well, in order to avoid JavaScript, it’s having to encode all seven possible block states for all possible cells of the 10×8×8 world, and they’ve chosen to use HTML “radio” buttons - a single element - to achieve this. Each radio option has its own label, which, rather than text, is a heavily stylised set of six objects that represent the sides of the cube, which only show up when their respective radio option is set.

      7×10×8×8×(1+6) = 40320. The remainder of the lines are basically everything else.

      In theory you could have JavaScript generate this on the fly directly into the DOM, and the “game” would still work without needing JavaScript to actually handle any of it, but since they’ve opted to avoid JavaScript altogether, they’ve obviously pre-generated the majority of it with some other language.