From 8c0bb9a40c047e69da337111aa9a63a4213d5138 Mon Sep 17 00:00:00 2001 From: jusax23 Date: Thu, 9 Jun 2022 16:49:03 +0200 Subject: [PATCH] little fixes --- example/connect.js | 6 ++---- stear/extras/loading1.js | 9 +++++---- stear/main.js | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/example/connect.js b/example/connect.js index b2defd8..01c783a 100644 --- a/example/connect.js +++ b/example/connect.js @@ -20,14 +20,12 @@ _({find:"main"},[ left: "50%", top: "50%", transform: "translate(-50%, -50%)", - }},[ - l1() - ]) + }}, l1()) ]); export const call = async (stear, { find, resolve, render, call }, {name,id}) => { find.text._.innerText = "Connecting to: " + name + " (" + id + ")"; - await fadein(find.main._, 200, true); + await fadein(find.main._, 200, true); //do connection await wait(1000); var success = Math.random()>0.25; diff --git a/stear/extras/loading1.js b/stear/extras/loading1.js index 28773ec..adeb833 100644 --- a/stear/extras/loading1.js +++ b/stear/extras/loading1.js @@ -1,14 +1,16 @@ import { class_, Stear, _ } from "../main.js"; export class loading1 extends class_{ - constructor(){ + constructor(color){ super({ class: "box" }, [ - _(), _(), _() + _({ style: { backgroundColor: color}}), + _({ style: { backgroundColor: color}}), + _({ style: { backgroundColor: color}}), ]); } } -export const l1 = () => new loading1(); +export const l1 = (color="black") => new loading1(color); var animation = Stear.addAnimation({ @@ -35,7 +37,6 @@ Stear.addGlobalStyleJSON({ height: "44%", width: "44%", borderRadius: "25%", - backgroundColor: "#000", animation: `${animation} 6s linear infinite`, }, ".box div"); diff --git a/stear/main.js b/stear/main.js index 08a4293..006ab8b 100644 --- a/stear/main.js +++ b/stear/main.js @@ -209,6 +209,6 @@ export class class_ { return out; } } -export const _ = (settings = {}, childs = []) => new class_(settings,childs); +export const _ = (settings = {}, childs = []) => new class_(settings, Array.isArray(childs) ? childs : [childs]);