Merge pull request #3948 from pavelmachek/m_50_elite

elite: add elite clock
master
Rob Pilling 2025-07-27 21:57:44 +01:00 committed by GitHub
commit 0769af12c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 108 additions and 2 deletions

View File

@ -0,0 +1 @@
0.01: initial import

View File

@ -0,0 +1,5 @@
# Elite clock ![](app.png)
Simple binary clock for leet haxorz.
Written by: [Pavel Machek](https://github.com/pavelmachek)

View File

@ -0,0 +1 @@
require("heatshrink").decompress(atob("mEwgIspiEPgEeAoU/4F/wGAiEAsEA4AFImAHBAolj/gRD4YFEC4UPwEfgAFC4EfF5IpHAp4dC4EQv/A/+AHYJlDnjY/AH4AJ"))

BIN
apps/eliteclock/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -0,0 +1,86 @@
// Bangle.js 2 - Binary Leet ClockZ
/*
bangle.js2: create binary 'leet clock' where the time is shown as text
"leet clockz" with binary 0 being normal character and binary one
being leet translation. Be careful to only update time on minute
boundaries.
So yeah 1337 c10ckZ = certified leetspeak 😎
ChatGPT said:
Alright, heres a hardcore hacker variant of elite clock in full-on aggressive leetspeak:
£|173 ¢|_0¢|<Z
Breakdown:
E £ or 3
L | or £
I 1 or !
T 7 or +
C ¢ or (
O 0
K |< or X
Other extreme variants:
3|173 (|_0(<Z
|!73 ©|0xX
3L1+3 (L0XXZ
*/
const TEXT = "leet\nclockz";
const LEET = {
"l": "1",
"e": "3",
"t": "7",
" ": " ",
"c": "(",
"o": "0",
"k": "X",
"z": "2"
};
// Convert hour (12h) and minute to binary mask
function getBinaryFromTime(d) {
let h = d.getHours() % 12;
if (h === 0) h = 12; // 12-hour format: 0 becomes 12
const m = d.getMinutes();
const bin = ((h << 7) | m).toString(2).padStart(11, '0');
return bin;
}
// Map normal characters to leet if binary mask says so
function getDisplayText(binMask) {
return TEXT.split("").map((ch, i) =>
binMask[i] === '1' ? (LEET[ch] || ch) : ch
).join("");
}
function draw() {
g.reset().clear();
const now = new Date();
const bin = getBinaryFromTime(now);
const txt = getDisplayText(bin);
const w = 0;
g.setFont("Vector", 47).setFontAlign(0,0);
g.drawString(txt, (g.getWidth() - w) / 2, (g.getHeight() - 0) / 2);
}
function scheduleNextDraw() {
const now = new Date();
const msToNextMin = 60000 - (now.getSeconds() * 1000 + now.getMilliseconds());
setTimeout(() => {
draw();
scheduleNextDraw();
}, msToNextMin);
}
// Init
draw();
scheduleNextDraw();
//Bangle.loadWidgets();
//Bangle.drawWidgets();

View File

@ -0,0 +1,14 @@
{ "id": "eliteclock",
"name": "Elite clock",
"version": "0.01",
"description": "Simple binary clock for leet haxorz",
"icon": "app.png",
"readme": "README.md",
"supports" : ["BANGLEJS2"],
"type": "clock",
"tags": "clock",
"storage": [
{"name":"eliteclock.app.js","url":"eliteclock.app.js"},
{"name":"eliteclock.img","url":"app-icon.js","evaluate":true}
]
}

View File

@ -16,5 +16,4 @@ It is also possible to load existing icon into editor, using
"load_icon("");" command. At the end of iconbits.app.js file there are
more utility functions.
Create 48x48 icon in gimp.

BIN
apps/iconbits/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB