Skip to content

Mercotui/truncated-cube-lamp

Repository files navigation

truncated-cube-lamp

Artsy remote code execution 👌

This lamp runs javascript animations, submittable via an embedded webserver:

View a demo video on YouTube.

Rainbow!

Script editing via web interface:

JibbleScribble

The most basic script looks like:

class Animation {
  update (ctx) {
      for (let x = 0; x < ctx.screen.resolution.width; x++) {
        for (let y = 0; y < ctx.screen.resolution.height; y++) {
          ctx.screen.setPixel(x, y, 'black');
        }
      }
      ctx.screen.draw();

      return undefined;
  }
}

Dependencies

The API backend is written in Qt, because it has a nice and easy to use Javascript engine 🤷.

To run this on your desktop for testing, get Qt5 devel:

  • Fedora 35 qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtdeclarative-devel
  • Ubuntu 21.04 qtbase5-dev qtbase5-private-dev qtdeclarative5-dev

Get, make, and install QtHttpServer branch 5.15.

Then you use cmake to build the service.

The website requires node.js, look in the website directory for more details.

Git Metarepo

Some dependencies are installed as git repository by metarepo. Install metarepo and run:

git meta sync