From fb726843287fee3e119576ed6e1d10ecb24af372 Mon Sep 17 00:00:00 2001 From: jusax23 Date: Thu, 3 Nov 2022 22:12:53 +0100 Subject: [PATCH] example restructure --- example/{ => menu}/apps.jsx | 2 +- example/{ => menu}/connect.js | 8 ++++---- example/{ => menu}/empty.js | 2 +- example/{ => menu}/index.html | 0 example/{ => menu}/index.js | 4 ++-- example/{ => menu}/logo.png | Bin example/{ => menu}/menu.jsx | 7 ++++--- example/{ => menu}/settings.jsx | 4 ++-- example/{ => menu}/splash.jsx | 2 +- example/{ => menu}/start.jsx | 18 ++---------------- package.json | 3 +-- 11 files changed, 18 insertions(+), 32 deletions(-) rename example/{ => menu}/apps.jsx (79%) rename example/{ => menu}/connect.js (85%) rename example/{ => menu}/empty.js (76%) rename example/{ => menu}/index.html (100%) rename example/{ => menu}/index.js (78%) rename example/{ => menu}/logo.png (100%) rename example/{ => menu}/menu.jsx (92%) rename example/{ => menu}/settings.jsx (77%) rename example/{ => menu}/splash.jsx (79%) rename example/{ => menu}/start.jsx (65%) diff --git a/example/apps.jsx b/example/menu/apps.jsx similarity index 79% rename from example/apps.jsx rename to example/menu/apps.jsx index b808b1d..34fdd0a 100644 --- a/example/apps.jsx +++ b/example/menu/apps.jsx @@ -1,4 +1,4 @@ -import { Stear, SWindow, _, s } from "../stear/main.js"; +import { Stear, SWindow, _, s } from "../../stear/main.js"; const call = async (stear, { find, resolve, close, render, call, event }, args) => { diff --git a/example/connect.js b/example/menu/connect.js similarity index 85% rename from example/connect.js rename to example/menu/connect.js index b2e93a5..22e97b1 100644 --- a/example/connect.js +++ b/example/menu/connect.js @@ -1,7 +1,7 @@ -import l1 from "../stear/extra/Elements/loading1.js"; -import showStatus from "../stear/extra/Pages/showStatus.js"; -import { Stear, SWindow, _ } from "../stear/main.js"; -import { fadein, fadeout, wait } from "../stear/utils.js"; +import l1 from "../../stear/extra/Elements/loading1.js"; +import showStatus from "../../stear/extra/Pages/showStatus.js"; +import { Stear, SWindow, _ } from "../../stear/main.js"; +import { fadein, fadeout, wait } from "../../stear/utils.js"; const pool = Stear.addLanguagePool("connect"); const connectingto = pool.add("connectingto", "Connecting to: {} ({})"); diff --git a/example/empty.js b/example/menu/empty.js similarity index 76% rename from example/empty.js rename to example/menu/empty.js index de190b4..4ef7839 100644 --- a/example/empty.js +++ b/example/menu/empty.js @@ -1,4 +1,4 @@ -import { Stear, SWindow, _ } from "../stear/main.js"; +import { Stear, SWindow, _ } from "../../stear/main.js"; const call = async (stear, { find, resolve, close, render, call, event }, args) => { diff --git a/example/index.html b/example/menu/index.html similarity index 100% rename from example/index.html rename to example/menu/index.html diff --git a/example/index.js b/example/menu/index.js similarity index 78% rename from example/index.js rename to example/menu/index.js index d7aeae0..fddf94a 100644 --- a/example/index.js +++ b/example/menu/index.js @@ -1,6 +1,6 @@ -import { Stear, SWindow } from "../stear/main.js"; +import { Stear, SWindow } from "../../stear/main.js"; -import start from "./start.jsx"; +import start from "./start"; var stear = new Stear(document.querySelector("#stear")); diff --git a/example/logo.png b/example/menu/logo.png similarity index 100% rename from example/logo.png rename to example/menu/logo.png diff --git a/example/menu.jsx b/example/menu/menu.jsx similarity index 92% rename from example/menu.jsx rename to example/menu/menu.jsx index 4a92223..56376be 100644 --- a/example/menu.jsx +++ b/example/menu/menu.jsx @@ -1,4 +1,4 @@ -import { Stear, SWindow, _, s } from "../stear/main.js"; +import { Stear, SWindow, _, s } from "../../stear/main.js"; import apps from "./apps"; import settings from "./settings"; import splash from "./splash"; @@ -11,6 +11,8 @@ const call = async (stear, { find, resolve, close, render, call, include, event /*event.onBeforRerender = async () => { }*/ /*event.onAfterRerender = async () => { }*/ + event.onHashChange + let menu = [ include(splash), include(apps), @@ -26,7 +28,6 @@ const call = async (stear, { find, resolve, close, render, call, include, event width: "100%", flexDirection: "column", }}> -
; } -export default new SWindow({ call, backgroundColor: "#dde" }); \ No newline at end of file +export default new SWindow({ call, backgroundColor: "#dde", hash:"/" }); \ No newline at end of file diff --git a/example/settings.jsx b/example/menu/settings.jsx similarity index 77% rename from example/settings.jsx rename to example/menu/settings.jsx index ff894c7..d50a459 100644 --- a/example/settings.jsx +++ b/example/menu/settings.jsx @@ -1,5 +1,5 @@ -import prompt from "../stear/extra/Pages/prompt.js"; -import { Stear, SWindow, _, s } from "../stear/main.js"; +import prompt from "../../stear/extra/Pages/prompt.js"; +import { Stear, SWindow, _, s } from "../../stear/main.js"; const call = async (stear, { find, resolve, close, render, call, event }, args) => { diff --git a/example/splash.jsx b/example/menu/splash.jsx similarity index 79% rename from example/splash.jsx rename to example/menu/splash.jsx index bac33b2..6aec1af 100644 --- a/example/splash.jsx +++ b/example/menu/splash.jsx @@ -1,4 +1,4 @@ -import { Stear, SWindow, _, s } from "../stear/main.js"; +import { Stear, SWindow, _, s } from "../../stear/main.js"; const call = async (stear, { find, resolve, close, render, call, event }, args) => { diff --git a/example/start.jsx b/example/menu/start.jsx similarity index 65% rename from example/start.jsx rename to example/menu/start.jsx index 11e38c7..a50ac2c 100644 --- a/example/start.jsx +++ b/example/menu/start.jsx @@ -1,5 +1,5 @@ -import { Stear, SWindow, _,s } from "../stear/main.js"; -import { fadein, fadeout, wait } from "../stear/utils.js"; +import { Stear, SWindow, _,s } from "../../stear/main.js"; +import { fadein, fadeout, wait } from "../../stear/utils.js"; //import connect from "./connect.js"; import menu from "./menu"; @@ -37,20 +37,6 @@ export const call = (stear, { find, resolve, render, call, event }, args) => { animation: `${wobel} 1s ease-in-out 0s infinite`, }}/>
; - /*return _({ style: { zindex: 1000 }, find: "main" }, [ - _({ - type: "img", src: "http://localhost:82/images/logo.png", style: { - width: "80vw", - maxWidth: "75vh", - position: "absolute", - left: "50%", - top: "50%", - transform: "translate(-50%, -50%)", - animation: `${wobel} 2s ease-in-out 0s infinite`, - - } - }) - ]);*/ } export default new SWindow({ preRender: true, call, backgroundColor:"#dde"}); \ No newline at end of file diff --git a/package.json b/package.json index 40801d0..8a3c473 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "buildExample": "esbuild example/index.js --jsx-factory=s --loader:.js=jsx --bundle --minify --outdir=build --sourcemap", - "serveExample": "esbuild example/index.js --jsx-factory=s --loader:.js=jsx --bundle --minify --servedir=example --sourcemap" + "serveMenu": "esbuild example/menu/index.js --jsx-factory=s --loader:.js=jsx --loader:.html=text --bundle --minify --servedir=example/menu --sourcemap" }, "repository": { "type": "git",