From 819e253b8f9304b6b1ce64621bd7893999c0d969 Mon Sep 17 00:00:00 2001 From: jusax23 Date: Fri, 16 Dec 2022 23:10:27 +0100 Subject: [PATCH] mode selection --- pages/{system => led}/led.jsx | 1 - pages/menu.jsx | 36 ++++++++++++++++++++++++-------- pages/{led => system}/system.jsx | 1 - 3 files changed, 27 insertions(+), 11 deletions(-) rename pages/{system => led}/led.jsx (89%) rename pages/{led => system}/system.jsx (89%) diff --git a/pages/system/led.jsx b/pages/led/led.jsx similarity index 89% rename from pages/system/led.jsx rename to pages/led/led.jsx index 4c89b40..e4db149 100644 --- a/pages/system/led.jsx +++ b/pages/led/led.jsx @@ -4,7 +4,6 @@ import { SWindow, s } from "../../stear/main"; export default new SWindow({ call: async (stear,{find, resolve, close, render, call, event, include},args)=>{ - call(connect,{},false); return
led Main
; diff --git a/pages/menu.jsx b/pages/menu.jsx index 0f8e664..8c9584f 100644 --- a/pages/menu.jsx +++ b/pages/menu.jsx @@ -1,7 +1,9 @@ import * as color from "../js/color.js"; import { Stear, SWindow, _, s } from "../stear/main.js"; import { fadein } from "../stear/utils.js"; +import led from "./led/led.jsx"; import remote from "./remote/remote.jsx"; +import system from "./system/system.jsx"; const pool = Stear.addLanguagePool("home"); const connected = pool.add("conncted", "Connected to: {}"); @@ -19,17 +21,16 @@ export default new SWindow({ let window = 0; let wins = [ - include(remote) + include(system), + include(remote), + include(led), ]; - let show = 0; return
-
-
+
+
{() => { - console.log("rerender"); return ["#0f0", "#00f", "#ff0"].map((d, i) => { - return
-
rigth
+
+ {() => { + return ["#eee", "#00f", "linear-gradient(90deg,rgba(255, 0, 0, 1) 0%,rgba(255, 154, 0, 1) 10%,rgba(208, 222, 33, 1) 20%,rgba(79, 220, 74, 1) 30%,rgba(63, 218, 216, 1) 40%,rgba(47, 201, 226, 1) 50%,rgba(28, 127, 238, 1) 60%,rgba(95, 21, 242, 1) 70%,rgba(186, 12, 248, 1) 80%,rgba(251, 7, 217, 1) 90%,rgba(255, 0, 0, 1) 100%)"].map((d, i) => { + return
{ + window = i; + find.main.rerender(); + } + }}>
; + }); + }} +
{()=>{ - wins[show].opts.render(); - return wins[show].render({ + wins[window].opts.render(); + return wins[window].render({ style: { height: "100%", width: "100%" diff --git a/pages/led/system.jsx b/pages/system/system.jsx similarity index 89% rename from pages/led/system.jsx rename to pages/system/system.jsx index 9cb1958..54307b7 100644 --- a/pages/led/system.jsx +++ b/pages/system/system.jsx @@ -4,7 +4,6 @@ import { SWindow, s } from "../../stear/main"; export default new SWindow({ call: async (stear,{find, resolve, close, render, call, event, include},args)=>{ - call(connect,{},false); return
system Main
;