Skip to content

Commit

Permalink
sketch: map editor framing
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-moskal committed Jun 20, 2024
1 parent be4f2ab commit 6e8c9e2
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 8 deletions.
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

# ⚒ tinyforge

*small game, big strategies*

2 changes: 1 addition & 1 deletion s/dom/elements/app.css.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import {css} from "@benev/slate"

export const styles = css`
export default css`
:host {
display: block;
Expand Down
9 changes: 3 additions & 6 deletions s/dom/elements/app.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@

import {html} from "@benev/slate"

import {nexus} from "../nexus.js"
import {styles} from "./app.css.js"
import styles from "./app.css.js"
import {MapEditor} from "../views/map-editor.js"

export const TinyforgeApp = nexus.shadow_component(use => {
use.styles(styles)

return html`
<h1>TINYFORGE</h1>
`
return MapEditor([])
})

32 changes: 32 additions & 0 deletions s/dom/views/map-editor.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

import {css} from "@benev/slate"

export default css`
.easel {
display: block;
position: relative;
width: 100%;
height: 100%;
}
canvas {
width: 100%;
height: 100%;
background: #222;
}
.sidebar {
position: absolute;
width: 3em;
height: 100%;
background: #333a;
top: 0;
&.alpha { left: 0; }
&.bravo { right: 0; }
}
`

18 changes: 18 additions & 0 deletions s/dom/views/map-editor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

import {html} from "@benev/slate"

import {nexus} from "../nexus.js"
import styles from "./map-editor.css.js"

export const MapEditor = nexus.shadow_view(use => () => {
use.styles(styles)

return html`
<div class="easel">
<canvas></canvas>
<div class="sidebar alpha"></div>
<div class="sidebar bravo"></div>
</div>
`
})

14 changes: 13 additions & 1 deletion s/index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@

* {
padding: 0;
margin: 0;
box-sizing: border-box;
}

html, body {
font-size: 16px;
background: #333;
background: #111;
color: #fffc;
height: 100%;
}

tinyforge-app {
margin: auto;
max-width: 100%;
max-height: 100%;
aspect-ratio: 16 / 9;
}

0 comments on commit 6e8c9e2

Please sign in to comment.