diff --git a/client/assets/styles/menu.less b/client/assets/styles/menu.less index 1d76995f..d68c2068 100644 --- a/client/assets/styles/menu.less +++ b/client/assets/styles/menu.less @@ -117,19 +117,39 @@ section { } .demo { - margin-top: 5em; + margin-top: 1em; + + display: grid; + grid-template-areas: + "vinfo game" + "vcons game"; + + grid-template-columns: 1fr 1fr; .colour-info { - display: grid; - grid-template-columns: 2fr 1fr; + grid-area: vinfo; + display: flex; + align-items: center; div { display: flex; } + + svg { + flex: 1; + height: 1em; + } } - svg { - flex: 1; - display: inline; + .game { + grid-area: game; + } + + .construct-list { + grid-area: vcons; + + svg { + height: 100%; + } } } \ No newline at end of file diff --git a/client/src/components/demo.jsx b/client/src/components/demo.jsx index 9e40b4c3..1315c593 100644 --- a/client/src/components/demo.jsx +++ b/client/src/components/demo.jsx @@ -8,9 +8,15 @@ function Demo(args) { const items = this.state.items || ['Red', 'Red', 'Attack']; const combiner = this.state.combiner || []; + const { + equipping, + equipped, + } = this.state; + console.log(combiner, this.state); function inventoryBtn(i, j) { + if (!i) return ; const highlighted = combiner.indexOf(j) > -1; const classes = `${highlighted ? 'highlight' : ''}`; @@ -47,53 +53,90 @@ function Demo(args) { function inventoryElement() { return ( -
-

VBOX PHASE

-
+
+
+

+ VBOX PHASE {shapes.Red()} {shapes.Green()} {shapes.Blue()} +

combine the colour base items with an array of skills and specialisations to build powerful variants.

-
- {shapes.Red()} {shapes.Green()} {shapes.Blue()} +
+
 
+
+
+ {items.map((i, j) => inventoryBtn(i, j))}
+ {combinerBtn()}
-
- {items.map((i, j) => inventoryBtn(i, j))} -
- {combinerBtn()}
); } // progress setTimeout(() => { + if (equipped) { + return this.setState({ combiner: [], items: ['Red', 'Red', 'Attack'], equipped: false, equipping: false }); + } + + if (items.length === 1 && combiner[0] === 0) { + return this.setState({ combiner: [], items: [''], equipped: true, equipping: false }); + } + if (items.length === 1) { - this.setState({ combiner: [], items: ['Red', 'Red', 'Attack'], phase: 'game' }); - return true; + return this.setState({ combiner: [0], items: ['Strike'], equipping: true }); } if (combiner.length === 3) { - this.setState({ combiner: [], items: ['Strike'] }); - return true; + return this.setState({ combiner: [], items: ['Strike'] }); } combiner.push(combiner.length); this.setState({ combiner }); return true; - }, 2000); + }, 1500); + + const skills = ['Strike']; + + const btnClass = equipping + ? 'equipping empty gray' + : 'empty gray'; return ( -
+
{inventoryElement()} +
+ {[0, 1, 2].map(i => ( +
+ {molecule()} +

+
+ {i === 0 && this.state.equipped + ? + : + } + + +
+
+
+
+
+
+ ))} +
); }; + return ( -
+
{vboxDemo()} -
-
+
+

GAME PHASE

+
+ ); }