diff --git a/app.js b/app.js index 87b4e2d..db0a8fc 100644 --- a/app.js +++ b/app.js @@ -8,6 +8,24 @@ const {DOM} = Gale({ }, Outline: { border: "2px solid orange" + }, + Window:{ + height: "100vh", + border: "2px solid black", + display: "flex", + flexDirection: "row", + alignItems: "end", + justifyContent: "center", + gap: "10px" + }, + Ability:{ + width: "50px", + height: "50px", + background: "red", + transition: "all 0.4s", + ":hover":{ + transform:"scale(1.1)" + } } }); @@ -22,6 +40,21 @@ const Store =(obj, key)=> { return store; } + + +const UI =()=> +{ + return DOM.div.Window( + DOM.div.Ability(), + DOM.div.Ability(), + DOM.div.Ability(), + ) +} + +van.add(document.body, UI()); + + + const items = Store({ pending:"", todos:/** @type {Todo[]}*/([]) @@ -40,6 +73,4 @@ const TodoList = () => { a({onclick: deleter}, "❌"), )), ) -} - -van.add(document.body, TodoList()); \ No newline at end of file +} \ No newline at end of file diff --git a/gale.js b/gale.js index 302da8f..2ecf1d7 100644 --- a/gale.js +++ b/gale.js @@ -41,33 +41,29 @@ globalThis.Gale =sheet=> } return args.map((arg)=>extractLast(KeyGroup, extractLast(KeyChild, arg))).join(id+" ")+id; } - - let pending = false; - let mentioned = []; - const collector = new Proxy( - (...args)=> - { - const element = van.tags[pending](...args); - element.className = mentioned.join(" "); - return element; - }, - { - get(_, prop) - { - mentioned.push(prop.substring(prop.lastIndexOf(".")+1)); - return collector; - } - } - ); - - + classes.CSS = css; classes.DOM = new Proxy( {}, {get(_, prop) { - pending = prop; - mentioned = []; + const pending = prop; + const mentioned = []; + const collector = new Proxy( + (...args)=> + { + const element = van.tags[pending](...args); + element.className = mentioned.join(" "); + return element; + }, + { + get(_, prop) + { + mentioned.push(prop.substring(prop.lastIndexOf(".")+1)); + return collector; + } + } + ); return collector; } } diff --git a/index.html b/index.html index 2eeec3b..9edf7ff 100644 --- a/index.html +++ b/index.html @@ -3,21 +3,12 @@