Finish all options sets

This commit is contained in:
Jas Singh
2024-07-20 22:59:25 -07:00
parent c6c4e0cf57
commit ab721edbd2
24 changed files with 514 additions and 392 deletions

View File

@@ -1,3 +1,7 @@
import options from "options";
const { military } = options.menus.clock.time;
const time = Variable("", {
poll: [1000, 'date "+%I:%M:%S"'],
});
@@ -6,6 +10,10 @@ const period = Variable("", {
poll: [1000, 'date "+%p"'],
});
const militaryTime = Variable("", {
poll: [1000, 'date "+%H:%M:%S"'],
});
const TimeWidget = () => {
return Widget.Box({
class_name: "calendar-menu-item-container clock",
@@ -17,27 +25,43 @@ const TimeWidget = () => {
vpack: "center",
hpack: "center",
class_name: "clock-content-items",
children: [
Widget.Box({
hpack: "center",
children: [
Widget.Label({
class_name: "clock-content-time",
label: time.bind(),
children: military.bind("value").as((is24hr) => {
if (!is24hr) {
return [
Widget.Box({
hpack: "center",
children: [
Widget.Label({
class_name: "clock-content-time",
label: time.bind(),
}),
],
}),
],
}),
Widget.Box({
hpack: "center",
children: [
Widget.Label({
vpack: "end",
class_name: "clock-content-period",
label: period.bind(),
Widget.Box({
hpack: "center",
children: [
Widget.Label({
vpack: "end",
class_name: "clock-content-period",
label: period.bind(),
}),
],
}),
],
}),
],
];
}
return [
Widget.Box({
hpack: "center",
children: [
Widget.Label({
class_name: "clock-content-time",
label: militaryTime.bind(),
}),
],
}),
];
}),
}),
});
};