commit
2806858db1
|
|
@ -2139,12 +2139,12 @@
|
||||||
{ "id": "multiclock",
|
{ "id": "multiclock",
|
||||||
"name": "Multi Clock",
|
"name": "Multi Clock",
|
||||||
"icon": "multiclock.png",
|
"icon": "multiclock.png",
|
||||||
"version":"0.07",
|
"version":"0.08",
|
||||||
"description": "Clock with multiple faces - Big, Analogue, Digital, Text, Time-Date.\n Switch between faces with BTN1 & BTN3",
|
"description": "Clock with multiple faces - Big, Analogue, Digital, Text, Time-Date.\n Switch between faces with BTN1 & BTN3",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
"allow_emulator":false,
|
"allow_emulator":true,
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"multiclock.app.js","url":"clock.js"},
|
{"name":"multiclock.app.js","url":"clock.js"},
|
||||||
{"name":"big.face.js","url":"big.js"},
|
{"name":"big.face.js","url":"big.js"},
|
||||||
|
|
@ -2483,7 +2483,7 @@
|
||||||
{ "id": "dtlaunch",
|
{ "id": "dtlaunch",
|
||||||
"name": "Desktop Launcher",
|
"name": "Desktop Launcher",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"version":"0.02",
|
"version":"0.03",
|
||||||
"description": "Desktop style App Launcher with six apps per page - fast access if you have lots of apps installed.",
|
"description": "Desktop style App Launcher with six apps per page - fast access if you have lots of apps installed.",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"tags": "tool,system,launcher",
|
"tags": "tool,system,launcher",
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
0.01: Initial version
|
0.01: Initial version
|
||||||
0.02: Multiple pages
|
0.02: Multiple pages
|
||||||
|
0.03: cycle thru pages
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ apps.sort((a,b)=>{
|
||||||
var Napps = apps.length;
|
var Napps = apps.length;
|
||||||
var Npages = Math.ceil(Napps/6);
|
var Npages = Math.ceil(Napps/6);
|
||||||
var maxPage = Npages-1;
|
var maxPage = Npages-1;
|
||||||
var selected = -1;
|
var selected = 0;
|
||||||
var oldselected = -1;
|
var oldselected = -1;
|
||||||
var page = 0;
|
var page = 0;
|
||||||
|
|
||||||
|
|
@ -45,10 +45,10 @@ Bangle.on("swipe",(dir)=>{
|
||||||
selected = 0;
|
selected = 0;
|
||||||
oldselected=-1;
|
oldselected=-1;
|
||||||
if (dir<0){
|
if (dir<0){
|
||||||
++page; if (page>maxPage) page=maxPage;
|
++page; if (page>maxPage) page=0;
|
||||||
drawPage(page);
|
drawPage(page);
|
||||||
} else {
|
} else {
|
||||||
--page; if (page<0) page=0;
|
--page; if (page<0) page=maxPage;
|
||||||
drawPage(page);
|
drawPage(page);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
0.05: Add README
|
0.05: Add README
|
||||||
0.06: Add txt clock
|
0.06: Add txt clock
|
||||||
0.07: Add Time Date clock and fix font sizes
|
0.07: Add Time Date clock and fix font sizes
|
||||||
|
0.08: Add pinned clock face
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
(function(){return function(){function e(a,d,b,c){a*=k;g.fillPoly([120+Math.sin(a)*d,134-Math.cos(a)*d,120+Math.sin(a+h)*c,134-Math.cos(a+h)*c,120+Math.sin(a)*b,134-Math.cos(a)*b,120+Math.sin(a-h)*c,134-Math.cos(a-h)*c])}function l(){g.setColor(0,0,0);e(360*f.getSeconds()/60,-5,90,3);0===f.getSeconds()&&(e(360*(d.getHours()+d.getMinutes()/60)/12,-16,60,7),e(360*d.getMinutes()/60,-16,86,7),d=new Date);g.setColor(1,1,1);e(360*(d.getHours()+d.getMinutes()/60)/12,-16,60,7);e(360*d.getMinutes()/60,-16,
|
|
||||||
86,7);g.setColor(0,1,1);f=new Date;e(360*f.getSeconds()/60,-5,90,3);g.setColor(0,0,0);g.fillCircle(120,134,2)}var h=Math.PI/2,k=Math.PI/180,d,f;return{init:function(){f=d=new Date;g.setColor(1,1,1);for(var a=0;60>a;a++){var e=360*a/60,b=e*k,c=120+100*Math.sin(b);b=134-100*Math.cos(b);0==e%90?(g.setColor(0,1,1),g.fillRect(c-6,b-6,c+6,b+6)):0==e%30?(g.setColor(0,1,1),g.fillRect(c-4,b-4,c+4,b+4)):(g.setColor(1,1,1),g.fillRect(c-1,b-1,c+1,b+1))}l()},tick:l}}})();
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
var FACES = [];
|
var FACES = [];
|
||||||
var iface = 0;
|
var STOR = require("Storage");
|
||||||
require("Storage").list(/\.face\.js$/).forEach(face=>FACES.push(eval(require("Storage").read(face))));
|
STOR.list(/\.face\.js$/).forEach(face=>FACES.push(eval(require("Storage").read(face))));
|
||||||
|
var lastface = STOR.readJSON("multiclock.json")||{pinned:0};
|
||||||
|
var iface = lastface.pinned;
|
||||||
var face = FACES[iface]();
|
var face = FACES[iface]();
|
||||||
var intervalRefSec;
|
var intervalRefSec;
|
||||||
|
|
||||||
|
|
@ -25,7 +27,14 @@ function setButtons(){
|
||||||
face = FACES[iface]();
|
face = FACES[iface]();
|
||||||
startdraw();
|
startdraw();
|
||||||
}
|
}
|
||||||
setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"});
|
function finish(){
|
||||||
|
if (lastface.pinned!=iface){
|
||||||
|
lastface.pinned=iface;
|
||||||
|
STOR.write("multiclock.json",lastface);
|
||||||
|
}
|
||||||
|
Bangle.showLauncher();
|
||||||
|
}
|
||||||
|
setWatch(finish, BTN2, {repeat:false,edge:"falling"});
|
||||||
setWatch(newFace.bind(null,1), BTN1, {repeat:true,edge:"rising"});
|
setWatch(newFace.bind(null,1), BTN1, {repeat:true,edge:"rising"});
|
||||||
setWatch(newFace.bind(null,-1), BTN3, {repeat:true,edge:"rising"});
|
setWatch(newFace.bind(null,-1), BTN3, {repeat:true,edge:"rising"});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue