diff --git a/apps/clkinfosec/ChangeLog b/apps/clkinfosec/ChangeLog new file mode 100644 index 000000000..5560f00bc --- /dev/null +++ b/apps/clkinfosec/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/clkinfosec/app.png b/apps/clkinfosec/app.png new file mode 100644 index 000000000..ed79cd884 Binary files /dev/null and b/apps/clkinfosec/app.png differ diff --git a/apps/clkinfosec/clkinfo.js b/apps/clkinfosec/clkinfo.js new file mode 100644 index 000000000..a23d61754 --- /dev/null +++ b/apps/clkinfosec/clkinfo.js @@ -0,0 +1,33 @@ +(function() { + return { + name: "Bangle", + items: [ + { name : "Seconds", + get : () => { + let d = new Date(), s = d.getSeconds(), sr = s*Math.PI/30, + x = 11+9*Math.sin(sr), y = 11-9*Math.cos(sr), + g = Graphics.createArrayBuffer(24,24,1,{msb:true}); + g.transparent = 0; + g.drawImage(atob("GBgBAP4AA/+ABwHAHABwGAAwMAAYYAAMYAAMwAAGwAAGwAAGwAAGwAAGwAAGwAAGYAAMYAAMMAAYGAAwHABwBwHAA/+AAP4AAAAA")); + g.drawLine(11,11,x,y).drawLine(12,11,x+1,y).drawLine(11,12,x,y+1).drawLine(12,12,x+1,y+1); + return { + text : s.toString().padStart(2,0)+"s", + img : g.asImage("string") + }; + }, + show : function() { + this.interval = setTimeout(()=>{ + this.emit("redraw"); + this.interval = setInterval(()=>{ + this.emit("redraw"); + }, 1000); + }, 1000 - (Date.now() % 1000)); + }, + hide : function() { + clearInterval(this.interval); + this.interval = undefined; + } + } + ] + }; +}) \ No newline at end of file diff --git a/apps/clkinfosec/metadata.json b/apps/clkinfosec/metadata.json new file mode 100644 index 000000000..3749b6490 --- /dev/null +++ b/apps/clkinfosec/metadata.json @@ -0,0 +1,13 @@ +{ "id": "clkinfosec", + "name": "Secondx Clockinfo", + "version":"0.01", + "description": "For clocks that display 'clockinfo' (messages that can be cycled through using the clock_info module) this displays the time in seconds (many clocks only display minutes)", + "icon": "app.png", + "screenshots": [{"url":"screenshot.png"}], + "type": "clkinfo", + "tags": "clkinfo,seconds,time", + "supports" : ["BANGLEJS2"], + "storage": [ + {"name":"clkinfosec.clkinfo.js","url":"clkinfo.js"} + ] +} diff --git a/apps/clkinfosec/screenshot.png b/apps/clkinfosec/screenshot.png new file mode 100644 index 000000000..bb054e3a4 Binary files /dev/null and b/apps/clkinfosec/screenshot.png differ