From ed827e7ba6fff75f491195a2d61e03e00a194c45 Mon Sep 17 00:00:00 2001
From: Serge Bazanski <q3k@q3k.org>
Date: Fri, 4 Aug 2023 03:18:49 +0200
Subject: [PATCH] py: about WIP

---
 python_payload/main.py | 94 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)

diff --git a/python_payload/main.py b/python_payload/main.py
index df12e6501e..4826c70e7d 100644
--- a/python_payload/main.py
+++ b/python_payload/main.py
@@ -94,12 +94,104 @@ menu_badge = SimpleMenu(
     ],
     vm,
 )
+
+from st3m import InputState, Ctx
+from st3m.ui.view import ViewWithInputState
+from st3m.utils import tau
+import math
+
+
+class About(ViewWithInputState):
+    def __init__(self):
+        self.ts = 0.0
+        super().__init__()
+
+    def think(self, ins: InputState, delta_ms: int) -> None:
+        super().think(ins, delta_ms)
+        self.ts += delta_ms / 1000
+
+        if self.input.left_shoulder.middle.pressed:
+            print("exiting")
+
+    def draw(self, ctx: Ctx) -> None:
+        ctx.rectangle(-120, -120, 240, 240)
+        ctx.rgb(117 / 255, 255 / 255, 226 / 255)
+        ctx.fill()
+
+        ctx.arc(0, 350, 300, 0, tau, 0)
+        ctx.rgb(61 / 255, 165 / 255, 30 / 255)
+        ctx.fill()
+
+        ctx.save()
+        y = -40 + math.cos(self.ts * 2 + 10) * 10
+        ctx.translate(0, y)
+        for i in range(5):
+            a = i * tau / 5 + self.ts
+            size = 30 + math.cos(self.ts) * 5
+            ctx.save()
+            ctx.rotate(a)
+            ctx.translate(30, 0)
+            ctx.arc(0, 0, size, 0, tau, 0)
+            ctx.gray(1)
+            ctx.fill()
+            ctx.restore()
+
+        ctx.arc(0, 0, 20, 0, tau, 0)
+        ctx.rgb(255 / 255, 247 / 255, 46 / 255)
+        ctx.fill()
+        ctx.restore()
+
+        ctx.start_group()
+        ctx.global_alpha = 0.5
+        ctx.rgb(0, 0, 0)
+        ctx.arc(0, 0, 80, 0, tau, 0)
+        ctx.fill()
+        ctx.end_group()
+
+        ctx.start_group()
+        ctx.global_alpha = 1.0
+        ctx.gray(1)
+
+        ctx.text_align = ctx.MIDDLE
+
+        ctx.font = "Camp Font 2"
+        ctx.font_size = 50
+
+        ctx.move_to(0, -33)
+        ctx.text("flow3r")
+        ctx.move_to(0, -3)
+        ctx.text("badge")
+
+        ctx.font = "Camp Font 3"
+        ctx.font_size = 15
+
+        ctx.move_to(0, 25)
+        ctx.text("Chaos")
+        ctx.move_to(0, 40)
+        ctx.text("Communication")
+        ctx.move_to(0, 55)
+        ctx.text("Camp 2023")
+
+        ctx.end_group()
+
+
+menu_system = SimpleMenu(
+    [
+        MenuItemBack(),
+        MenuItemForeground("Settings", menu_settings),
+        MenuItemNoop("Disk Mode"),
+        MenuItemForeground("About", About()),
+        MenuItemNoop("Reboot"),
+    ],
+    vm,
+)
+
 menu_main = SunMenu(
     [
         MenuItemForeground("Badge", menu_badge),
         MenuItemForeground("Music", menu_music),
         MenuItemForeground("Apps", menu_apps),
-        MenuItemForeground("Settings", menu_settings),
+        MenuItemForeground("System", menu_system),
     ],
     vm,
 )
-- 
GitLab