When it was first introduced, responsive design was one of the most exciting web layout concepts since CSS replaced tables. The underlying technology uses media queries to determine the viewing device type, width, height, orientation, resolution, aspect ratio, and color depth to serve different stylesheets.

If you thought responsive design was reserved for CSS layouts only, you’ll be pleased to hear media queries can also be used in JavaScript, as this article will explain.

Media Queries in CSS

Watch Retrofit an Existing Site into Using Modern, Responsive Web Design Practices

NodeMCU and Sonoff don’t have Espruino installed by default, so I used ThingsSDK and their Flasher.js App to flash them in less than a minute. After that, pushing the code on the node is easy as npm run dev.

At the first boot of a new node, it starts an Access Point to configure the Network SSID, Password and the Aurora Code, a 4-digit code that is used by the node to obtain the right MQTT channel and to register himself on the server.

The interface for the Wi-Fi setup is really simple: this is caused by the fact that all the HTML code for the page is inside the node, and they have limited memory. To avoid lots of