One problem is you can't go back from the app settings to the settings menu.
You could maybe put the drawing code in a separate library file, like e.g. the weather app does, so you'd have something like this:
// apps/contourclock/lib.js exports.drawClock = function(time, face) { // draw clockface [#face](https://forum.espruino.com/search/?q=%23face), at given time } // apps/contourclock/app.js var face = Storage.readJSON('contourclock.json').face setInterval(()=>require('contourclock').drawClock(new Date(), face), 60000); // apps/contourclock/settings.js (function(back) { function preview(face) { require('contourclockclock').drawClock(new Date(), face); } // settings menu using preview() goes here }) // apps.json { "id": "contourclock" "storage": [ {"name":"contourclock.app.js","url":"app.js"}, {"name":"contourclock","url":"lib.js"}, {"name":"contourclock.settings.js","url":"settings.js"} ], }
@rigrig started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
One problem is you can't go back from the app settings to the settings menu.
You could maybe put the drawing code in a separate library file, like e.g. the weather app does, so you'd have something like this: